diff --git a/src/components/Button/Button.stories.tsx b/src/components/Button/Button.stories.tsx index bfe7a19..d14a678 100644 --- a/src/components/Button/Button.stories.tsx +++ b/src/components/Button/Button.stories.tsx @@ -1,5 +1,4 @@ import { ComponentStory, ComponentMeta } from '@storybook/react'; -import { CSSProperties } from 'react'; import { Email } from '../Email/Email'; import { Section } from '../Section/Section'; @@ -21,22 +20,9 @@ const Template: ComponentStory = (args) => ( ); -const rootStyles: CSSProperties = { - fontSize: '18px', - textDecoration: 'none', - padding: '10px 16px', - borderRadius: '5px', - cursor: 'pointer', - backgroundColor: 'blue', - color: 'white', -}; - const defaultArgs: ButtonProps = { children: 'Default Button', href: 'https://github.com/leopardslab/react-email', - classes: { - root: rootStyles, - }, }; export const Default = Template.bind({}); @@ -47,13 +33,6 @@ Primary.args = { ...defaultArgs, children: 'Primary Button', variant: 'primary', - classes: { - root: rootStyles, - primary: { - backgroundColor: 'green', - color: 'white', - }, - }, }; export const Secondary = Template.bind({}); @@ -61,10 +40,18 @@ Secondary.args = { ...defaultArgs, children: 'Secondary Button', variant: 'secondary', +}; + +export const CustomStyles = Template.bind({}); +CustomStyles.args = { + ...defaultArgs, + children: 'Custom Styles', classes: { - root: rootStyles, - secondary: { - backgroundColor: 'red', + root: { + borderRadius: '10px', + }, + primary: { + backgroundColor: 'green', color: 'white', }, }, diff --git a/src/components/Button/__snapshots__/Button.stories.tsx.snap b/src/components/Button/__snapshots__/Button.stories.tsx.snap index e1286cf..2d4a4f6 100644 --- a/src/components/Button/__snapshots__/Button.stories.tsx.snap +++ b/src/components/Button/__snapshots__/Button.stories.tsx.snap @@ -1,5 +1,30 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`components/Button CustomStyles smoke-test 1`] = ` +
+ + + + + + +
+ + Custom Styles + +
+
+`; + exports[`components/Button Default smoke-test 1`] = `
Default Button @@ -39,7 +64,7 @@ exports[`components/Button Primary smoke-test 1`] = ` > Primary Button @@ -64,7 +89,7 @@ exports[`components/Button Secondary smoke-test 1`] = ` > Secondary Button diff --git a/src/components/DefaultTheme/index.ts b/src/components/DefaultTheme/index.ts index 59f7493..a35f0f2 100644 --- a/src/components/DefaultTheme/index.ts +++ b/src/components/DefaultTheme/index.ts @@ -65,9 +65,21 @@ export const defaultTheme: ThemeOptions = { section: { root: {}, body: {}, row: {} }, column: { root: {} }, button: { - root: {}, - primary: {}, - secondary: {}, + root: { + fontSize: '18px', + textDecoration: 'none', + padding: '10px 16px', + borderRadius: '5px', + cursor: 'pointer', + }, + primary: { + backgroundColor: '#007bff', + color: '#fff', + }, + secondary: { + backgroundColor: '#6c757d', + color: '#fff', + }, }, link: { root: {} }, divider: { root: {} },