about summary refs log tree commit diff
path: root/storybook/config.js
blob: c81cfa2f7674312736cb349cd9884b18332742ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { configure, setAddon } from '@kadira/storybook';
import IntlAddon from 'react-storybook-addon-intl';
import React from 'react';
import { storiesOf, action } from '@kadira/storybook';
import { addLocaleData } from 'react-intl';
import en from 'react-intl/locale-data/en';
import '../app/javascript/styles/application.scss';
import './storybook.scss';

setAddon(IntlAddon);
addLocaleData(en);

let req = require.context('./stories/', true, /.story.js$/);

function loadStories () {
  req.keys().forEach((filename) => req(filename));
}

configure(loadStories, module);