2019-12-09 09:47:51 +02:00
|
|
|
import React from 'react';
|
2020-01-20 09:51:37 +02:00
|
|
|
import addons, { DecoratorFunction } from '@storybook/addons';
|
2019-12-09 09:47:51 +02:00
|
|
|
import { ContextProvider } from 'app/shell';
|
|
|
|
import { browserHistory } from 'app/services/history';
|
|
|
|
import storeFactory from 'app/storeFactory';
|
2020-01-20 09:51:37 +02:00
|
|
|
import 'app/index.scss';
|
|
|
|
|
|
|
|
import { IntlDecorator } from './decorators';
|
2019-12-09 09:47:51 +02:00
|
|
|
|
|
|
|
const store = storeFactory();
|
|
|
|
|
2020-05-20 19:35:52 +03:00
|
|
|
export default ((story) => {
|
2020-05-24 02:08:24 +03:00
|
|
|
const channel = addons.getChannel();
|
2020-01-15 22:15:04 +03:00
|
|
|
|
2020-05-24 02:08:24 +03:00
|
|
|
return (
|
|
|
|
<ContextProvider store={store} history={browserHistory}>
|
|
|
|
<IntlDecorator channel={channel}>{story()}</IntlDecorator>
|
|
|
|
</ContextProvider>
|
|
|
|
);
|
2020-01-20 09:51:37 +02:00
|
|
|
}) as DecoratorFunction<React.ReactElement>;
|