1234567891011121314151617181920212223 |
- import React from 'react';
- import { configure, setAddon, addDecorator } from '@storybook/react';
- import infoAddon from '@storybook/addon-info';
- import { ThemeProvider } from 'styled-components';
- import constants from 'utils/constants';
- import { GlobalStyle, getTheme, loadSvgIcons } from 'styles';
- import 'styles/animate.css';
- const { DEFAULT_THEME } = constants;
- const theme = getTheme(DEFAULT_THEME);
- loadSvgIcons();
- addDecorator(story => (
- <GlobalStyle theme={theme}>
- <ThemeProvider theme={theme}>{story()}</ThemeProvider>
- </GlobalStyle>
- ));
- setAddon(infoAddon);
- const loadStories = dir => {
- const req = require.context('../src/components', true, /\.story\.jsx$/);
- req.keys().forEach(filename => req(filename));
- };
- configure(loadStories, module);
|