/
index.story.jsx
42 lines (38 loc) · 1.32 KB
/
index.story.jsx
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
/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import { setOptions } from '@kadira/storybook-addon-options';
import { muiTheme } from 'storybook-addon-material-ui';
import Components from './ComponentsExample';
import Card from './CardExampleControlled';
const reqThemes = require.context('../.themes/', true, /.json/);
const themesList = [];
reqThemes.keys().forEach((filename) => {
themesList.push(reqThemes(filename));
});
storiesOf('Material-UI', module)
.storyDecorator((story) => {
const storyKind = story();
return (
<div style={{ display: 'flex', justifyContent: 'center' }}>
<div style={{ width: '60%', maxWidth: 1000, minWidth: 600 }} >
{storyKind}
</div>
</div>);
})
.storyDecorator(muiTheme(themesList))
.chapter('Themes')
.add('All components', () => {
setOptions({
name: 'storybook-addon material-ui',
url: 'https://github.com/sm-react/storybook-addon-material-ui',
goFullScreen: false,
downPanelInRight: false,
});
return <Components />;
})
.endOfChapter()
.chapter('Single examples')
.add('Card', () => (
<Card />
));