Skip to content
This repository was archived by the owner on Sep 1, 2021. It is now read-only.

Commit 8f207eb

Browse files
authored
Merge pull request #1199 from guardian/LIVE-1834-showcase-comment
LIVE-1834: move design.comment above display.showcase
2 parents 402d094 + 4e6cb6d commit 8f207eb

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

src/components/editions/header/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ const renderArticleHeader = (item: Item): ReactElement<HeaderProps> => {
247247
return <ImmersiveHeader item={item} />;
248248
} else if (item.design === Design.Interview) {
249249
return <InterviewHeader item={item} />;
250+
} else if (item.design === Design.Comment) {
251+
return <CommentHeader item={item} />;
250252
} else if (item.display === Display.Showcase) {
251253
return <ShowcaseHeader item={item} />;
252254
} else if (item.design === Design.Analysis) {
253255
return <AnalysisHeader item={item} />;
254-
} else if (item.design === Design.Comment) {
255-
return <CommentHeader item={item} />;
256256
} else if (item.design === Design.Media) {
257257
return isPicture(item.tags) ? (
258258
<PictureHeader item={item} />

src/components/editions/headline/index.tsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,25 @@ const getHeadlineStyles = (
171171
): SerializedStyles => {
172172
const sharedStyles = getSharedStyles(format);
173173

174-
// Display.Immersive needs to come before Design.Interview
175-
switch (format.display) {
176-
case Display.Immersive:
177-
return css(
178-
sharedStyles,
179-
getFontStyles('tight', 'bold'),
180-
immersiveStyles,
181-
);
182-
case Display.Showcase:
183-
return css(sharedStyles, getFontStyles('tight', 'bold'));
174+
if (format.display === Display.Immersive) {
175+
return css(
176+
sharedStyles,
177+
getFontStyles('tight', 'bold'),
178+
immersiveStyles,
179+
);
180+
}
181+
182+
// this needs to come before Display.Showcase
183+
if (format.design === Design.Comment) {
184+
return css(
185+
sharedStyles,
186+
getFontStyles('regular', 'light'),
187+
commentStyles,
188+
);
189+
}
190+
191+
if (format.display === Display.Showcase) {
192+
return css(sharedStyles, getFontStyles('tight', 'bold'));
184193
}
185194

186195
switch (format.design) {
@@ -198,12 +207,6 @@ const getHeadlineStyles = (
198207
getFontStyles('regular', 'light'),
199208
analysisStyles(kickerColor),
200209
);
201-
case Design.Comment:
202-
return css(
203-
sharedStyles,
204-
getFontStyles('regular', 'light'),
205-
commentStyles,
206-
);
207210
case Design.Media:
208211
return css(sharedStyles, galleryStyles);
209212
}

0 commit comments

Comments
 (0)