1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-10 21:30:06 +02:00

Merge pull request #236 from yldio/fix/ui-correct-fonts

Add injectGlobal to storybook config to fix fonts and wrap all compon…
This commit is contained in:
Judit Greskovits 2017-02-08 15:11:24 +00:00 committed by GitHub
commit 9c785150ba

View File

@ -1,6 +1,35 @@
const { configure } = require('@kadira/storybook');
const React = require('react');
const { configure, addDecorator } = require('@kadira/storybook');
const req = require.context('../src/components', true, /story.js$/)
const req = require.context('../src/components', true, /story.js$/);
const Styled = require('styled-components');
const Base = require('../src/components/base');
const {
injectGlobal
} = Styled;
class StyledDecorator extends React.Component {
componentWillMount() {
injectGlobal`
${Base.global}
`;
}
render() {
return (
<Base>
{this.props.children}
</Base>
)
}
}
addDecorator((story) => (
<StyledDecorator>
{story()}
</StyledDecorator>
));
function loadStories() {
let stories = req.keys();