Skip to content

Instantly share code, notes, and snippets.

@jodyheavener
Created July 12, 2021 13:39
Show Gist options
  • Save jodyheavener/fab1a8072c29b2cc45953c15d27330f7 to your computer and use it in GitHub Desktop.
Save jodyheavener/fab1a8072c29b2cc45953c15d27330f7 to your computer and use it in GitHub Desktop.
diff --git a/packages/fxa-auth-server/lib/senders/emails/templates/cadReminder/index.stories.ts b/packages/fxa-auth-server/lib/senders/emails/templates/cadReminder/index.stories.ts
index cc75c5813..90cf66c02 100644
--- a/packages/fxa-auth-server/lib/senders/emails/templates/cadReminder/index.stories.ts
+++ b/packages/fxa-auth-server/lib/senders/emails/templates/cadReminder/index.stories.ts
@@ -7,34 +7,35 @@ export default {
const Template: Story<StorybookEmailArgs> = (args) => storybookEmail(args);
+const defaultVariables = {
+ buttonText: 'Sync device',
+ anotherDeviceURL:
+ '/connect_another_device?utm_medium=email&utm_campaign=fx-cad-reminder-first&utm_content=fx-connect-device',
+ iosURL:
+ 'https://accounts-static.cdn.mozilla.net/product-icons/apple-app-store.png',
+ androidURL:
+ 'https://accounts-static.cdn.mozilla.net/product-icons/google-play.png',
+ onDesktopOrTabletDevice: true,
+};
+
const commonPropsWithOverrides = (
- overrides: Partial<StorybookEmailArgs> = {}
+ overrides: Partial<typeof defaultVariables> = {}
) =>
Object.assign({
template: 'cadReminder',
doc: 'The Connect Another Device Reminder is sent when [TODO: documentation].',
variables: {
- buttonText: 'Sync device',
- anotherDeviceURL:
- '/connect_another_device?utm_medium=email&utm_campaign=fx-cad-reminder-first&utm_content=fx-connect-device',
- iosURL:
- 'https://accounts-static.cdn.mozilla.net/product-icons/apple-app-store.png',
- androidURL:
- 'https://accounts-static.cdn.mozilla.net/product-icons/google-play.png',
+ ...defaultVariables,
...overrides,
},
});
export const CadReminderDesktopTablet = Template.bind({});
-CadReminderDesktopTablet.args = commonPropsWithOverrides({
- /*@ts-ignore */
- onDesktopOrTabletDevice: true,
-});
+CadReminderDesktopTablet.args = commonPropsWithOverrides();
CadReminderDesktopTablet.storyName = 'User is on desktop or tablet device';
export const CadReminderMobile = Template.bind({});
CadReminderMobile.args = commonPropsWithOverrides({
- /*@ts-ignore */
onDesktopOrTabletDevice: false,
});
CadReminderMobile.storyName = 'User is on mobile device';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment