-
Notifications
You must be signed in to change notification settings - Fork 5
chore: allow changing args in stories #82
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
Conversation
| export const Default: Meta<NavigationTreeProps> = { | ||
| component: NavigationTree, | ||
| render: (props) => { | ||
| return <Template {...props} />; | ||
| }, | ||
| args: { | ||
| fetchPath: fetchPath, | ||
| renderAdditionalNodeElements: renderAdditionalNodeElements, | ||
| }, | ||
| }; | ||
|
|
||
| return ( | ||
| <NavigationTree | ||
| rootState={{ | ||
| path: '', | ||
| name: 'ru/maps/maps_prod', | ||
| type: 'database', | ||
| collapsed: false, | ||
| }} | ||
| fetchPath={fetchPathWithLargeResults} | ||
| getActions={getActions} | ||
| activePath={activePath} | ||
| onActivePathUpdate={setActivePath} | ||
| virtualize | ||
| /> | ||
| ); | ||
| export const Virtualized: Meta<NavigationTreeProps> = { | ||
| component: NavigationTree, | ||
| render: (props) => { | ||
| return <Template {...props} />; | ||
| }, | ||
| args: { | ||
| fetchPath: fetchPathWithLargeResults, | ||
| virtualize: true, | ||
| }, |
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.
Pass only specific for this stories args, other args will be from default export
| rootState: { | ||
| control: false, | ||
| }, | ||
| fetchPath: { | ||
| control: false, | ||
| }, | ||
| getActions: { | ||
| control: false, | ||
| }, | ||
| renderAdditionalNodeElements: { | ||
| control: false, | ||
| }, | ||
| activePath: { | ||
| control: false, | ||
| }, | ||
| onActivePathUpdate: { | ||
| control: false, | ||
| }, |
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.
I only allowed changing cache and virtualize, other props are disabled as they were before. The reason - other props are complex and may require some setup, that I do not want to do right now
cacheandvirtualizeprops in storiesThe reason: I plan to add additional param to
NavigationTree, so I prepare stories, so this new param could be visible in stories.