Skip to content

Commit

Permalink
Add 6 as value for collection height of very long containers that are…
Browse files Browse the repository at this point in the history
… at least double a standard screen height
  • Loading branch information
cemms1 committed Dec 11, 2024
1 parent bcdd784 commit cb35fc5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions dotcom-rendering/src/lib/getFrontsAdPositions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit cb35fc5

Please sign in to comment.