Skip to content

Commit 4f49bd2

Browse files
authored
Merge pull request #14349 from guardian/add-bottom-banners-for-gallery
Add sticky bottom banners for gallery layout
2 parents 2658c1b + 5f40518 commit 4f49bd2

File tree

1 file changed

+51
-17
lines changed

1 file changed

+51
-17
lines changed

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,19 @@ import { MainMediaGallery } from '../components/MainMediaGallery';
2323
import { Masthead } from '../components/Masthead/Masthead';
2424
import { Section } from '../components/Section';
2525
import { Standfirst } from '../components/Standfirst';
26+
import { StickyBottomBanner } from '../components/StickyBottomBanner.importable';
2627
import { SubMeta } from '../components/SubMeta';
2728
import { grid } from '../grid';
2829
import { type ArticleFormat, ArticleSpecial } from '../lib/articleFormat';
2930
import { canRenderAds } from '../lib/canRenderAds';
31+
import { getContributionsServiceUrl } from '../lib/contributions';
3032
import { decideMainMediaCaption } from '../lib/decide-caption';
3133
import { getAdPositions } from '../lib/getGalleryAdPositions';
3234
import type { NavType } from '../model/extract-nav';
3335
import { palette as themePalette } from '../palette';
3436
import type { Gallery } from '../types/article';
3537
import type { RenderingTarget } from '../types/renderingTarget';
36-
import { Stuck } from './lib/stickiness';
38+
import { BannerWrapper, Stuck } from './lib/stickiness';
3739

3840
interface Props {
3941
gallery: Gallery;
@@ -155,6 +157,8 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
155157

156158
const renderAds = canRenderAds(frontendData);
157159

160+
const contributionsServiceUrl = getContributionsServiceUrl(frontendData);
161+
158162
const adPositions: number[] = renderAds
159163
? getAdPositions(gallery.images)
160164
: [];
@@ -366,22 +370,52 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
366370
</Section>
367371
)}
368372
{isWeb && (
369-
<Section
370-
fullWidth={true}
371-
padSides={false}
372-
backgroundColour={sourcePalette.brand[400]}
373-
borderColour={sourcePalette.brand[600]}
374-
showSideBorders={false}
375-
element="footer"
376-
>
377-
<Footer
378-
pageFooter={frontendData.pageFooter}
379-
selectedPillar={props.NAV.selectedPillar}
380-
pillars={props.NAV.pillars}
381-
urls={frontendData.nav.readerRevenueLinks.footer}
382-
editionId={frontendData.editionId}
383-
/>
384-
</Section>
373+
<>
374+
<Section
375+
fullWidth={true}
376+
padSides={false}
377+
backgroundColour={sourcePalette.brand[400]}
378+
borderColour={sourcePalette.brand[600]}
379+
showSideBorders={false}
380+
element="footer"
381+
>
382+
<Footer
383+
pageFooter={frontendData.pageFooter}
384+
selectedPillar={props.NAV.selectedPillar}
385+
pillars={props.NAV.pillars}
386+
urls={frontendData.nav.readerRevenueLinks.footer}
387+
editionId={frontendData.editionId}
388+
/>
389+
</Section>
390+
<BannerWrapper data-print-layout="hide">
391+
<Island priority="feature" defer={{ until: 'idle' }}>
392+
<StickyBottomBanner
393+
contentType={frontendData.contentType}
394+
contributionsServiceUrl={
395+
contributionsServiceUrl
396+
}
397+
idApiUrl={frontendData.config.idApiUrl}
398+
isMinuteArticle={
399+
frontendData.pageType.isMinuteArticle
400+
}
401+
isPaidContent={
402+
frontendData.pageType.isPaidContent
403+
}
404+
isPreview={!!frontendData.config.isPreview}
405+
isSensitive={frontendData.config.isSensitive}
406+
pageId={frontendData.pageId}
407+
sectionId={frontendData.config.section}
408+
shouldHideReaderRevenue={
409+
frontendData.shouldHideReaderRevenue
410+
}
411+
remoteBannerSwitch={
412+
!!frontendData.config.switches.remoteBanner
413+
}
414+
tags={frontendData.tags}
415+
/>
416+
</Island>
417+
</BannerWrapper>
418+
</>
385419
)}
386420
{isApps && (
387421
<div

0 commit comments

Comments
 (0)