Skip to content

Commit d9bab69

Browse files
authored
Merge branch 'main' into jm/feat-improve-ipad-targeting-query-param
2 parents 9e14e32 + b608b0d commit d9bab69

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { breakpoints } from '@guardian/source/foundations';
22
import type { Meta, StoryObj } from '@storybook/react-webpack5';
33
import { discussionApiUrl } from '../../fixtures/manual/discussionApiUrl';
44
import {
5+
getSublinks,
56
opinionTrails,
67
selfHostedVideo54Card,
78
slideshowCard,
@@ -280,6 +281,21 @@ export const GigaBoostedSplashWithLiveUpdates: Story = {
280281
},
281282
};
282283

284+
export const SplashWithLiveUpdatesAndTwoSublinks: Story = {
285+
name: 'Standard splash with live updates and two sublinks',
286+
args: {
287+
frontSectionTitle: 'Standard splash',
288+
groupedTrails: {
289+
...emptyGroupedTrails,
290+
snap: [],
291+
standard: [
292+
{ ...liveUpdatesCard, supportingContent: getSublinks(2) },
293+
],
294+
},
295+
collectionId: 1,
296+
},
297+
};
298+
283299
export const SelfHostedVideoCard: Story = {
284300
name: 'Self-hosted video cards',
285301
args: {

dotcom-rendering/src/components/FlexibleSpecial.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ const determineCardProperties = (
5454
supportingContentLength: number,
5555
mediaCard: boolean,
5656
imageSuppressed: boolean,
57+
hasLiveUpdates: boolean,
5758
): BoostProperties => {
59+
const shouldDisplaySublinksHorizontally =
60+
supportingContentLength >= 3 || hasLiveUpdates;
61+
5862
switch (boostLevel) {
5963
// The default boost level is equal to no boost. It is the same as the default card layout.
6064
case 'default':
@@ -67,8 +71,9 @@ const determineCardProperties = (
6771
mediaSize: 'xlarge',
6872
mediaPositionOnDesktop: 'right',
6973
mediaPositionOnMobile: mediaCard ? 'top' : 'bottom',
70-
supportingContentAlignment:
71-
supportingContentLength >= 3 ? 'horizontal' : 'vertical',
74+
supportingContentAlignment: shouldDisplaySublinksHorizontally
75+
? 'horizontal'
76+
: 'vertical',
7277
liveUpdatesAlignment: 'vertical',
7378
trailTextSize: 'regular',
7479
subtitleSize: 'medium',
@@ -83,8 +88,9 @@ const determineCardProperties = (
8388
mediaSize: 'xlarge',
8489
mediaPositionOnDesktop: 'right',
8590
mediaPositionOnMobile: mediaCard ? 'top' : 'bottom',
86-
supportingContentAlignment:
87-
supportingContentLength >= 3 ? 'horizontal' : 'vertical',
91+
supportingContentAlignment: shouldDisplaySublinksHorizontally
92+
? 'horizontal'
93+
: 'vertical',
8894
liveUpdatesAlignment: 'vertical',
8995
trailTextSize: 'regular',
9096
subtitleSize: 'medium',
@@ -166,6 +172,7 @@ export const OneCardLayout = ({
166172
card.supportingContent?.length ?? 0,
167173
isMediaCard(card.format),
168174
!card.image,
175+
card.showLivePlayable,
169176
);
170177

171178
return (

0 commit comments

Comments
 (0)