accounts-frontend/.storybook/storyDecorator.tsx

21 lines
638 B
TypeScript
Raw Normal View History

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();
export default ((story) => {
2020-05-24 04:38:24 +05:30
const channel = addons.getChannel();
2020-05-24 04:38:24 +05:30
return (
<ContextProvider store={store} history={browserHistory}>
<IntlDecorator channel={channel}>{story()}</IntlDecorator>
</ContextProvider>
);
2020-01-20 13:21:37 +05:30
}) as DecoratorFunction<React.ReactElement>;