-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(client): initial sb6.2/builder-webpack5 migration
Migrate to storybook 6.2 beta with webpack 5 builder.
- Loading branch information
Showing
4 changed files
with
930 additions
and
1,118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import { addDecorator } from '@storybook/react' | ||
import centered from '@storybook/addon-centered/react' | ||
import { ComponentType } from 'react' | ||
import { withKnobs } from '@storybook/addon-knobs' | ||
import { ThemeProvider } from 'theme-ui' | ||
import theme from '../src/util/theme' | ||
|
||
if (process.env.NODE_ENV !== 'test') { | ||
addDecorator(withKnobs) | ||
addDecorator(story => <ThemeProvider theme={theme}>{story()}</ThemeProvider>) | ||
addDecorator(centered) | ||
export const decorators = | ||
process.env.NODE_ENV !== 'test' | ||
? [ | ||
withKnobs, | ||
(Story: ComponentType) => ( | ||
<ThemeProvider theme={theme}> | ||
<Story /> | ||
</ThemeProvider> | ||
), | ||
] | ||
: [] | ||
|
||
export const parameters = { | ||
layout: 'centered', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.