Skip to content

Commit a865f9b

Browse files
committed
add discussion to gallery
1 parent 666945d commit a865f9b

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
@@ -14,6 +14,7 @@ import { ArticleMetaApps } from '../components/ArticleMeta.apps';
1414
import { ArticleMeta } from '../components/ArticleMeta.web';
1515
import { ArticleTitle } from '../components/ArticleTitle';
1616
import { Caption } from '../components/Caption';
17+
import { DiscussionLayout } from '../components/DiscussionLayout';
1718
import { Footer } from '../components/Footer';
1819
import { DesktopAdSlot, MobileAdSlot } from '../components/GalleryAdSlots';
1920
import { GalleryImage } from '../components/GalleryImage';
@@ -163,6 +164,9 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
163164
? getAdPositions(gallery.images)
164165
: [];
165166

167+
const showComments =
168+
frontendData.isCommentable && !frontendData.config.isPaidContent;
169+
166170
return (
167171
<>
168172
{isWeb && (
@@ -328,7 +332,7 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
328332
</Fragment>
329333
);
330334
})}
331-
;
335+
332336
<SubMeta
333337
format={format}
334338
subMetaKeywordLinks={frontendData.subMetaKeywordLinks}
@@ -358,6 +362,36 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
358362
/>
359363
</Section>
360364
)}
365+
{/** More Galleries container goes here */}
366+
{showComments && (
367+
<Section
368+
fullWidth={true}
369+
sectionId="comments"
370+
element="section"
371+
backgroundColour={themePalette(
372+
'--discussion-section-background',
373+
)}
374+
borderColour={themePalette('--article-border')}
375+
fontColour={themePalette('--discussion-text')}
376+
>
377+
<DiscussionLayout
378+
discussionApiUrl={frontendData.config.discussionApiUrl}
379+
shortUrlId={frontendData.config.shortUrlId}
380+
format={format}
381+
discussionD2Uid={frontendData.config.discussionD2Uid}
382+
discussionApiClientHeader={
383+
frontendData.config.discussionApiClientHeader
384+
}
385+
enableDiscussionSwitch={
386+
!!frontendData.config.switches
387+
.enableDiscussionSwitch
388+
}
389+
isAdFreeUser={frontendData.isAdFreeUser}
390+
shouldHideAds={frontendData.shouldHideAds}
391+
idApiUrl={frontendData.config.idApiUrl}
392+
/>
393+
</Section>
394+
)}
361395
{/** Most Popular container goes here */}
362396
{isWeb && renderAds && !isLabs && (
363397
<Section

0 commit comments

Comments
 (0)