1 |
|
2 |
|
3 |
|
4 |
|
5 | import React from 'react';
|
6 | import { ThemeProvider } from 'styled-components';
|
7 |
|
8 | import 'sanitize.css/sanitize.css';
|
9 | import 'global-styles';
|
10 | import theme from 'themes/theme';
|
11 | import { configure, addDecorator } from '@storybook/react';
|
12 | import { withKnobs } from '@storybook/addon-knobs';
|
13 | import 'react-chromatic/storybook-addon';
|
14 |
|
15 | const req = require.context('../src/', true, /stories\.tsx$/);
|
16 |
|
17 | function loadStories() {
|
18 | return req.keys().forEach(req);
|
19 | }
|
20 |
|
21 | addDecorator(withKnobs);
|
22 | addDecorator(function(story) {
|
23 | return React.createElement(ThemeProvider, { theme }, story());
|
24 | });
|
25 |
|
26 | configure(loadStories, module);
|