meriadec
7 years ago
1 changed files with 12 additions and 1 deletions
@ -1,8 +1,19 @@ |
|||||
import { configure } from '@storybook/react' |
import React from 'react' |
||||
|
import { configure, addDecorator } from '@storybook/react' |
||||
|
import { ThemeProvider } from 'styled-components' |
||||
|
|
||||
|
import 'styles/global' |
||||
|
import theme from 'styles/theme' |
||||
|
|
||||
const req = require.context('../src', true, /.stories.js$/) |
const req = require.context('../src', true, /.stories.js$/) |
||||
function loadStories() { |
function loadStories() { |
||||
req.keys().forEach(filename => req(filename)) |
req.keys().forEach(filename => req(filename)) |
||||
} |
} |
||||
|
|
||||
|
addDecorator(story => ( |
||||
|
<ThemeProvider theme={theme}> |
||||
|
<div style={{ padding: 20 }}>{story()}</div> |
||||
|
</ThemeProvider> |
||||
|
)) |
||||
|
|
||||
configure(loadStories, module) |
configure(loadStories, module) |
||||
|
Loading…
Reference in new issue