2019-12-09 13:17:51 +05:30
|
|
|
import React from 'react';
|
2020-01-20 13:21:37 +05:30
|
|
|
import addons, { DecoratorFunction } from '@storybook/addons';
|
2019-12-09 13:17:51 +05:30
|
|
|
import { ContextProvider } from 'app/shell';
|
|
|
|
import { browserHistory } from 'app/services/history';
|
|
|
|
import storeFactory from 'app/storeFactory';
|
2020-01-20 13:21:37 +05:30
|
|
|
import 'app/index.scss';
|
|
|
|
|
|
|
|
import { IntlDecorator } from './decorators';
|
2019-12-09 13:17:51 +05:30
|
|
|
|
|
|
|
const store = storeFactory();
|
|
|
|
|
2020-01-20 13:21:37 +05:30
|
|
|
export default (story => {
|
|
|
|
const channel = addons.getChannel();
|
2020-01-16 00:45:04 +05:30
|
|
|
|
2020-01-20 13:21:37 +05:30
|
|
|
return (
|
|
|
|
<ContextProvider store={store} history={browserHistory}>
|
|
|
|
<IntlDecorator channel={channel}>{story()}</IntlDecorator>
|
|
|
|
</ContextProvider>
|
|
|
|
);
|
|
|
|
}) as DecoratorFunction<React.ReactElement>;
|