-
Notifications
You must be signed in to change notification settings - Fork 970
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make storybook configurable in a redwood app (#1828)
* feat: grab user's storybook config * style: revert prettier formatting * Update packages/internal/src/paths.ts Co-authored-by: Peter Pistorius <peter.pistorius@gmail.com> * fix: propagate the rename Co-authored-by: Peter Pistorius <peter.pistorius@gmail.com> Co-authored-by: Daniel Choudhury <dannychoudhury@gmail.com>
- Loading branch information
1 parent
148aa46
commit 751d342
Showing
3 changed files
with
32 additions
and
13 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,15 +1,16 @@ | ||
const React = require('react') | ||
|
||
const { addDecorator } = require('@storybook/react') | ||
|
||
// The StorybookLoader is responsible for importing all the mock files, | ||
// The StorybookProvider is responsible for importing all the mock files, | ||
// booting up the mock server workers, and mocking the router. | ||
const { StorybookProvider } = require('@redwoodjs/core/dist/storybook/StorybookProvider') | ||
const { | ||
StorybookProvider, | ||
} = require('@redwoodjs/core/dist/storybook/StorybookProvider') | ||
|
||
// Import the user's default CSS file | ||
require('~__REDWOOD__USER_WEB_DEFAULT_CSS') | ||
|
||
addDecorator( | ||
(storyFn, { id }) => { | ||
return React.createElement(StorybookProvider, { storyFn, id }) | ||
} | ||
) | ||
addDecorator((storyFn, { id }) => { | ||
return React.createElement(StorybookProvider, { storyFn, id }) | ||
}) |
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