Skip to content

Commit 6b03b4e

Browse files
authored
Merge pull request #14346 from guardian/doml/flex-splash-column-gap
Align flex splash image
2 parents 85e13f6 + a119181 commit 6b03b4e

File tree

3 files changed

+46
-32
lines changed

3 files changed

+46
-32
lines changed

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,6 @@ export const Card = ({
638638
};
639639
}
640640

641-
if (isFlexSplash) {
642-
return {
643-
row: 'small',
644-
column: 'none',
645-
};
646-
}
647-
648641
if (!isBetaContainer) {
649642
/**
650643
* Media cards have 4px padding around the content so we have a
@@ -673,7 +666,7 @@ export const Card = ({
673666
imagePositionOnMobile === 'bottom'
674667
) {
675668
return {
676-
row: 'tiny',
669+
row: showLivePlayable ? 'small' : 'tiny',
677670
column: 'large',
678671
};
679672
}
@@ -1092,11 +1085,6 @@ export const Card = ({
10921085
isBetaContainer,
10931086
isOnwardContent,
10941087
)}
1095-
padRight={
1096-
!!isFlexSplash &&
1097-
image &&
1098-
imagePositionOnDesktop === 'right'
1099-
}
11001088
>
11011089
{/* This div is needed to keep the headline and trail text justified at the start */}
11021090
<div

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ const paddingBetaContainerStyles = (
9999
}
100100
`;
101101

102-
const padRightStyles = css`
103-
${from.tablet} {
104-
padding-right: ${space[5]}px;
105-
}
106-
`;
107-
108102
const getImageDirection = (
109103
imagePosition: ImagePositionType,
110104
): ImageDirection => {
@@ -127,7 +121,6 @@ type Props = {
127121
imagePositionOnDesktop: ImagePositionType;
128122
imagePositionOnMobile: ImagePositionType;
129123
padContent?: 'small' | 'large';
130-
padRight?: boolean;
131124
};
132125

133126
export const ContentWrapper = ({
@@ -138,7 +131,6 @@ export const ContentWrapper = ({
138131
imagePositionOnDesktop,
139132
imagePositionOnMobile,
140133
padContent,
141-
padRight = false,
142134
}: Props) => {
143135
const imageDirectionDesktop = getImageDirection(imagePositionOnDesktop);
144136
const paddingSpace = padContent === 'small' ? 1 : 2;
@@ -161,7 +153,6 @@ export const ContentWrapper = ({
161153
imagePositionOnDesktop,
162154
paddingSpace,
163155
),
164-
padRight && padRightStyles,
165156
]}
166157
>
167158
{children}

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)