Skip to content

Commit cf7bcdf

Browse files
committed
Add an arg temporary for the showLabsDesign to switch on when we switch it in PROD
1 parent 9a02920 commit cf7bcdf

File tree

1 file changed

+50
-22
lines changed

1 file changed

+50
-22
lines changed

dotcom-rendering/src/components/Palettes.stories.tsx

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@ const meta = {
1616
},
1717
},
1818
},
19-
} satisfies Meta;
19+
args: {
20+
showLabsRedesign: false,
21+
},
22+
argTypes: {
23+
showLabsRedesign: {
24+
control: { type: 'boolean' },
25+
description:
26+
'Toggle between old Labs design (LabsSection) and new design (FrontSection)',
27+
},
28+
},
29+
} satisfies Meta<{ showLabsRedesign: boolean }>;
2030
type Story = StoryObj<typeof meta>;
2131

2232
export default meta;
@@ -208,25 +218,43 @@ export const SpecialReportAltPalette = {
208218
),
209219
} satisfies Story;
210220

211-
export const BrandedPalette = {
212-
render: () => (
213-
<LabsSection
214-
title="Branded Palette"
215-
collectionId={''}
216-
pageId={''}
217-
ajaxUrl={''}
218-
sectionId={'branded-palette'}
219-
ophanComponentName={'branded-palette'}
220-
ophanComponentLink={'branded-palette'}
221-
discussionApiUrl={discussionApiUrl}
222-
editionId={'UK'}
223-
>
224-
<DynamicFast
225-
groupedTrails={groupedTrails}
221+
export const BrandedPalette: StoryObj<{ showLabsRedesign: boolean }> = {
222+
render: ({ showLabsRedesign }) =>
223+
showLabsRedesign ? (
224+
<FrontSection
225+
title="Branded Palette Redesign"
226226
containerPalette="Branded"
227-
showAge={true}
228-
imageLoading="eager"
229-
/>
230-
</LabsSection>
231-
),
232-
} satisfies Story;
227+
showDateHeader={true}
228+
editionId={'UK'}
229+
discussionApiUrl={discussionApiUrl}
230+
isLabs={true}
231+
showLabsRedesign={showLabsRedesign}
232+
>
233+
<DynamicFast
234+
groupedTrails={groupedTrails}
235+
containerPalette="Branded"
236+
showAge={true}
237+
imageLoading="eager"
238+
/>
239+
</FrontSection>
240+
) : (
241+
<LabsSection
242+
title="Branded Palette"
243+
collectionId={''}
244+
pageId={''}
245+
ajaxUrl={''}
246+
sectionId={'branded-palette-toggle'}
247+
ophanComponentName={'branded-palette-toggle'}
248+
ophanComponentLink={'branded-palette-toggle'}
249+
discussionApiUrl={discussionApiUrl}
250+
editionId={'UK'}
251+
>
252+
<DynamicFast
253+
groupedTrails={groupedTrails}
254+
containerPalette="Branded"
255+
showAge={true}
256+
imageLoading="eager"
257+
/>
258+
</LabsSection>
259+
),
260+
};

0 commit comments

Comments
 (0)