@@ -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,25 +196,54 @@ 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' ;
206
+ const isApps = renderingTarget === 'Apps' ;
188
207
189
208
return (
190
209
< >
191
210
{ article . isLegacyInteractive && (
192
211
< Global styles = { interactiveGlobalStyles } />
193
212
) }
194
- < header
195
- css = { css `
196
- background-color : ${ themePalette ( '--article-background' ) } ;
197
- ` }
198
- >
199
- < NavHeader article = { article } NAV = { NAV } format = { format } />
213
+ { isWeb && (
214
+ < >
215
+ < header
216
+ css = { css `
217
+ background-color : ${ themePalette (
218
+ '--article-background' ,
219
+ ) } ;
220
+ ` }
221
+ >
222
+ < NavHeader
223
+ article = { article }
224
+ NAV = { props . NAV }
225
+ format = { format }
226
+ />
200
227
201
- { format . theme === ArticleSpecial . Labs && (
228
+ { format . theme === ArticleSpecial . Labs && (
229
+ < Stuck >
230
+ < Section
231
+ fullWidth = { true }
232
+ showTopBorder = { false }
233
+ padSides = { true }
234
+ backgroundColour = { sourcePalette . labs [ 400 ] }
235
+ borderColour = { sourcePalette . neutral [ 60 ] }
236
+ sectionId = "labs-header"
237
+ >
238
+ < LabsHeader editionId = { editionId } />
239
+ </ Section >
240
+ </ Stuck >
241
+ ) }
242
+ </ header >
243
+ </ >
244
+ ) }
245
+ { isApps && format . theme === ArticleSpecial . Labs && (
246
+ < header >
202
247
< Stuck >
203
248
< Section
204
249
fullWidth = { true }
@@ -211,8 +256,8 @@ export const FullPageInteractiveLayout = ({ article, NAV, format }: Props) => {
211
256
< LabsHeader editionId = { editionId } />
212
257
</ Section >
213
258
</ Stuck >
214
- ) }
215
- </ header >
259
+ </ header >
260
+ ) }
216
261
217
262
< Section
218
263
fullWidth = { true }
@@ -246,7 +291,7 @@ export const FullPageInteractiveLayout = ({ article, NAV, format }: Props) => {
246
291
</ article >
247
292
</ Section >
248
293
249
- { NAV . subNavSections && (
294
+ { isWeb && props . NAV . subNavSections && (
250
295
< Section
251
296
fullWidth = { true }
252
297
padSides = { false }
@@ -255,60 +300,66 @@ export const FullPageInteractiveLayout = ({ article, NAV, format }: Props) => {
255
300
>
256
301
< Island priority = "enhancement" defer = { { until : 'visible' } } >
257
302
< SubNav
258
- subNavSections = { NAV . subNavSections }
259
- currentNavLink = { NAV . currentNavLink }
303
+ subNavSections = { props . NAV . subNavSections }
304
+ currentNavLink = { props . NAV . currentNavLink }
260
305
position = "footer"
261
306
isInteractive = { true }
262
307
/>
263
308
</ Island >
264
309
</ Section >
265
310
) }
266
311
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 >
312
+ { isWeb && (
313
+ < >
314
+ < Section
315
+ fullWidth = { true }
316
+ padSides = { false }
317
+ backgroundColour = { sourcePalette . brand [ 400 ] }
318
+ borderColour = { sourcePalette . brand [ 600 ] }
319
+ showSideBorders = { false }
320
+ element = "footer"
321
+ >
322
+ < Footer
323
+ pageFooter = { article . pageFooter }
324
+ selectedPillar = { props . NAV . selectedPillar }
325
+ pillars = { props . NAV . pillars }
326
+ urls = { article . nav . readerRevenueLinks . header }
327
+ editionId = { article . editionId }
328
+ />
329
+ </ Section >
283
330
284
- < BannerWrapper >
285
- < Island priority = "feature" defer = { { until : 'idle' } } >
286
- < StickyBottomBanner
331
+ < BannerWrapper >
332
+ < Island priority = "feature" defer = { { until : 'idle' } } >
333
+ < StickyBottomBanner
334
+ contentType = { article . contentType }
335
+ contributionsServiceUrl = {
336
+ article . contributionsServiceUrl
337
+ }
338
+ idApiUrl = { article . config . idApiUrl }
339
+ isMinuteArticle = {
340
+ article . pageType . isMinuteArticle
341
+ }
342
+ isPaidContent = { article . pageType . isPaidContent }
343
+ isPreview = { ! ! article . config . isPreview }
344
+ isSensitive = { article . config . isSensitive }
345
+ pageId = { article . pageId }
346
+ sectionId = { article . config . section }
347
+ shouldHideReaderRevenue = {
348
+ article . shouldHideReaderRevenue
349
+ }
350
+ remoteBannerSwitch = {
351
+ ! ! article . config . switches . remoteBanner
352
+ }
353
+ tags = { article . tags }
354
+ />
355
+ </ Island >
356
+ </ BannerWrapper >
357
+ < MobileStickyContainer
287
358
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
359
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
360
/>
306
- </ Island >
307
- </ BannerWrapper >
308
- < MobileStickyContainer
309
- contentType = { article . contentType }
310
- pageId = { article . pageId }
311
- />
361
+ </ >
362
+ ) }
312
363
</ >
313
364
) ;
314
365
} ;
0 commit comments