2020-01-19 22:05:16 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { addDecorator, addParameters } from '@storybook/react';
|
|
|
|
import { withKnobs } from "@storybook/addon-knobs";
|
|
|
|
import { withThemePlayground } from 'storybook-addon-theme-playground';
|
|
|
|
import { ThemeProvider } from "styled-components";
|
|
|
|
|
|
|
|
import theme, { Theme } from '../client/theme';
|
|
|
|
|
|
|
|
addDecorator(withKnobs);
|
|
|
|
|
|
|
|
const themeConfigs = Object.values(Theme).map(
|
|
|
|
name => {
|
|
|
|
return { name, theme: theme[name] };
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
addDecorator(withThemePlayground({
|
|
|
|
theme: themeConfigs,
|
|
|
|
provider: ThemeProvider
|
|
|
|
}));
|
|
|
|
|
2020-04-19 17:13:24 +02:00
|
|
|
addParameters({
|
|
|
|
options: {
|
|
|
|
/**
|
|
|
|
* display the top-level grouping as a "root" in the sidebar
|
|
|
|
*/
|
|
|
|
showRoots: true,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2020-01-19 22:05:16 +01:00
|
|
|
// addDecorator(storyFn => <ThemeProvider theme={theme}>{storyFn()}</ThemeProvider>);
|