Skip to content

Commit 8235cd9

Browse files
authored
prevent labs containers from being toggled (#14765)
1 parent 8750857 commit 8235cd9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

dotcom-rendering/src/layouts/FrontLayout.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ const isNavList = (collection: DCRCollectionType) => {
6868
const isHighlights = ({ collectionType }: DCRCollectionType) =>
6969
collectionType === 'scrollable/highlights';
7070

71+
const isLabs = ({ containerPalette }: DCRCollectionType) =>
72+
containerPalette === 'Branded';
73+
7174
const isToggleable = (
7275
index: number,
7376
collection: DCRCollectionType,
@@ -77,11 +80,12 @@ const isToggleable = (
7780
return (
7881
collection.displayName.toLowerCase() !== 'headlines' &&
7982
!isNavList(collection) &&
80-
!isHighlights(collection)
83+
!isHighlights(collection) &&
84+
!isLabs(collection)
8185
);
8286
}
8387

84-
return index != 0 && !isNavList(collection);
88+
return index != 0 && !isNavList(collection) && !isLabs(collection);
8589
};
8690

8791
const decideLeftContent = (front: Front, collection: DCRCollectionType) => {
@@ -578,9 +582,7 @@ export const FrontLayout = ({ front, NAV }: Props) => {
578582
isAboveMobileAd={mobileAdPositions.includes(
579583
index,
580584
)}
581-
isLabs={
582-
collection.containerPalette === 'Branded'
583-
}
585+
isLabs={isLabs(collection)}
584586
showLabsRedesign={showLabsRedesign}
585587
>
586588
<DecideContainer

0 commit comments

Comments
 (0)