-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2365 from storybooks/fix-actions-android
Fix addon-actions in legacy Android browser
- Loading branch information
Showing
8 changed files
with
76 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
20 changes: 20 additions & 0 deletions
20
examples/cra-kitchen-sink/src/stories/addon-actions.stories.js
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { action, decorateAction } from '@storybook/addon-actions'; | ||
import { Button } from '@storybook/react/demo'; | ||
|
||
const pickFirst = decorateAction([args => args.slice(0, 1)]); | ||
|
||
storiesOf('Addon Actions', module) | ||
.add('Hello World', () => <Button onClick={action('hello-world')}>Hello World</Button>) | ||
.add('Decorated Action', () => <Button onClick={pickFirst('decorated')}>First Argument</Button>) | ||
.add('Circular Payload', () => { | ||
const circular = { foo: {} }; | ||
circular.foo.circular = circular; | ||
return <Button onClick={() => action('circular')(circular)}>Circular Payload</Button>; | ||
}) | ||
.add('Function Name', () => { | ||
const fn = action('fnName'); | ||
return <Button onClick={fn}>Action.name: {fn.name}</Button>; | ||
}) | ||
.add('Reserved keyword as name', () => <Button onClick={action('delete')}>Delete</Button>); |
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