Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cra-kitchen-sink and crna-getstorybook #1259

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Simple notes example
  • Loading branch information
shilman committed Jun 8, 2017
commit 493a1674b546620d8da94c35d6a26f6eecef6fb7
1 change: 1 addition & 0 deletions examples/test-cra/.storybook/addons.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-notes/register';
1 change: 1 addition & 0 deletions examples/test-cra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"devDependencies": {
"@storybook/addon-actions": "file:../../addons/actions",
"@storybook/addon-links": "file:../../addons/links",
"@storybook/addon-notes": "file:../../addons/notes",
"@storybook/addon-storyshots": "file:../../addons/storyshots",
"@storybook/addons": "file:../../lib/addons",
"@storybook/channel-postmessage": "file:../../lib/channel-postmessage",
Expand Down
7 changes: 6 additions & 1 deletion examples/test-cra/src/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { WithNotes } from '@storybook/addon-notes';

import Button from './Button';
import Welcome from './Welcome';
Expand All @@ -13,7 +14,11 @@ import ComponentWithRef from './ComponentWithRef';
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);

storiesOf('Button', module)
.add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>)
.add('with text', () =>
<WithNotes notes={'A very simple button'}>
<Button onClick={action('clicked')}>Hello Button</Button>
</WithNotes>
)
.add('with some emoji', () => <Button onClick={action('clicked')}>😀 😎 👍 💯</Button>);

storiesOf('ComponentWithRef', module).add('basic', () => <ComponentWithRef />);