Skip to content

Commit b413b92

Browse files
authored
Merge pull request #14395 from guardian/add-discussion-to-gallery
Add discussion to gallery
2 parents f1fb96c + 7ee78d4 commit b413b92

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ArticleMetaApps } from '../components/ArticleMeta.apps';
1616
import { ArticleMeta } from '../components/ArticleMeta.web';
1717
import { ArticleTitle } from '../components/ArticleTitle';
1818
import { Caption } from '../components/Caption';
19+
import { DiscussionLayout } from '../components/DiscussionLayout';
1920
import { Footer } from '../components/Footer';
2021
import { DesktopAdSlot, MobileAdSlot } from '../components/GalleryAdSlots';
2122
import { GalleryImage } from '../components/GalleryImage';
@@ -172,6 +173,9 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
172173

173174
const contributionsServiceUrl = getContributionsServiceUrl(frontendData);
174175

176+
const showComments =
177+
frontendData.isCommentable && !frontendData.config.isPaidContent;
178+
175179
return (
176180
<>
177181
{isWeb && (
@@ -361,7 +365,7 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
361365
</Fragment>
362366
);
363367
})}
364-
;
368+
365369
<SubMeta
366370
format={format}
367371
subMetaKeywordLinks={frontendData.subMetaKeywordLinks}
@@ -391,6 +395,36 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
391395
/>
392396
</Section>
393397
)}
398+
{/** More Galleries container goes here */}
399+
{showComments && (
400+
<Section
401+
fullWidth={true}
402+
sectionId="comments"
403+
element="section"
404+
backgroundColour={themePalette(
405+
'--discussion-section-background',
406+
)}
407+
borderColour={themePalette('--article-border')}
408+
fontColour={themePalette('--discussion-text')}
409+
>
410+
<DiscussionLayout
411+
discussionApiUrl={frontendData.config.discussionApiUrl}
412+
shortUrlId={frontendData.config.shortUrlId}
413+
format={format}
414+
discussionD2Uid={frontendData.config.discussionD2Uid}
415+
discussionApiClientHeader={
416+
frontendData.config.discussionApiClientHeader
417+
}
418+
enableDiscussionSwitch={
419+
!!frontendData.config.switches
420+
.enableDiscussionSwitch
421+
}
422+
isAdFreeUser={frontendData.isAdFreeUser}
423+
shouldHideAds={frontendData.shouldHideAds}
424+
idApiUrl={frontendData.config.idApiUrl}
425+
/>
426+
</Section>
427+
)}
394428
{/** Most Popular container goes here */}
395429
{isWeb && renderAds && !isLabs && (
396430
<Section

0 commit comments

Comments
 (0)