Skip to content

Commit

Permalink
Merge branch 'main' into ab/podcast-accent-image
Browse files Browse the repository at this point in the history
  • Loading branch information
abeddow91 authored Jan 9, 2025
2 parents bc84645 + b3567e9 commit fc527cb
Show file tree
Hide file tree
Showing 19 changed files with 126 additions and 790 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
# All rendering apps deployment
- name: Upload rendering apps to RiffRaff
uses: guardian/actions-riff-raff@v4
uses: guardian/actions-riff-raff@v4.1.2
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@guardian/bridget": "8.1.0",
"@guardian/browserslist-config": "6.1.0",
"@guardian/cdk": "50.13.0",
"@guardian/commercial": "23.7.4",
"@guardian/commercial": "24.0.0",
"@guardian/core-web-vitals": "7.0.0",
"@guardian/eslint-config": "7.0.1",
"@guardian/eslint-config-typescript": "9.0.1",
Expand Down
10 changes: 10 additions & 0 deletions dotcom-rendering/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ export const Card = ({
/** If the card isn't large enough to have a kicker image then we use the podcast series image as the main media. Otherwise, use the trail image */
<>
{media.podcastImage.src && !showKickerImage ? (

<div css={[podcastImageStyles(imageSize)]}>
<CardPicture
mainImage={media.podcastImage.src}
Expand Down Expand Up @@ -1017,6 +1018,15 @@ export const Card = ({
</CardLayout>

<div
css={
/** If beta containers have liveblog links or sublink links in the outer position, we set flex-basis so that they sit below the image */
isBetaContainer &&
(liveUpdatesPosition === 'outer' ||
sublinkPosition === 'outer') &&
css`
flex-basis: 100%;
`
}
style={{
padding:
isMediaCard || isOnwardContent ? `0 ${space[2]}px` : 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,8 @@ export const ImageWrapper = ({
return (
<div
css={[
imageType === 'slideshow' &&
isHorizontalOnDesktop &&
flexBasisStyles({
imageSize,
}),
(imageType === 'picture' ||
(imageType === 'slideshow' ||
imageType === 'picture' ||
imageType === 'video' ||
imageType === 'podcast') &&
isHorizontalOnDesktop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,16 @@ export const WithLiveKicker: Story = {
parameters: {},
name: 'With Live Kicker',
};

export const WithStarRating: Story = {
args: {
format: {
display: ArticleDisplay.Standard,
design: ArticleDesign.Standard,
theme: Pillar.Culture,
},
starRating: 4,
},
parameters: {},
name: 'With Star Rating',
};
24 changes: 24 additions & 0 deletions dotcom-rendering/src/components/Masthead/HighlightsCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { css } from '@emotion/react';
import { isUndefined } from '@guardian/libs';
import { between, from, until } from '@guardian/source/foundations';
import { ArticleDesign, type ArticleFormat } from '../../lib/articleFormat';
import { isMediaCard } from '../../lib/cardHelpers';
import { palette } from '../../palette';
import type { StarRating as Rating } from '../../types/content';
import type { DCRFrontImage } from '../../types/front';
import type { MainMedia } from '../../types/mainMedia';
import { Avatar } from '../Avatar';
Expand All @@ -12,6 +14,7 @@ import type { Loading } from '../CardPicture';
import { CardPicture } from '../CardPicture';
import { FormatBoundary } from '../FormatBoundary';
import { Icon } from '../MediaMeta';
import { StarRating } from '../StarRating/StarRating';

export type HighlightsCardProps = {
linkTo: string;
Expand All @@ -26,6 +29,7 @@ export type HighlightsCardProps = {
dataLinkName: string;
byline?: string;
isExternalLink: boolean;
starRating?: Rating;
};

const gridContainer = css`
Expand All @@ -37,6 +41,7 @@ const gridContainer = css`
gap: 8px;
grid-template-areas:
'headline headline'
'rating rating'
'media-icon image';
/* Applied word-break: break-word to prevent text overflow
Expand Down Expand Up @@ -121,6 +126,18 @@ const hoverStyles = css`
}
`;

const starWrapper = css`
background-color: ${palette('--star-rating-background')};
color: ${palette('--star-rating-fill')};
width: fit-content;
height: fit-content;
grid-area: rating;
${from.desktop} {
grid-area: media-icon;
align-self: flex-end;
}
`;

export const HighlightsCard = ({
linkTo,
format,
Expand All @@ -134,6 +151,7 @@ export const HighlightsCard = ({
dataLinkName,
byline,
isExternalLink,
starRating,
}: HighlightsCardProps) => {
const showMediaIcon = isMediaCard(format);

Expand Down Expand Up @@ -169,6 +187,12 @@ export const HighlightsCard = ({
/>
</div>

{!isUndefined(starRating) ? (
<div css={starWrapper}>
<StarRating rating={starRating} size="small" />
</div>
) : null}

{!!mainMedia && showMediaIcon && (
<div css={mediaIcon}>
<Icon mediaType={mainMedia.type} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export const ScrollableHighlights = ({ trails }: Props) => {
isExternalLink={trail.isExternalLink}
showQuotedHeadline={trail.showQuotedHeadline}
mainMedia={trail.mainMedia}
starRating={trail.starRating}
/>
</li>
);
Expand Down
68 changes: 0 additions & 68 deletions dotcom-rendering/src/components/Weather.stories.tsx

This file was deleted.

Loading

0 comments on commit fc527cb

Please sign in to comment.