@@ -24,15 +24,31 @@ import { palette as themePalette } from '../palette';
24
24
import type { ArticleDeprecated } from '../types/article' ;
25
25
import type { ServerSideTests , Switches } from '../types/config' ;
26
26
import type { FEElement } from '../types/content' ;
27
+ import type { RenderingTarget } from '../types/renderingTarget' ;
27
28
import { interactiveGlobalStyles } from './lib/interactiveLegacyStyling' ;
28
29
import { BannerWrapper , Stuck } from './lib/stickiness' ;
29
30
30
- interface Props {
31
+ interface CommonProps {
31
32
article : ArticleDeprecated ;
32
- NAV : NavType ;
33
33
format : ArticleFormat ;
34
+ renderingTarget : RenderingTarget ;
35
+ }
36
+
37
+ interface WebProps extends CommonProps {
38
+ NAV : NavType ;
39
+ renderingTarget : 'Web' ;
40
+ }
41
+
42
+ interface AppsProps extends CommonProps {
43
+ renderingTarget : 'Apps' ;
34
44
}
35
45
46
+ type HeaderProps = {
47
+ article : ArticleDeprecated ;
48
+ NAV : NavType ;
49
+ format : ArticleFormat ;
50
+ } ;
51
+
36
52
type RendererProps = {
37
53
format : ArticleFormat ;
38
54
elements : FEElement [ ] ;
@@ -120,7 +136,7 @@ const Renderer = ({
120
136
return < div css = { adStyles } > { output } </ div > ;
121
137
} ;
122
138
123
- const NavHeader = ( { article, NAV , format } : Props ) => {
139
+ const NavHeader = ( { article, NAV , format } : HeaderProps ) => {
124
140
// Typically immersives use the slim nav, but this switch is used to force
125
141
// the full nav - typically during special events such as Project 200, or
126
142
// the Euros. The motivation is to better onboard new visitors; interactives
@@ -180,39 +196,51 @@ const NavHeader = ({ article, NAV, format }: Props) => {
180
196
) ;
181
197
} ;
182
198
183
- export const FullPageInteractiveLayout = ( { article, NAV , format } : Props ) => {
199
+ export const FullPageInteractiveLayout = ( props : WebProps | AppsProps ) => {
200
+ const { article, format, renderingTarget } = props ;
184
201
const {
185
202
config : { host } ,
186
203
editionId,
187
204
} = article ;
205
+ const isWeb = renderingTarget === 'Web' ;
188
206
189
207
return (
190
208
< >
191
- { article . isLegacyInteractive && (
192
- < Global styles = { interactiveGlobalStyles } />
193
- ) }
194
- < header
195
- css = { css `
196
- background-color : ${ themePalette ( '--article-background' ) } ;
197
- ` }
198
- >
199
- < NavHeader article = { article } NAV = { NAV } format = { format } />
209
+ { isWeb && (
210
+ < >
211
+ { article . isLegacyInteractive && (
212
+ < Global styles = { interactiveGlobalStyles } />
213
+ ) }
214
+ < header
215
+ css = { css `
216
+ background-color : ${ themePalette (
217
+ '--article-background' ,
218
+ ) } ;
219
+ ` }
220
+ >
221
+ < NavHeader
222
+ article = { article }
223
+ NAV = { props . NAV }
224
+ format = { format }
225
+ />
200
226
201
- { format . theme === ArticleSpecial . Labs && (
202
- < Stuck >
203
- < Section
204
- fullWidth = { true }
205
- showTopBorder = { false }
206
- padSides = { true }
207
- backgroundColour = { sourcePalette . labs [ 400 ] }
208
- borderColour = { sourcePalette . neutral [ 60 ] }
209
- sectionId = "labs-header"
210
- >
211
- < LabsHeader editionId = { editionId } />
212
- </ Section >
213
- </ Stuck >
214
- ) }
215
- </ header >
227
+ { format . theme === ArticleSpecial . Labs && (
228
+ < Stuck >
229
+ < Section
230
+ fullWidth = { true }
231
+ showTopBorder = { false }
232
+ padSides = { true }
233
+ backgroundColour = { sourcePalette . labs [ 400 ] }
234
+ borderColour = { sourcePalette . neutral [ 60 ] }
235
+ sectionId = "labs-header"
236
+ >
237
+ < LabsHeader editionId = { editionId } />
238
+ </ Section >
239
+ </ Stuck >
240
+ ) }
241
+ </ header >
242
+ </ >
243
+ ) }
216
244
217
245
< Section
218
246
fullWidth = { true }
@@ -246,7 +274,7 @@ export const FullPageInteractiveLayout = ({ article, NAV, format }: Props) => {
246
274
</ article >
247
275
</ Section >
248
276
249
- { NAV . subNavSections && (
277
+ { isWeb && props . NAV . subNavSections && (
250
278
< Section
251
279
fullWidth = { true }
252
280
padSides = { false }
@@ -255,60 +283,66 @@ export const FullPageInteractiveLayout = ({ article, NAV, format }: Props) => {
255
283
>
256
284
< Island priority = "enhancement" defer = { { until : 'visible' } } >
257
285
< SubNav
258
- subNavSections = { NAV . subNavSections }
259
- currentNavLink = { NAV . currentNavLink }
286
+ subNavSections = { props . NAV . subNavSections }
287
+ currentNavLink = { props . NAV . currentNavLink }
260
288
position = "footer"
261
289
isInteractive = { true }
262
290
/>
263
291
</ Island >
264
292
</ Section >
265
293
) }
266
294
267
- < Section
268
- fullWidth = { true }
269
- padSides = { false }
270
- backgroundColour = { sourcePalette . brand [ 400 ] }
271
- borderColour = { sourcePalette . brand [ 600 ] }
272
- showSideBorders = { false }
273
- element = "footer"
274
- >
275
- < Footer
276
- pageFooter = { article . pageFooter }
277
- selectedPillar = { NAV . selectedPillar }
278
- pillars = { NAV . pillars }
279
- urls = { article . nav . readerRevenueLinks . footer }
280
- editionId = { article . editionId }
281
- />
282
- </ Section >
295
+ { isWeb && (
296
+ < >
297
+ < Section
298
+ fullWidth = { true }
299
+ padSides = { false }
300
+ backgroundColour = { sourcePalette . brand [ 400 ] }
301
+ borderColour = { sourcePalette . brand [ 600 ] }
302
+ showSideBorders = { false }
303
+ element = "footer"
304
+ >
305
+ < Footer
306
+ pageFooter = { article . pageFooter }
307
+ selectedPillar = { props . NAV . selectedPillar }
308
+ pillars = { props . NAV . pillars }
309
+ urls = { article . nav . readerRevenueLinks . header }
310
+ editionId = { article . editionId }
311
+ />
312
+ </ Section >
283
313
284
- < BannerWrapper >
285
- < Island priority = "feature" defer = { { until : 'idle' } } >
286
- < StickyBottomBanner
314
+ < BannerWrapper >
315
+ < Island priority = "feature" defer = { { until : 'idle' } } >
316
+ < StickyBottomBanner
317
+ contentType = { article . contentType }
318
+ contributionsServiceUrl = {
319
+ article . contributionsServiceUrl
320
+ }
321
+ idApiUrl = { article . config . idApiUrl }
322
+ isMinuteArticle = {
323
+ article . pageType . isMinuteArticle
324
+ }
325
+ isPaidContent = { article . pageType . isPaidContent }
326
+ isPreview = { ! ! article . config . isPreview }
327
+ isSensitive = { article . config . isSensitive }
328
+ pageId = { article . pageId }
329
+ sectionId = { article . config . section }
330
+ shouldHideReaderRevenue = {
331
+ article . shouldHideReaderRevenue
332
+ }
333
+ remoteBannerSwitch = {
334
+ ! ! article . config . switches . remoteBanner
335
+ }
336
+ tags = { article . tags }
337
+ />
338
+ </ Island >
339
+ </ BannerWrapper >
340
+ < MobileStickyContainer
287
341
contentType = { article . contentType }
288
- contributionsServiceUrl = {
289
- article . contributionsServiceUrl
290
- }
291
- idApiUrl = { article . config . idApiUrl }
292
- isMinuteArticle = { article . pageType . isMinuteArticle }
293
- isPaidContent = { article . pageType . isPaidContent }
294
- isPreview = { ! ! article . config . isPreview }
295
- isSensitive = { article . config . isSensitive }
296
342
pageId = { article . pageId }
297
- sectionId = { article . config . section }
298
- shouldHideReaderRevenue = {
299
- article . shouldHideReaderRevenue
300
- }
301
- remoteBannerSwitch = {
302
- ! ! article . config . switches . remoteBanner
303
- }
304
- tags = { article . tags }
305
343
/>
306
- </ Island >
307
- </ BannerWrapper >
308
- < MobileStickyContainer
309
- contentType = { article . contentType }
310
- pageId = { article . pageId }
311
- />
344
+ </ >
345
+ ) }
312
346
</ >
313
347
) ;
314
348
} ;
0 commit comments