Skip to content

Commit b2c00c1

Browse files
authored
Merge pull request #14103 from guardian/add-age-warning-for-gallery
Add gallery design for age warning
2 parents e1ed370 + 1477296 commit b2c00c1

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

dotcom-rendering/src/components/ArticleHeadline.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,11 @@ const zIndex = css`
247247
z-index: 1;
248248
`;
249249

250-
const ageWarningMargins = (format: ArticleFormat) =>
251-
format.display === ArticleDisplay.Immersive
250+
const ageWarningMargins = (format: ArticleFormat) => {
251+
if (format.design === ArticleDesign.Gallery) {
252+
return '';
253+
}
254+
return format.display === ArticleDisplay.Immersive
252255
? css`
253256
margin-left: 0px;
254257
margin-bottom: 0px;
@@ -275,6 +278,7 @@ const ageWarningMargins = (format: ArticleFormat) =>
275278
margin-top: 0;
276279
}
277280
`;
281+
};
278282

279283
const backgroundStyles = css`
280284
background-color: ${themePalette('--age-warning-wrapper-background')};

dotcom-rendering/src/layouts/GalleryLayout.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const addBranding = (gallery: Gallery): Gallery => ({
2020
...gallery,
2121
frontendData: {
2222
...gallery.frontendData,
23+
webPublicationDateDeprecated: '2020-03-28T07:27:19.000Z',
2324
commercialProperties: {
2425
...gallery.frontendData.commercialProperties,
2526
UK: {

dotcom-rendering/src/paletteDeclarations.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,6 +3002,8 @@ const articleBackgroundDark: PaletteFunction = ({ design, theme }) => {
30023002
return sourcePalette.neutral[7];
30033003
case ArticleDesign.LiveBlog:
30043004
return sourcePalette.neutral[0];
3005+
case ArticleDesign.Gallery:
3006+
return sourcePalette.neutral[10];
30053007
case ArticleDesign.Standard:
30063008
case ArticleDesign.Review:
30073009
case ArticleDesign.Explainer:
@@ -4266,6 +4268,7 @@ const linkKickerTextDark: PaletteFunction = ({ theme }) => {
42664268
const ageWarningWrapperBackground: PaletteFunction = (format) => {
42674269
switch (format.design) {
42684270
case ArticleDesign.Interview:
4271+
case ArticleDesign.Gallery:
42694272
return 'transparent';
42704273
default:
42714274
return headlineBackgroundLight(format);

0 commit comments

Comments
 (0)