Skip to content

Commit 425cd60

Browse files
committed
include labs redesign switch in frontlayout and feed through to frontsection
1 parent 9695fe3 commit 425cd60

File tree

2 files changed

+48
-25
lines changed

2 files changed

+48
-25
lines changed

dotcom-rendering/src/components/FrontSection.tsx

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ type Props = {
9393
hasNavigationButtons?: boolean;
9494
isAboveDesktopAd?: boolean;
9595
isAboveMobileAd?: boolean;
96+
/** Indicates whether this is a Guardian Labs container */
97+
isLabs?: boolean;
98+
/** Feature switch for the labs redesign work */
99+
showLabsRedesign?: boolean;
96100
};
97101

98102
const width = (columns: number, columnWidth: number, columnGap: number) =>
@@ -592,6 +596,8 @@ export const FrontSection = ({
592596
hasNavigationButtons = false,
593597
isAboveDesktopAd = false,
594598
isAboveMobileAd = false,
599+
isLabs = false,
600+
showLabsRedesign = false,
595601
}: Props) => {
596602
const isToggleable = toggleable && !!sectionId;
597603
const showVerticalRule = !hasPageSkin;
@@ -677,33 +683,41 @@ export const FrontSection = ({
677683
),
678684
]}
679685
>
680-
<FrontSectionTitle
681-
title={
682-
<ContainerTitle
683-
title={title}
684-
lightweightHeader={isTagPage}
685-
description={description}
686-
fontColour={
687-
containerLevel === 'Secondary'
688-
? schemePalette(
689-
'--article-section-secondary-title',
690-
)
691-
: articleSectionTitleStyles(
692-
title,
693-
showSectionColours,
694-
)
686+
{!isLabs && !showLabsRedesign && (
687+
<>
688+
<FrontSectionTitle
689+
title={
690+
<ContainerTitle
691+
title={title}
692+
lightweightHeader={isTagPage}
693+
description={description}
694+
fontColour={
695+
containerLevel === 'Secondary'
696+
? schemePalette(
697+
'--article-section-secondary-title',
698+
)
699+
: articleSectionTitleStyles(
700+
title,
701+
showSectionColours,
702+
)
703+
}
704+
// On paid fronts the title is not treated as a link
705+
url={
706+
!isOnPaidContentFront
707+
? url
708+
: undefined
709+
}
710+
showDateHeader={showDateHeader}
711+
editionId={editionId}
712+
containerLevel={containerLevel}
713+
/>
695714
}
696-
// On paid fronts the title is not treated as a link
697-
url={!isOnPaidContentFront ? url : undefined}
698-
showDateHeader={showDateHeader}
699-
editionId={editionId}
700-
containerLevel={containerLevel}
715+
collectionBranding={collectionBranding}
701716
/>
702-
}
703-
collectionBranding={collectionBranding}
704-
/>
705717

706-
{leftContent}
718+
{leftContent}
719+
</>
720+
)}
707721
</div>
708722

709723
{(isToggleable || hasNavigationButtons) && (

dotcom-rendering/src/layouts/FrontLayout.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ export const FrontLayout = ({ front, NAV }: Props) => {
135135

136136
const contributionsServiceUrl = getContributionsServiceUrl(front);
137137

138+
const showLabsRedesign = !!front.config.switches.guardianLabsRedesign;
139+
138140
const fallbackAspectRatio = (collectionType: DCRContainerType) => {
139141
switch (collectionType) {
140142
case 'scrollable/feature':
@@ -424,7 +426,10 @@ export const FrontLayout = ({ front, NAV }: Props) => {
424426
);
425427
}
426428

427-
if (collection.containerPalette === 'Branded') {
429+
if (
430+
collection.containerPalette === 'Branded' &&
431+
!showLabsRedesign
432+
) {
428433
return (
429434
<Fragment key={ophanName}>
430435
<LabsSection
@@ -567,6 +572,10 @@ export const FrontLayout = ({ front, NAV }: Props) => {
567572
isAboveMobileAd={mobileAdPositions.includes(
568573
index,
569574
)}
575+
isLabs={
576+
collection.containerPalette === 'Branded'
577+
}
578+
showLabsRedesign={showLabsRedesign}
570579
>
571580
<DecideContainer
572581
trails={trails}

0 commit comments

Comments
 (0)