Skip to content

Commit

Permalink
feat(storybook): add story
Browse files Browse the repository at this point in the history
add stories for sx

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
  • Loading branch information
niloysikdar committed Jun 26, 2022
1 parent d63f627 commit 17e9606
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/utils/makeStyles.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const useStyles = makeStyles({
root: {
width: 'fit-content',
backgroundColor: 'yellow',
padding: '50px',
},
});

Expand Down
35 changes: 35 additions & 0 deletions src/utils/sx.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { ComponentStory, ComponentMeta } from '@storybook/react';

import { sx } from './sx';

const styles = {
primary: {
width: 'fit-content',
backgroundColor: 'yellow',
padding: '50px',
},
secondary: {
padding: '10px',
color: 'red',
},
};

const Email = (): JSX.Element => {
const style = sx(styles.primary, styles.secondary);
return (
<div style={style}>
<div>
<h2>Hello World</h2>
</div>
</div>
);
};

export default {
component: Email,
} as ComponentMeta<typeof Email>;

//“template” of how args map to rendering
const Template: ComponentStory<typeof Email> = () => <Email />;

export const Default = Template.bind({});

0 comments on commit 17e9606

Please sign in to comment.