generated from wednesday-solutions/react-template
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
1,299 additions
and
724 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import { configure } from '@storybook/react'; | ||
import { addDecorator } from '@storybook/react'; | ||
import { withKnobs } from '@storybook/addon-knobs'; | ||
import StoryRouter from 'storybook-router'; | ||
import { withSmartKnobs } from 'storybook-addon-smart-knobs'; | ||
import { setIntlConfig, withIntl } from 'storybook-addon-intl'; | ||
import { translationMessages, appLocales, DEFAULT_LOCALE } from '../app/i18n.ts'; | ||
|
||
Object.values = (obj) => Object.keys(obj).map((key) => obj[key]); | ||
|
||
addDecorator(withKnobs); | ||
addDecorator(withSmartKnobs); | ||
addDecorator(StoryRouter()); | ||
|
||
const getMessages = (locale) => translationMessages[locale]; | ||
setIntlConfig({ | ||
locales: appLocales, | ||
defaultLocale: DEFAULT_LOCALE, | ||
getMessages | ||
}); | ||
|
||
addDecorator(withIntl); | ||
|
||
// automatically import all files ending in *.stories.js | ||
function requireAll(requireContext) { | ||
return requireContext.keys().map((key) => { | ||
return requireContext; | ||
}); | ||
} | ||
|
||
function loadStories() { | ||
const req = require.context('../app/components/', true, /^.*\.stories$/); | ||
return requireAll(req); | ||
} | ||
configure(loadStories(), module); |
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
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
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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.