Skip to content

Commit c9004b1

Browse files
committed
add footer to gallery articles
1 parent 47ca401 commit c9004b1

File tree

1 file changed

+46
-7
lines changed

1 file changed

+46
-7
lines changed

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
import { css } from '@emotion/react';
2-
import { from } from '@guardian/source/foundations';
2+
import { from, palette as sourcePalette } from '@guardian/source/foundations';
3+
import { AppsFooter } from '../components/AppsFooter.importable';
34
import { ArticleHeadline } from '../components/ArticleHeadline';
45
import { ArticleMetaApps } from '../components/ArticleMeta.apps';
56
import { ArticleMeta } from '../components/ArticleMeta.web';
67
import { ArticleTitle } from '../components/ArticleTitle';
8+
import { Footer } from '../components/Footer';
79
import { GalleryImage } from '../components/GalleryImage';
10+
import { Island } from '../components/Island';
811
import { MainMediaGallery } from '../components/MainMediaGallery';
912
import { Masthead } from '../components/Masthead/Masthead';
13+
import { Section } from '../components/Section';
1014
import { Standfirst } from '../components/Standfirst';
1115
import { SubMeta } from '../components/SubMeta';
1216
import { grid } from '../grid';
1317
import type { ArticleFormat } from '../lib/articleFormat';
1418
import type { NavType } from '../model/extract-nav';
15-
import { palette } from '../palette';
19+
import { palette, palette as themePalette } from '../palette';
1620
import type { Gallery } from '../types/article';
1721
import type { RenderingTarget } from '../types/renderingTarget';
1822

@@ -45,6 +49,9 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
4549
const gallery = props.gallery;
4650
const frontendData = gallery.frontendData;
4751

52+
const isWeb = props.renderingTarget === 'Web';
53+
const isApps = props.renderingTarget === 'Apps';
54+
4855
const format: ArticleFormat = {
4956
design: gallery.design,
5057
display: gallery.display,
@@ -53,7 +60,7 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
5360

5461
return (
5562
<>
56-
{props.renderingTarget === 'Web' && (
63+
{isWeb && (
5764
<Masthead
5865
nav={props.NAV}
5966
editionId={frontendData.editionId}
@@ -102,7 +109,7 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
102109
format={format}
103110
standfirst={frontendData.standfirst}
104111
/>
105-
{props.renderingTarget === 'Web' ? (
112+
{isWeb ? (
106113
<ArticleMeta
107114
branding={
108115
frontendData.commercialProperties[
@@ -127,7 +134,7 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
127134
shortUrlId={frontendData.config.shortUrlId}
128135
/>
129136
) : null}
130-
{props.renderingTarget === 'Apps' ? (
137+
{isApps ? (
131138
<ArticleMetaApps
132139
branding={
133140
frontendData.commercialProperties[
@@ -186,11 +193,43 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
186193
webUrl={frontendData.webURL}
187194
webTitle={frontendData.webTitle}
188195
showBottomSocialButtons={
189-
frontendData.showBottomSocialButtons &&
190-
props.renderingTarget === 'Web'
196+
frontendData.showBottomSocialButtons && isWeb
191197
}
192198
/>
193199
</main>
200+
{isWeb && (
201+
<Section
202+
fullWidth={true}
203+
padSides={false}
204+
backgroundColour={sourcePalette.brand[400]}
205+
borderColour={sourcePalette.brand[600]}
206+
showSideBorders={false}
207+
element="footer"
208+
>
209+
<Footer
210+
pageFooter={frontendData.pageFooter}
211+
selectedPillar={props.NAV.selectedPillar}
212+
pillars={props.NAV.pillars}
213+
urls={frontendData.nav.readerRevenueLinks.footer}
214+
editionId={frontendData.editionId}
215+
/>
216+
</Section>
217+
)}
218+
{isApps && (
219+
<Section
220+
fullWidth={true}
221+
data-print-layout="hide"
222+
backgroundColour={'red'}
223+
borderColour={themePalette('--article-border')}
224+
padSides={false}
225+
showSideBorders={false}
226+
element="footer"
227+
>
228+
<Island priority="critical">
229+
<AppsFooter />
230+
</Island>
231+
</Section>
232+
)}
194233
</>
195234
);
196235
};

0 commit comments

Comments
 (0)