-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stories for header and footer components
- Loading branch information
Showing
5 changed files
with
155 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { FC } from "react"; | ||
import { StorybookEmailRenderer } from "../StorybookEmailRenderer"; | ||
import { EmailFooter, Props } from "./EmailFooter"; | ||
import { getL10n } from "../../app/functions/l10n/storybookAndJest"; | ||
|
||
const meta: Meta<FC<Props>> = { | ||
title: "Emails/Components/Footer", | ||
component: (props: Props) => ( | ||
<StorybookEmailRenderer plainTextVersion={null}> | ||
<mjml> | ||
<mj-body> | ||
<EmailFooter {...props} /> | ||
</mj-body> | ||
</mjml> | ||
</StorybookEmailRenderer> | ||
), | ||
args: { | ||
l10n: getL10n("en"), | ||
utm_campaign: "storybook", | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<FC<Props>>; | ||
|
||
export const RepeatEmail: Story = { | ||
name: "Repeat email", | ||
args: { | ||
isOneTimeEmail: false, | ||
}, | ||
}; | ||
|
||
export const OneTimeEmail: Story = { | ||
name: "One-time email", | ||
args: { | ||
isOneTimeEmail: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { FC } from "react"; | ||
import { StorybookEmailRenderer } from "../StorybookEmailRenderer"; | ||
import { EmailHeader, Props } from "./EmailHeader"; | ||
import { getL10n } from "../../app/functions/l10n/storybookAndJest"; | ||
|
||
const meta: Meta<FC<Props>> = { | ||
title: "Emails/Components/Header", | ||
component: (props: Props) => ( | ||
<StorybookEmailRenderer plainTextVersion={null}> | ||
<mjml> | ||
<mj-body> | ||
<EmailHeader {...props} /> | ||
</mj-body> | ||
</mjml> | ||
</StorybookEmailRenderer> | ||
), | ||
args: { | ||
l10n: getL10n("en"), | ||
utm_campaign: "storybook", | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<FC<Props>>; | ||
|
||
export const EmailHeaderStory: Story = { | ||
name: "Header", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { FC } from "react"; | ||
import { StorybookEmailRenderer } from "../StorybookEmailRenderer"; | ||
import { EmailHero, Props } from "./EmailHero"; | ||
import { getL10n } from "../../app/functions/l10n/storybookAndJest"; | ||
|
||
const meta: Meta<FC<Props>> = { | ||
title: "Emails/Components/Hero", | ||
component: (props: Props) => ( | ||
<StorybookEmailRenderer plainTextVersion={null}> | ||
<mjml> | ||
<mj-body> | ||
<EmailHero {...props} /> | ||
</mj-body> | ||
</mjml> | ||
</StorybookEmailRenderer> | ||
), | ||
args: { | ||
l10n: getL10n("en"), | ||
utm_campaign: "storybook", | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<FC<Props>>; | ||
|
||
export const EmailHeroStory: Story = { | ||
name: "Hero", | ||
args: { | ||
heading: "Email heading", | ||
subheading: "Email subheading", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { FC } from "react"; | ||
import { StorybookEmailRenderer } from "../StorybookEmailRenderer"; | ||
import { RedesignedEmailFooter, Props } from "./EmailFooter"; | ||
import { getL10n } from "../../app/functions/l10n/storybookAndJest"; | ||
|
||
const meta: Meta<FC<Props>> = { | ||
title: "Emails/Components/Redesigned footer", | ||
component: (props: Props) => ( | ||
<StorybookEmailRenderer plainTextVersion={null}> | ||
<mjml> | ||
<mj-body> | ||
<RedesignedEmailFooter {...props} /> | ||
</mj-body> | ||
</mjml> | ||
</StorybookEmailRenderer> | ||
), | ||
args: { | ||
l10n: getL10n("en"), | ||
utm_campaign: "storybook", | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<FC<Props>>; | ||
|
||
export const RepeatEmail: Story = { | ||
name: "Without unsubscribe link", | ||
}; | ||
|
||
export const WithUnsubscribeLink: Story = { | ||
name: "With unsubscribe link", | ||
args: { | ||
unsubscribeLink: "https://example.com/unsubscribe", | ||
}, | ||
}; |