Add an example for Storybook, will be removed later
[MAILPOET-2769]
This commit is contained in:
18
assets/js/src/storybook_demo/_stories/button.js
Normal file
18
assets/js/src/storybook_demo/_stories/button.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { Button } from '@storybook/react/demo';
|
||||
|
||||
export default {
|
||||
title: 'Button',
|
||||
component: Button,
|
||||
};
|
||||
|
||||
export const Text = () => <Button onClick={action('clicked')}>Hello Button</Button>;
|
||||
|
||||
export const Emoji = () => (
|
||||
<Button onClick={action('clicked')}>
|
||||
<span role="img" aria-label="so cool">
|
||||
😀 😎 👍 💯
|
||||
</span>
|
||||
</Button>
|
||||
);
|
14
assets/js/src/storybook_demo/_stories/welcome.js
Normal file
14
assets/js/src/storybook_demo/_stories/welcome.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import { linkTo } from '@storybook/addon-links';
|
||||
import { Welcome } from '@storybook/react/demo';
|
||||
|
||||
export default {
|
||||
title: 'Welcome',
|
||||
component: Welcome,
|
||||
};
|
||||
|
||||
export const ToStorybook = () => <Welcome showApp={linkTo('Button')} />;
|
||||
|
||||
ToStorybook.story = {
|
||||
name: 'to Storybook',
|
||||
};
|
Reference in New Issue
Block a user