This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Button.story.js
50 lines (46 loc) · 1.46 KB
/
Button.story.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React from 'react';
import {
storiesOf,
fullScreenHostDecorator,
} from 'react-native-hybrid-storybook';
import { action } from '@storybook/addon-actions';
import { text } from '@storybook/addon-knobs/react';
import Button from './Button';
storiesOf('Button', module)
.addWithChapters('Story with chapters', {
subtitle: 'Story subtitle',
info: 'Story info test **with formatting** ;)',
chapters: [
{
title: 'Chapter title',
subtitle: 'Chapter subtitle',
info: `
Let\'s render something!
\`\`\`
TEST
\`\`\`
`,
sections: [
{
title: 'Section title',
subtitle: 'Section subtitle',
info: 'Section info',
sectionFn: () => (
<Button
onClick={action('onClick')}
title={text('title', 'Test button')}
/>
),
}
]
}
]
});
storiesOf('Button', module)
.addDecorator(fullScreenHostDecorator)
.add('Example', () => (
<Button
onClick={action('onClick')}
title={text('title', 'Test button')}
/>
));