Skip to content

Commit f2f1094

Browse files
authored
Merge pull request #13825 from guardian/doml/highlights-card-image-size
Use correct image size for highlights card
2 parents db59932 + f345b38 commit f2f1094

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

dotcom-rendering/src/components/Card/components/ImageWrapper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export type ImageSizeType =
2525
| 'jumbo'
2626
| 'carousel'
2727
| 'podcast'
28+
| 'highlights-card'
2829
| 'feature'
2930
| 'feature-large'
3031
| 'feature-immersive';

dotcom-rendering/src/components/CardPicture.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ const decideImageWidths = (
4444
case 'podcast':
4545
return [{ breakpoint: breakpoints.mobile, width: 80, aspectRatio }];
4646

47+
case 'highlights-card':
48+
return [
49+
{ breakpoint: breakpoints.mobile, width: 112, aspectRatio },
50+
];
51+
4752
case 'carousel':
4853
return [
4954
{ breakpoint: breakpoints.mobile, width: 220, aspectRatio },

dotcom-rendering/src/components/Masthead/HighlightsCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ const decideImage = (
165165
isCircular={false}
166166
aspectRatio="1:1"
167167
/>
168-
<div className="image-overlay"> </div>
168+
<div className="image-overlay" />
169169
</>
170170
);
171171
}
@@ -177,15 +177,15 @@ const decideImage = (
177177
return (
178178
<>
179179
<CardPicture
180-
imageSize="medium"
180+
imageSize="highlights-card"
181181
mainImage={image.src}
182182
alt={image.altText}
183183
loading={imageLoading}
184184
isCircular={true}
185185
aspectRatio="1:1"
186186
/>
187187
{/* This image overlay is styled when the CardLink is hovered */}
188-
<div className="image-overlay circular"> </div>
188+
<div className="image-overlay circular" />
189189
</>
190190
);
191191
};

0 commit comments

Comments
 (0)