Skip to content

Commit 4cecbf7

Browse files
committed
Fix story package trail images for gallery articles
1 parent 3d7ad15 commit 4cecbf7

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

dotcom-rendering/src/components/ScrollableSmallOnwards.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ const getDefaultCardProps = (
226226
mediaPositionOnMobile: 'left',
227227
headlineSizes: {
228228
desktop: 'xxsmall',
229-
tablet: 'xxsmall',
230229
mobile: 'xxxsmall',
231230
},
232231
trailText: undefined,
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { FEStoryPackage } from './frontend/feArticle';
2-
import { decideTrail } from './lib/decideTrail';
2+
import { decideTrail, decideTrailWithMasterImage } from './lib/decideTrail';
33
import type { TrailType } from './types/trails';
44

55
export type StoryPackage = {
@@ -9,13 +9,16 @@ export type StoryPackage = {
99

1010
export const parse = (
1111
feStoryPackage: FEStoryPackage | undefined,
12+
withMasterImage: boolean = false,
1213
): StoryPackage | undefined => {
1314
if (feStoryPackage === undefined) {
1415
return undefined;
1516
}
1617

1718
return {
1819
heading: feStoryPackage.heading,
19-
trails: feStoryPackage.trails.map(decideTrail),
20+
trails: feStoryPackage.trails.map(
21+
withMasterImage ? decideTrailWithMasterImage : decideTrail,
22+
),
2023
};
2124
};

dotcom-rendering/src/types/article.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ export const enhanceArticleType = (
117117
data.main,
118118
)(data.mainMediaElements);
119119

120-
const storyPackage = parseStoryPackage(data.storyPackage);
120+
const storyPackage = parseStoryPackage(
121+
data.storyPackage,
122+
format.design === ArticleDesign.Gallery,
123+
);
121124

122125
if (format.design === ArticleDesign.Gallery) {
123126
const design = ArticleDesign.Gallery;

0 commit comments

Comments
 (0)