Skip to content

Commit 8868391

Browse files
authored
Flexible special design tweaks (#14128)
* do not boost the headline when the live links are added * image size should always be jumbo on flex special splash * Remove unused type * Correct the story name
1 parent 0d76494 commit 8868391

File tree

2 files changed

+6
-26
lines changed

2 files changed

+6
-26
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const meta = {
101101
absoluteServerTimes: true,
102102
imageLoading: 'eager',
103103
aspectRatio: '5:4',
104-
frontSectionTitle: 'Flexible general',
104+
frontSectionTitle: 'Flexible special',
105105
},
106106
render: ({ frontSectionTitle, ...args }) => (
107107
<FrontSection

dotcom-rendering/src/components/FlexibleSpecial.tsx

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import type {
99
DCRFrontCard,
1010
DCRGroupedTrails,
1111
} from '../types/front';
12-
import type {
13-
ImagePositionType,
14-
ImageSizeType,
15-
} from './Card/components/ImageWrapper';
12+
import type { ImagePositionType } from './Card/components/ImageWrapper';
1613
import { LI } from './Card/components/LI';
1714
import type { TrailTextSize } from './Card/components/TrailText';
1815
import { UL } from './Card/components/UL';
@@ -36,7 +33,6 @@ type BoostProperties = {
3633
headlineSizes: ResponsiveFontSize;
3734
imagePositionOnDesktop: ImagePositionType;
3835
imagePositionOnMobile: ImagePositionType;
39-
imageSize: ImageSizeType;
4036
supportingContentAlignment: Alignment;
4137
liveUpdatesAlignment: Alignment;
4238
trailTextSize: TrailTextSize;
@@ -51,23 +47,18 @@ const determineCardProperties = (
5147
supportingContentLength: number,
5248
mediaCard: boolean,
5349
imageSuppressed: boolean,
54-
hasLivePlayable: boolean,
5550
): BoostProperties => {
5651
switch (boostLevel) {
5752
// The default boost level is equal to no boost. It is the same as the default card layout.
5853
case 'default':
5954
return {
6055
headlineSizes: {
61-
desktop:
62-
imageSuppressed || hasLivePlayable
63-
? 'xxlarge'
64-
: 'xlarge',
56+
desktop: imageSuppressed ? 'xxlarge' : 'xlarge',
6557
tablet: 'large',
6658
mobile: 'medium',
6759
},
6860
imagePositionOnDesktop: 'right',
6961
imagePositionOnMobile: mediaCard ? 'top' : 'bottom',
70-
imageSize: 'large',
7162
supportingContentAlignment:
7263
supportingContentLength >= 3 ? 'horizontal' : 'vertical',
7364
liveUpdatesAlignment: 'vertical',
@@ -76,16 +67,12 @@ const determineCardProperties = (
7667
case 'boost':
7768
return {
7869
headlineSizes: {
79-
desktop:
80-
imageSuppressed || hasLivePlayable
81-
? 'xxxlarge'
82-
: 'xxlarge',
70+
desktop: imageSuppressed ? 'xxxlarge' : 'xxlarge',
8371
tablet: 'xlarge',
8472
mobile: 'large',
8573
},
8674
imagePositionOnDesktop: 'right',
8775
imagePositionOnMobile: mediaCard ? 'top' : 'bottom',
88-
imageSize: 'jumbo',
8976
supportingContentAlignment:
9077
supportingContentLength >= 3 ? 'horizontal' : 'vertical',
9178
liveUpdatesAlignment: 'vertical',
@@ -94,16 +81,12 @@ const determineCardProperties = (
9481
case 'megaboost':
9582
return {
9683
headlineSizes: {
97-
desktop:
98-
imageSuppressed || hasLivePlayable
99-
? 'xxxlarge'
100-
: 'xxlarge',
84+
desktop: imageSuppressed ? 'xxxlarge' : 'xxlarge',
10185
tablet: 'xlarge',
10286
mobile: 'xlarge',
10387
},
10488
imagePositionOnDesktop: mediaCard ? 'top' : 'bottom',
10589
imagePositionOnMobile: mediaCard ? 'top' : 'bottom',
106-
imageSize: 'jumbo',
10790
supportingContentAlignment: 'horizontal',
10891
liveUpdatesAlignment: 'horizontal',
10992
trailTextSize: 'large',
@@ -117,7 +100,6 @@ const determineCardProperties = (
117100
},
118101
imagePositionOnDesktop: mediaCard ? 'top' : 'bottom',
119102
imagePositionOnMobile: mediaCard ? 'top' : 'bottom',
120-
imageSize: 'jumbo',
121103
supportingContentAlignment: 'horizontal',
122104
liveUpdatesAlignment: 'horizontal',
123105
trailTextSize: 'large',
@@ -155,7 +137,6 @@ export const OneCardLayout = ({
155137
headlineSizes,
156138
imagePositionOnDesktop,
157139
imagePositionOnMobile,
158-
imageSize,
159140
supportingContentAlignment,
160141
liveUpdatesAlignment,
161142
trailTextSize,
@@ -164,7 +145,6 @@ export const OneCardLayout = ({
164145
card.supportingContent?.length ?? 0,
165146
isMediaCard(card.format),
166147
!card.image,
167-
card.showLivePlayable,
168148
);
169149

170150
return (
@@ -179,7 +159,7 @@ export const OneCardLayout = ({
179159
headlineSizes={headlineSizes}
180160
imagePositionOnDesktop={imagePositionOnDesktop}
181161
imagePositionOnMobile={imagePositionOnMobile}
182-
imageSize={imageSize}
162+
imageSize={'jumbo'}
183163
trailText={card.trailText}
184164
supportingContent={card.supportingContent}
185165
supportingContentAlignment={supportingContentAlignment}

0 commit comments

Comments
 (0)