Skip to content

Commit 8bd2097

Browse files
authored
Merge pull request #14589 from guardian/limit-secondary-onwards-containers-for-gallery
Ensure galleries only render one secondary onward container
2 parents bbccdcb + ad2d591 commit 8bd2097

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

dotcom-rendering/src/components/OnwardsUpper.importable.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { css } from '@emotion/react';
2-
import { joinUrl } from '@guardian/libs';
2+
import { isUndefined, joinUrl } from '@guardian/libs';
33
import {
4+
ArticleDesign,
45
type ArticleFormat,
56
type ArticleTheme,
67
Pillar,
@@ -303,6 +304,11 @@ export const OnwardsUpper = ({
303304
? getContainerDataUrl(pillar, editionId, ajaxUrl)
304305
: undefined;
305306

307+
// For galleries: they already have a "more galleries" container,
308+
// so we can only allow one more onwards container
309+
const canHaveCuratedContent =
310+
format.design === ArticleDesign.Gallery ? isUndefined(url) : true;
311+
306312
return (
307313
<div css={onwardsWrapper}>
308314
{!!url && (
@@ -322,7 +328,7 @@ export const OnwardsUpper = ({
322328
/>
323329
</Section>
324330
)}
325-
{!!curatedDataUrl && !isPaidContent && (
331+
{!!curatedDataUrl && !isPaidContent && canHaveCuratedContent && (
326332
<Section
327333
fullWidth={true}
328334
borderColour={palette('--article-section-border')}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const addBrandingAndAffiliateDisclaimer = (gallery: Gallery): Gallery => ({
4444
const appsArticle = enhanceArticleType(
4545
{
4646
...GalleryFixture,
47+
hasStoryPackage: true,
4748
storyPackage,
4849
},
4950
'Apps',
@@ -75,6 +76,7 @@ export const Apps = {
7576
const webArticle = enhanceArticleType(
7677
{
7778
...GalleryFixture,
79+
hasStoryPackage: true,
7880
storyPackage,
7981
},
8082
'Web',

0 commit comments

Comments
 (0)