Skip to content

Commit

Permalink
Add split theme to carousel stories
Browse files Browse the repository at this point in the history
  • Loading branch information
sophie-macmillan committed Nov 29, 2023
1 parent 3877af5 commit 9be27c2
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions dotcom-rendering/src/components/Carousel.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ export const SingleItemCarousel = () => (
);

SingleItemCarousel.storyName = 'Carousel with single item';
SingleItemCarousel.decorators = [
splitTheme([defaultFormat], { orientation: 'vertical' }),
];

export const Immersive = () => (
<>
Expand Down Expand Up @@ -280,15 +283,17 @@ export const Immersive = () => (

Immersive.storyName = 'Immersive carousel';

const specialReportAltFormat = {
theme: ArticleSpecial.SpecialReportAlt,
design: ArticleDesign.Standard,
display: ArticleDisplay.Standard,
};

export const SpecialReportAlt = () => {
const specialReportTrails = [...trails];

for (const trail of specialReportTrails)
trail.format = {
theme: ArticleSpecial.SpecialReportAlt,
design: ArticleDesign.Standard,
display: ArticleDisplay.Standard,
};
trail.format = specialReportAltFormat;

return (
<>
Expand All @@ -297,11 +302,7 @@ export const SpecialReportAlt = () => {
heading="SpecialReportAlt"
trails={specialReportTrails}
onwardsSource="curated-content"
format={{
theme: ArticleSpecial.SpecialReportAlt,
design: ArticleDesign.Standard,
display: ArticleDisplay.Standard,
}}
format={specialReportAltFormat}
leftColSize={'compact'}
discussionApiUrl={discussionApiUrl}
/>
Expand All @@ -311,6 +312,9 @@ export const SpecialReportAlt = () => {
};

SpecialReportAlt.storyName = 'SpecialReportAlt';
SpecialReportAlt.decorators = [
splitTheme([specialReportAltFormat], { orientation: 'vertical' }),
];

export const FrontCarousel = () => (
<>
Expand Down

0 comments on commit 9be27c2

Please sign in to comment.