-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(storybook): add
args
to auto generate docs (#5979)
* fix(storybook): add `args` to auto generate docs see: - storybookjs/storybook#8104 (comment) - https://storybook.js.org/docs/react/writing-docs/doc-block-source * test(unit): update snapshots ```sh yarn workspace @redwoodjs/cli run test -u ``` see: redwoodjs/redwood#5979 (comment)
- Loading branch information
1 parent
a2e8e7b
commit dea3714
Showing
8 changed files
with
104 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
packages/cli/src/commands/generate/cell/templates/stories.js.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { Loading, Empty, Failure, Success } from './${pascalName}Cell' | ||
import { standard } from './${pascalName}Cell.mock' | ||
|
||
export const loading = () => { | ||
return Loading ? <Loading /> : null | ||
export const loading = (args) => { | ||
return Loading ? <Loading {...args} /> : null | ||
} | ||
|
||
export const empty = () => { | ||
return Empty ? <Empty /> : null | ||
export const empty = (args) => { | ||
return Empty ? <Empty {...args} /> : null | ||
} | ||
|
||
export const failure = () => { | ||
return Failure ? <Failure error={new Error("Oh no")} /> : null | ||
export const failure = (args) => { | ||
return Failure ? <Failure error={new Error("Oh no")} {...args} /> : null | ||
} | ||
|
||
export const success = () => { | ||
return Success ? <Success {...standard()} /> : null | ||
export const success = (args) => { | ||
return Success ? <Success {...standard()} {...args} /> : null | ||
} | ||
|
||
export default { title: 'Cells/${pascalName}Cell' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/cli/src/commands/generate/component/templates/stories.tsx.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import ${pascalName} from './${pascalName}' | ||
|
||
export const generated = () => { | ||
return <${pascalName} /> | ||
export const generated = (args) => { | ||
return <${pascalName} {...args} /> | ||
} | ||
|
||
export default { title: 'Components/${pascalName}' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/cli/src/commands/generate/layout/templates/stories.tsx.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import ${singularPascalName}Layout from './${pascalName}Layout' | ||
|
||
export const generated = () => { | ||
return <${singularPascalName}Layout /> | ||
export const generated = (args) => { | ||
return <${singularPascalName}Layout {...args} /> | ||
} | ||
|
||
export default { title: 'Layouts/${singularPascalName}Layout' } |
Oops, something went wrong.