accounts-frontend/.storybook/storyDecorator.tsx

21 lines
638 B
TypeScript
Raw Normal View History

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();
export default ((story) => {
2020-05-24 02:08:24 +03:00
const channel = addons.getChannel();
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>;