Merge pull request #10709 from storybookjs/generator_webpackReact

cli: webpack react stories homogenization
This commit is contained in:
Clément DUNGLER 2020-05-11 17:15:58 +02:00 committed by GitHub
commit 890d8e177e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +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 {
@ -19,5 +19,30 @@ export const Emoji = () => (
);
Emoji.story = {
name: 'with emoji',
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',
};