From cb35fc5a454b76aaee2f9d2f526db76de4080aa4 Mon Sep 17 00:00:00 2001 From: Charlotte Date: Wed, 11 Dec 2024 17:49:20 +0000 Subject: [PATCH] Add 6 as value for collection height of very long containers that are at least double a standard screen height --- dotcom-rendering/src/lib/getFrontsAdPositions.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dotcom-rendering/src/lib/getFrontsAdPositions.ts b/dotcom-rendering/src/lib/getFrontsAdPositions.ts index 02fce47f160..44179f544c9 100644 --- a/dotcom-rendering/src/lib/getFrontsAdPositions.ts +++ b/dotcom-rendering/src/lib/getFrontsAdPositions.ts @@ -76,13 +76,14 @@ const getMobileAdPositions = (collections: AdCandidate[]): number[] => { * * A result of 3 would approximately be the height of a typical desktop viewport (~900px). * A result of 1 would be a third of the height, a result of 1.5 would be half, etc. + * A result of 6 indicates a container is at least double the height of a typical desktop viewport. */ const getCollectionHeight = ( collction: Pick< DCRCollectionType, 'collectionType' | 'containerPalette' | 'grouped' >, -): 0.5 | 1 | 1.5 | 2 | 2.5 | 3 => { +): 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 6 => { const { collectionType, containerPalette, grouped } = collction; if (containerPalette === 'PodcastPalette') { @@ -175,11 +176,16 @@ const getCollectionHeight = ( case 'flexible/general': if (groupedCounts.splash && !groupedCounts.standard) { - return 2; + return 2.5; } else if (groupedCounts.splash && groupedCounts.standard > 2) { - return 3; + return 6; + } else if ( + grouped.splash[0]?.boostLevel === 'megaboost' || + grouped.splash[0]?.boostLevel === 'gigaboost' + ) { + return 6; } else { - return 2.5; + return 3; } default: