4
4
brandBorder ,
5
5
palette as sourcePalette ,
6
6
} from '@guardian/source/foundations' ;
7
+ import { Fragment } from 'react' ;
7
8
import { AdSlot } from '../components/AdSlot.web' ;
8
9
import { BETA_CONTAINERS } from '../components/Card/Card' ;
9
10
import { Carousel } from '../components/Carousel.importable' ;
@@ -194,65 +195,64 @@ export const FrontLayout = ({ front, NAV }: Props) => {
194
195
return (
195
196
< >
196
197
< div data-print-layout = "hide" id = "bannerandheader" >
197
- < >
198
- { renderAds && (
199
- < Stuck >
200
- < Section
201
- fullWidth = { true }
202
- showTopBorder = { false }
203
- showSideBorders = { false }
204
- padSides = { false }
205
- shouldCenter = { false }
206
- backgroundColour = { schemePalette (
207
- '--article-section-background' ,
208
- ) }
209
- >
210
- < HeaderAdSlot
211
- isPaidContent = { ! ! front . config . isPaidContent }
212
- shouldHideReaderRevenue = { false }
213
- />
214
- </ Section >
215
- </ Stuck >
216
- ) }
217
-
218
- { hasPageSkin && (
219
- < AdSlot
220
- data-print-layout = "hide"
221
- position = "pageskin"
222
- display = { ArticleDisplay . Standard }
223
- hasPageskin = { hasPageSkin }
224
- />
225
- ) }
226
-
227
- < Masthead
228
- nav = { NAV }
229
- highlights = { < Highlights /> }
230
- editionId = { front . editionId }
231
- idUrl = { front . config . idUrl }
232
- mmaUrl = { front . config . mmaUrl }
233
- discussionApiUrl = { front . config . discussionApiUrl }
234
- contributionsServiceUrl = { contributionsServiceUrl }
235
- idApiUrl = { front . config . idApiUrl }
236
- showSubNav = { ! isPaidContent }
237
- showSlimNav = { false }
238
- hasPageSkin = { hasPageSkin }
239
- hasPageSkinContentSelfConstrain = { true }
240
- pageId = { pageId }
241
- />
242
-
243
- { isPaidContent && (
198
+ { renderAds && (
199
+ < Stuck >
244
200
< Section
245
201
fullWidth = { true }
246
202
showTopBorder = { false }
247
- backgroundColour = { sourcePalette . labs [ 400 ] }
248
- borderColour = { sourcePalette . neutral [ 60 ] }
249
- sectionId = "labs-header"
203
+ showSideBorders = { false }
204
+ padSides = { false }
205
+ shouldCenter = { false }
206
+ backgroundColour = { schemePalette (
207
+ '--article-section-background' ,
208
+ ) }
250
209
>
251
- < LabsHeader editionId = { editionId } />
210
+ < HeaderAdSlot
211
+ isPaidContent = { ! ! front . config . isPaidContent }
212
+ shouldHideReaderRevenue = { false }
213
+ />
252
214
</ Section >
253
- ) }
254
- </ >
215
+ </ Stuck >
216
+ ) }
217
+
218
+ { hasPageSkin && (
219
+ < AdSlot
220
+ data-print-layout = "hide"
221
+ position = "pageskin"
222
+ display = { ArticleDisplay . Standard }
223
+ hasPageskin = { hasPageSkin }
224
+ />
225
+ ) }
226
+
227
+ < Masthead
228
+ nav = { NAV }
229
+ highlights = { < Highlights /> }
230
+ editionId = { front . editionId }
231
+ idUrl = { front . config . idUrl }
232
+ mmaUrl = { front . config . mmaUrl }
233
+ discussionApiUrl = { front . config . discussionApiUrl }
234
+ contributionsServiceUrl = { contributionsServiceUrl }
235
+ idApiUrl = { front . config . idApiUrl }
236
+ showSubNav = { ! isPaidContent }
237
+ showSlimNav = { false }
238
+ hasPageSkin = { hasPageSkin }
239
+ hasPageSkinContentSelfConstrain = { true }
240
+ pageId = { pageId }
241
+ />
242
+
243
+ { isPaidContent && (
244
+ < Section
245
+ fullWidth = { true }
246
+ showTopBorder = { false }
247
+ backgroundColour = { sourcePalette . labs [ 400 ] }
248
+ borderColour = { sourcePalette . neutral [ 60 ] }
249
+ sectionId = "labs-header"
250
+ >
251
+ < LabsHeader editionId = { editionId } />
252
+ </ Section >
253
+ ) }
255
254
</ div >
255
+
256
256
< main
257
257
data-layout = "FrontLayout"
258
258
data-link-name = { `Front | /${ front . pressedPage . id } ` }
@@ -267,6 +267,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
267
267
/>
268
268
</ Island >
269
269
) }
270
+
270
271
{ filteredCollections . map ( ( collection , index ) => {
271
272
// Backfills should be added to the end of any curated content
272
273
const trails = collection . curated . concat (
@@ -334,7 +335,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
334
335
335
336
if ( collection . collectionType === 'fixed/thrasher' ) {
336
337
return (
337
- < div key = { ophanName } >
338
+ < Fragment key = { ophanName } >
338
339
{ desktopAdPositions . includes ( index ) && (
339
340
< FrontsBannerAdSlot
340
341
renderAds = { renderAds }
@@ -344,6 +345,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
344
345
) }
345
346
/>
346
347
) }
348
+
347
349
{ ! ! trail . embedUri && (
348
350
< SnapCssSandbox snapData = { trail . snapData } >
349
351
< Section
@@ -372,6 +374,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
372
374
</ Section >
373
375
</ SnapCssSandbox >
374
376
) }
377
+
375
378
{ mobileAdPositions . includes ( index ) && (
376
379
< MobileAdSlot
377
380
renderAds = { renderAds }
@@ -380,8 +383,10 @@ export const FrontLayout = ({ front, NAV }: Props) => {
380
383
) }
381
384
/>
382
385
) }
386
+
383
387
{ index === merchHighAdPosition && (
384
388
< MerchHighAdSlot
389
+ key = { ophanName }
385
390
renderAds = { renderAds }
386
391
collectionCount = {
387
392
filteredCollections . length
@@ -392,7 +397,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
392
397
}
393
398
/>
394
399
) }
395
- </ div >
400
+ </ Fragment >
396
401
) ;
397
402
}
398
403
@@ -406,7 +411,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
406
411
: undefined ;
407
412
408
413
return (
409
- < div key = { ophanName } >
414
+ < Fragment key = { ophanName } >
410
415
{ desktopAdPositions . includes ( index ) && (
411
416
< FrontsBannerAdSlot
412
417
renderAds = { renderAds }
@@ -416,9 +421,9 @@ export const FrontLayout = ({ front, NAV }: Props) => {
416
421
) }
417
422
/>
418
423
) }
424
+
419
425
< FrontSection
420
426
toggleable = { true }
421
- key = { ophanName }
422
427
title = {
423
428
showMostPopular
424
429
? mostPopularTitle
@@ -463,6 +468,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
463
468
renderAds = { renderAds }
464
469
/>
465
470
</ FrontSection >
471
+
466
472
{ mobileAdPositions . includes ( index ) && (
467
473
< MobileAdSlot
468
474
renderAds = { renderAds }
@@ -471,13 +477,13 @@ export const FrontLayout = ({ front, NAV }: Props) => {
471
477
) }
472
478
/>
473
479
) }
474
- </ div >
480
+ </ Fragment >
475
481
) ;
476
482
}
477
483
478
484
if ( collection . containerPalette === 'Branded' ) {
479
485
return (
480
- < div key = { ophanName } >
486
+ < Fragment key = { ophanName } >
481
487
< LabsSection
482
488
title = { collection . displayName }
483
489
collectionId = { collection . id }
@@ -525,6 +531,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
525
531
}
526
532
/>
527
533
</ LabsSection >
534
+
528
535
{ mobileAdPositions . includes ( index ) && (
529
536
< MobileAdSlot
530
537
renderAds = { renderAds }
@@ -533,6 +540,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
533
540
) }
534
541
/>
535
542
) }
543
+
536
544
{ index === merchHighAdPosition && (
537
545
< MerchHighAdSlot
538
546
renderAds = { renderAds }
@@ -545,7 +553,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
545
553
}
546
554
/>
547
555
) }
548
- </ div >
556
+ </ Fragment >
549
557
) ;
550
558
}
551
559
@@ -557,7 +565,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
557
565
collection . containerPalette ?? 'MediaPalette' ;
558
566
559
567
return (
560
- < div key = { ophanName } >
568
+ < Fragment key = { ophanName } >
561
569
{ desktopAdPositions . includes ( index ) && (
562
570
< FrontsBannerAdSlot
563
571
renderAds = { renderAds }
@@ -567,6 +575,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
567
575
) }
568
576
/>
569
577
) }
578
+
570
579
< ContainerOverrides
571
580
containerPalette = { containerPalette }
572
581
>
@@ -631,6 +640,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
631
640
</ Island >
632
641
</ Section >
633
642
</ ContainerOverrides >
643
+
634
644
{ mobileAdPositions . includes ( index ) && (
635
645
< MobileAdSlot
636
646
renderAds = { renderAds }
@@ -639,6 +649,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
639
649
) }
640
650
/>
641
651
) }
652
+
642
653
{ index === merchHighAdPosition && (
643
654
< MerchHighAdSlot
644
655
renderAds = { renderAds }
@@ -651,12 +662,12 @@ export const FrontLayout = ({ front, NAV }: Props) => {
651
662
}
652
663
/>
653
664
) }
654
- </ div >
665
+ </ Fragment >
655
666
) ;
656
667
}
657
668
658
669
return (
659
- < div key = { ophanName } >
670
+ < Fragment key = { ophanName } >
660
671
{ desktopAdPositions . includes ( index ) && (
661
672
< FrontsBannerAdSlot
662
673
renderAds = { renderAds }
@@ -666,6 +677,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
666
677
) }
667
678
/>
668
679
) }
680
+
669
681
< FrontSection
670
682
title = { collection . displayName }
671
683
description = { collection . description }
@@ -742,6 +754,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
742
754
containerLevel = { collection . containerLevel }
743
755
/>
744
756
</ FrontSection >
757
+
745
758
{ mobileAdPositions . includes ( index ) && (
746
759
< MobileAdSlot
747
760
renderAds = { renderAds }
@@ -750,6 +763,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
750
763
) }
751
764
/>
752
765
) }
766
+
753
767
{ index === merchHighAdPosition && (
754
768
< MerchHighAdSlot
755
769
renderAds = { renderAds }
@@ -760,7 +774,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
760
774
}
761
775
/>
762
776
) }
763
- </ div >
777
+ </ Fragment >
764
778
) ;
765
779
} ) }
766
780
</ main >
0 commit comments