Skip to content

Commit a119181

Browse files
committed
Add stories. Update space for live updates
1 parent 622fef9 commit a119181

File tree

2 files changed

+46
-11
lines changed

2 files changed

+46
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ export const Card = ({
666666
imagePositionOnMobile === 'bottom'
667667
) {
668668
return {
669-
row: 'tiny',
669+
row: showLivePlayable ? 'small' : 'tiny',
670670
column: 'large',
671671
};
672672
}

dotcom-rendering/src/components/FlexibleGeneral.stories.tsx

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const splashCard = {
3939
kickerText: 'Kicker for splash card',
4040
};
4141

42-
/** This creates a list of 8 standard cards which contain:
42+
/**
43+
* This creates a list of 8 standard cards which contain:
4344
* - a card with sublinks
4445
* - a media card
4546
* - a boosted card
@@ -173,13 +174,17 @@ export default meta;
173174
type Story = StoryObj<typeof meta>;
174175

175176
export const SplashWithStandards: Story = {
176-
name: 'Splash with standard cards',
177+
name: 'Splash with big and standard cards',
177178
args: {
178-
frontSectionTitle: 'Splash with stardards',
179+
frontSectionTitle: 'Splash with standards',
179180
groupedTrails: {
180181
...emptyGroupedTrails,
181182
splash: [{ ...splashCard, supportingContent: [] }],
182-
standard: standardCards,
183+
standard: standardCards.map((card, index) => ({
184+
...card,
185+
isBoosted: index === 0,
186+
boostLevel: index === 0 ? 'boost' : 'default',
187+
})),
183188
},
184189
},
185190
};
@@ -373,12 +378,6 @@ export const SplashWithImageSupression: Story = {
373378

374379
export const SplashWithLiveUpdates: Story = {
375380
name: 'Splash with live updates',
376-
args: {
377-
groupedTrails: {
378-
...emptyGroupedTrails,
379-
splash: [{ ...splashCard, image: undefined }],
380-
},
381-
},
382381
render: (args) => {
383382
global.fetch = mockLatestLinksReqFetch;
384383
const Section = ({
@@ -415,6 +414,42 @@ export const SplashWithLiveUpdates: Story = {
415414
},
416415
};
417416

417+
export const StandardBoostedWithLiveUpdates: Story = {
418+
name: 'Standard boosted with live updates',
419+
render: (args) => {
420+
global.fetch = mockLatestLinksReqFetch;
421+
const Section = ({
422+
title,
423+
boostLevel,
424+
}: {
425+
title: string;
426+
boostLevel: BoostLevel;
427+
}) => (
428+
<FrontSection
429+
title={title}
430+
discussionApiUrl={discussionApiUrl}
431+
editionId="UK"
432+
showTopBorder={true}
433+
>
434+
<FlexibleGeneral
435+
{...args}
436+
groupedTrails={{
437+
...emptyGroupedTrails,
438+
standard: [{ ...liveUpdatesCard, boostLevel }],
439+
}}
440+
/>
441+
</FrontSection>
442+
);
443+
444+
return (
445+
<>
446+
<Section title="Boosted" boostLevel="boost" />
447+
<Section title="Megaboosted" boostLevel="megaboost" />
448+
</>
449+
);
450+
},
451+
};
452+
418453
const slideshowCard = {
419454
...liveUpdatesCard,
420455
mainMedia: undefined,

0 commit comments

Comments
 (0)