Skip to content

Commit

Permalink
fix(storybook): add args to auto generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuoushub committed Jul 19, 2022
1 parent 4d56cc3 commit 5f71da9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
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' }
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}' }
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' }
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ${pascalName}Page from './${pascalName}Page'

export const generated = () => {
return <${pascalName}Page ${propValueParam}/>
export const generated = (args) => {
return <${pascalName}Page ${propValueParam} {...args} />
}

export default { title: 'Pages/${pascalName}Page' }

0 comments on commit 5f71da9

Please sign in to comment.