Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Commit

Permalink
Add onClick props in storybook
Browse files Browse the repository at this point in the history
This reason, users clicked on button and did not see any action, now it
logs the action
  • Loading branch information
sureshHARDIYA committed Mar 15, 2017
1 parent c6af910 commit 23a30e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ addDecorator((fn, { kind, story }) => <div>
</div>
</nav>
<div className="uk-margin-top uk-margin-left uk-margin-right uk-margin-bottom">
<a
{/* <a
href={`javascript:
var script = document.createElement('script');
script.setAttribute('src', 'https://getuikit.com/migrate.min.js');
document.body.appendChild(script);
`}>test</a>
var script = document.createElement('script');
script.setAttribute('src', 'https://getuikit.com/migrate.min.js');
document.body.appendChild(script);
`}>test</a> */}
{fn()}
</div>
</div>)
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/Dropdown-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import renderer from 'react-test-renderer'

import Dropdown from '../Dropdown'

jest.useFakeTimers()
Expand Down
12 changes: 6 additions & 6 deletions src/stories/Button.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { storiesOf } from '@kadira/storybook'
import { storiesOf, action } from '@kadira/storybook'
import { Button } from 'uikit-react'

// This is to work around: https://github.com/kadirahq/react-storybook-addon-info/issues/26#issuecomment-229029177
Expand All @@ -7,10 +7,10 @@ Button.displayName = 'Button'
storiesOf('Button', module)
.addWithInfo('Basic Usage', '', () => (
<div className="uk-margin-bottom">
<Button primary>Primary</Button> &nbsp;
<Button success>Success</Button> &nbsp;
<Button danger>Danger</Button> &nbsp;
<Button link>Link</Button> &nbsp;
<Button type="submit">Submit</Button>
<Button primary onClick={action('onClick Primary')}>Primary</Button> &nbsp;
<Button success onClick={action('onClick Success')}>Success</Button> &nbsp;
<Button danger onClick={action('onClick Danger')}>Danger</Button> &nbsp;
<Button link onClick={action('onClick Link')}>Link</Button> &nbsp;
<Button type="submit" onClick={action('onClick Submit')}>Submit</Button>
</div>
), { header: false, inline: true, propTables: [Button] })

0 comments on commit 23a30e2

Please sign in to comment.