Skip to content

Commit

Permalink
STP-84: a few little changes to the storybook docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
n3op2 committed Oct 19, 2023
1 parent 3e112a5 commit dadab39
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/FormGroup/FormGroup.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
import React from 'react'

import FormGroup, { FormGroupProps } from './index.js'
import { action } from '@storybook/addon-actions'
import FormGroup from './index.js'
import InputText from '../Input/index.js'

export default {
title: 'Components/FormGroup',
component: FormGroup,
argTypes: {
onSubmit: {},
},
onSubmit: { action: 'clicked' }

Check failure on line 11 in src/FormGroup/FormGroup.stories.tsx

View workflow job for this annotation

GitHub Actions / Run lint

Insert `,`
}

Check failure on line 12 in src/FormGroup/FormGroup.stories.tsx

View workflow job for this annotation

GitHub Actions / Run lint

Insert `,`
}

const DefaultStoryTemplate = (args: FormGroupProps) => (
<FormGroup onSubmit={args.onSubmit}>
const DefaultStoryTemplate = () => (
<FormGroup onSubmit={action('submit')}>
<InputText type="text" name="test-a" />
<br />
<button type="submit">submit</button>
</FormGroup>
)

export const Default = DefaultStoryTemplate.bind({})

Default.args = {
onSubmit: (e) => {
e.preventDefault()
window.alert(`submitted: ${e.target}`)
},
}

0 comments on commit dadab39

Please sign in to comment.