Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions dotcom-rendering/src/components/FlexibleSpecial.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { breakpoints } from '@guardian/source/foundations';
import type { Meta, StoryObj } from '@storybook/react-webpack5';
import { discussionApiUrl } from '../../fixtures/manual/discussionApiUrl';
import {
getSublinks,
opinionTrails,
selfHostedVideo54Card,
slideshowCard,
Expand Down Expand Up @@ -280,6 +281,21 @@ export const GigaBoostedSplashWithLiveUpdates: Story = {
},
};

export const SplashWithLiveUpdatesAndTwoSublinks: Story = {
name: 'Standard splash with live updates and two sublinks',
args: {
frontSectionTitle: 'Standard splash',
groupedTrails: {
...emptyGroupedTrails,
snap: [],
standard: [
{ ...liveUpdatesCard, supportingContent: getSublinks(2) },
],
},
collectionId: 1,
},
};

export const SelfHostedVideoCard: Story = {
name: 'Self-hosted video cards',
args: {
Expand Down
15 changes: 11 additions & 4 deletions dotcom-rendering/src/components/FlexibleSpecial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ const determineCardProperties = (
supportingContentLength: number,
mediaCard: boolean,
imageSuppressed: boolean,
hasLiveUpdates: boolean,
): BoostProperties => {
const shouldDisplaySublinksHorizontally =
supportingContentLength >= 3 || hasLiveUpdates;

switch (boostLevel) {
// The default boost level is equal to no boost. It is the same as the default card layout.
case 'default':
Expand All @@ -67,8 +71,9 @@ const determineCardProperties = (
mediaSize: 'xlarge',
mediaPositionOnDesktop: 'right',
mediaPositionOnMobile: mediaCard ? 'top' : 'bottom',
supportingContentAlignment:
supportingContentLength >= 3 ? 'horizontal' : 'vertical',
supportingContentAlignment: shouldDisplaySublinksHorizontally
? 'horizontal'
: 'vertical',
liveUpdatesAlignment: 'vertical',
trailTextSize: 'regular',
subtitleSize: 'medium',
Expand All @@ -83,8 +88,9 @@ const determineCardProperties = (
mediaSize: 'xlarge',
mediaPositionOnDesktop: 'right',
mediaPositionOnMobile: mediaCard ? 'top' : 'bottom',
supportingContentAlignment:
supportingContentLength >= 3 ? 'horizontal' : 'vertical',
supportingContentAlignment: shouldDisplaySublinksHorizontally
? 'horizontal'
: 'vertical',
liveUpdatesAlignment: 'vertical',
trailTextSize: 'regular',
subtitleSize: 'medium',
Expand Down Expand Up @@ -166,6 +172,7 @@ export const OneCardLayout = ({
card.supportingContent?.length ?? 0,
isMediaCard(card.format),
!card.image,
card.showLivePlayable,
);

return (
Expand Down
Loading