Skip to content

Commit

Permalink
Merge pull request #10710 from storybookjs/generator_reactScripts
Browse files Browse the repository at this point in the history
cli: react-scripts stories homogenization
  • Loading branch information
tooppaaa authored May 11, 2020
2 parents 3a87008 + a3ef1dc commit 9ed15c4
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { Button } from '@storybook/react/demo';

export default {
Expand All @@ -16,3 +17,32 @@ export const Emoji = () => (
</span>
</Button>
);

Emoji.story = {
parameters: { notes: 'My notes on a button with emojis' },
};

export const WithSomeEmojiAndAction = () => (
<Button onClick={action('This was clicked')}>
<span role="img" aria-label="so cool">
😀 😎 👍 💯
</span>
</Button>
);

WithSomeEmojiAndAction.story = {
name: 'with some emoji and action',
parameters: { notes: 'My notes on a button with emojis' },
};

export const ButtonWithLinkToAnotherStory = () => (
<Button onClick={linkTo('Welcome')}>
<span role="img" aria-label="so cool">
Go to Welcome Story
</span>
</Button>
);

ButtonWithLinkToAnotherStory.story = {
name: 'button with link to another story',
};

0 comments on commit 9ed15c4

Please sign in to comment.