Skip to content

Commit 02c8266

Browse files
committed
Ensure galleries only render one secondary onward container
1 parent a20b6cb commit 02c8266

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-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')}

0 commit comments

Comments
 (0)