Skip to content

Commit

Permalink
docs(storybook): fix Column stories
Browse files Browse the repository at this point in the history
fix Column stories

resolves #39

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
  • Loading branch information
niloysikdar committed Jul 3, 2022
1 parent 2d65b20 commit d0b1e21
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/components/Column/Column.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ComponentStory, ComponentMeta } from '@storybook/react';

import { Email } from '../Email/Email';
import { Section } from '../Section/Section';
import { Column } from './Column';

export default {
Expand All @@ -10,16 +11,15 @@ export default {
//“template” of how args map to rendering
const Template: ComponentStory<typeof Column> = (args) => (
<Email>
<Column {...args} />
<Section>
<Column {...args} />
</Section>
</Email>
);

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

Default.args = {
// children: (
// <tr>
// <td style={{ fontSize: '30px', color: 'red' }}>Hello World</td>
// </tr>
// ),
children: <p style={{ margin: '0', fontSize: '30px' }}>Hello World</p>,
align: 'center',
};
10 changes: 8 additions & 2 deletions src/components/Column/Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ export interface ColumnProps {
children?: ReactNode;
className?: string;
style?: CSSProperties;
align?: 'left' | 'center' | 'right';
}

export const Column = ({ children, className, style }: ColumnProps): JSX.Element => {
export const Column = ({
children,
className,
style,
align = 'left',
}: ColumnProps): JSX.Element => {
return (
<td className={className} style={style} align="center">
<td className={className} style={style} align={align}>
{children}
</td>
);
Expand Down

0 comments on commit d0b1e21

Please sign in to comment.