Skip to content

Commit 3d9f84e

Browse files
committed
Use correct image size for scrollable medium images
1 parent 1187a11 commit 3d9f84e

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ const podcastImageStyles = (imageSize: MediaSizeType) => {
239239
}
240240
`;
241241

242-
case 'medium':
242+
case 'scrollable-medium':
243243
return css`
244244
width: 98px;
245245
height: 98px;

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

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

dotcom-rendering/src/components/CardPicture.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ const decideImageWidths = (
5050
{ breakpoint: breakpoints.mobile, width: 220, aspectRatio },
5151
];
5252

53+
case 'scrollable-medium':
54+
return [
55+
{ breakpoint: breakpoints.mobile, width: 200, aspectRatio },
56+
{
57+
breakpoint: breakpoints.mobileLandscape,
58+
width: 324,
59+
aspectRatio,
60+
},
61+
{ breakpoint: breakpoints.tablet, width: 160, aspectRatio },
62+
{ breakpoint: breakpoints.desktop, width: 220, aspectRatio },
63+
];
64+
5365
case 'small':
5466
return [
5567
{

dotcom-rendering/src/components/ScrollableMedium.importable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const ScrollableMedium = ({
6363
}}
6464
mediaPositionOnDesktop={imagePosition}
6565
mediaPositionOnMobile={imagePosition}
66-
mediaSize="medium"
66+
mediaSize="scrollable-medium"
6767
trailText={undefined} // unsupported
6868
supportingContent={undefined} // unsupported
6969
aspectRatio={aspectRatio}

0 commit comments

Comments
 (0)