-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Doc-43] add stories to atoms #810
base: dev
Are you sure you want to change the base?
Conversation
…t-appearing-when-changing-to-english-lang
…ographics into doc-43-add-stories-to-atoms
@@ -25,7 +25,11 @@ const TextButton: FC<IProps> = ({ isSubmit = false, onClick, children }) => ( | |||
</MatButton> | |||
); | |||
|
|||
const IconButton: FC<IProps> = ({ onClick, children }) => <MatIconButton onClick={onClick}>{children}</MatIconButton>; | |||
const IconButton: FC<IProps> = ({ isSubmit = false, onClick, children }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icon button does not need isSubmit
(it is never used for submit)
|
||
const Template: Story<ComponentProps<typeof AppBar>> = (args) => <AppBar {...args} />; | ||
|
||
export const AppBarS = Template.bind({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following can be applied for all stories
- This will leave "AppBarS" to be displayed on the storybook site. rename it so it will have a displayable name
- you can use
ComponentStory
andComponentMeta
for better typing: - Atoms with a single story, doesn't need a 3rd level nesting ( 'Components/atoms/AppBar' => 'Components/atoms')
import { ComponentStory, ComponentMeta } from '@storybook/react';
import AppBarComp from '../AppBar';
export default {
title: 'Components/atoms',
component: AppBar,
} as ComponentMeta<typeof AppBarComp>;
const Template: ComponentStory<typeof AppBar> = (args) => <AppBarComp {...args} />;
export const AppBar = Template.bind({});
import { AnyWayButton } from '../AnyWayButton'; | ||
|
||
export default { | ||
title: 'Components/atoms/AnyWayButton', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AnyWayButton is about to be refactored / remove, no need a story for this one
// export const ButtonOutlinedS = Template.bind({}); | ||
// ButtonOutlinedS.args = { | ||
// type: 'outlined', | ||
// children: 'Button', | ||
// }; | ||
|
||
// export const ButtonIconS = Template.bind({}); | ||
// ButtonIconS.args = { | ||
// type: 'icon', | ||
// children: 'Button', | ||
// }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove if not needed
|
||
const Template: Story<ComponentProps<typeof Dialog>> = (args) => <Dialog {...args} />; | ||
|
||
export const DialogS = Template.bind({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not possible to display the dialog from the main content area. can you include a button which will open it?
control: { type: 'select' }, | ||
}, | ||
}, | ||
} as unknown as Meta; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why unknown
?
} as Meta; | ||
|
||
const Item: FC<ItemProps> = ({ number }) => { | ||
return <div>Item no^{number}</div>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return <div>Item no^{number}</div>; | |
return <div>Item {number}</div>; |
No description provided.