Skip to content

Commit 4991f47

Browse files
committed
ensure adportals only rendered if renderAds is truthy
1 parent 8a6a9d9 commit 4991f47

File tree

7 files changed

+28
-42
lines changed

7 files changed

+28
-42
lines changed

dotcom-rendering/src/layouts/CommentLayout.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,10 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
347347
)}
348348

349349
<main data-layout="CommentLayout">
350-
{isApps && (
351-
<>
352-
<Island priority="critical">
353-
<AdPortals />
354-
</Island>
355-
</>
350+
{renderAds && isApps && (
351+
<Island priority="critical">
352+
<AdPortals />
353+
</Island>
356354
)}
357355
<Section
358356
fullWidth={true}

dotcom-rendering/src/layouts/ImmersiveLayout.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,10 @@ export const ImmersiveLayout = (props: WebProps | AppProps) => {
437437
)}
438438

439439
<main data-layout="ImmersiveLayout">
440-
{isApps && (
441-
<>
442-
<Island priority="critical">
443-
<AdPortals />
444-
</Island>
445-
</>
440+
{renderAds && isApps && (
441+
<Island priority="critical">
442+
<AdPortals />
443+
</Island>
446444
)}
447445
<Section
448446
fullWidth={true}

dotcom-rendering/src/layouts/InteractiveLayout.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,10 @@ export const InteractiveLayout = (props: WebProps | AppsProps) => {
324324
</>
325325
)}
326326
<main data-layout="InteractiveLayout">
327-
{isApps && (
328-
<>
329-
<Island priority="critical">
330-
<AdPortals />
331-
</Island>
332-
</>
327+
{renderAds && isApps && (
328+
<Island priority="critical">
329+
<AdPortals />
330+
</Island>
333331
)}
334332
<Section
335333
fullWidth={true}

dotcom-rendering/src/layouts/LiveLayout.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,10 @@ export const LiveLayout = (props: WebProps | AppsProps) => {
361361
</Section>
362362
</Hide>
363363
)}
364-
{isApps && (
365-
<>
366-
<Island priority="critical">
367-
<AdPortals rightAlignFrom="wide" />
368-
</Island>
369-
</>
364+
{renderAds && isApps && (
365+
<Island priority="critical">
366+
<AdPortals rightAlignFrom="wide" />
367+
</Island>
370368
)}
371369
{footballMatchUrl ? (
372370
<Section

dotcom-rendering/src/layouts/PictureLayout.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,10 @@ export const PictureLayout = (props: WebProps | AppsProps) => {
330330
lang={decideLanguage(article.lang)}
331331
dir={decideLanguageDirection(article.isRightToLeftLang)}
332332
>
333-
{isApps && (
334-
<>
335-
<Island priority="critical">
336-
<AdPortals />
337-
</Island>
338-
</>
333+
{renderAds && isApps && (
334+
<Island priority="critical">
335+
<AdPortals />
336+
</Island>
339337
)}
340338
<Section
341339
fullWidth={true}

dotcom-rendering/src/layouts/ShowcaseLayout.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,10 @@ export const ShowcaseLayout = (props: WebProps | AppsProps) => {
371371
lang={decideLanguage(article.lang)}
372372
dir={decideLanguageDirection(article.isRightToLeftLang)}
373373
>
374-
{isApps && (
375-
<>
376-
<Island priority="critical">
377-
<AdPortals />
378-
</Island>
379-
</>
374+
{renderAds && isApps && (
375+
<Island priority="critical">
376+
<AdPortals />
377+
</Island>
380378
)}
381379
<Section
382380
fullWidth={true}

dotcom-rendering/src/layouts/StandardLayout.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,10 @@ export const StandardLayout = (props: WebProps | AppProps) => {
453453
)}
454454

455455
<main data-layout="StandardLayout">
456-
{isApps && (
457-
<>
458-
<Island priority="critical">
459-
<AdPortals />
460-
</Island>
461-
</>
456+
{renderAds && isApps && (
457+
<Island priority="critical">
458+
<AdPortals />
459+
</Island>
462460
)}
463461
<Section
464462
fullWidth={true}

0 commit comments

Comments
 (0)