2020-07-06 21:59:56 +05:30
|
|
|
import React, { ComponentType } from 'react';
|
2019-12-09 12:37:07 +05:30
|
|
|
import { Provider as ReduxProvider } from 'react-redux';
|
|
|
|
import { Router } from 'react-router-dom';
|
2019-12-30 12:59:39 +05:30
|
|
|
import { HelmetProvider } from 'react-helmet-async';
|
2020-07-06 21:59:56 +05:30
|
|
|
import { History } from 'history';
|
|
|
|
|
2019-12-09 12:37:07 +05:30
|
|
|
import { IntlProvider } from 'app/components/i18n';
|
|
|
|
import { Store } from 'app/reducers';
|
|
|
|
|
2020-07-06 21:59:56 +05:30
|
|
|
interface Props {
|
|
|
|
children: React.ReactNode;
|
|
|
|
store: Store;
|
|
|
|
history: History;
|
2019-12-09 12:37:07 +05:30
|
|
|
}
|
|
|
|
|
2020-07-06 21:59:56 +05:30
|
|
|
const ContextProvider: ComponentType<Props> = ({ children, store, history }) => (
|
|
|
|
<HelmetProvider>
|
|
|
|
<ReduxProvider store={store}>
|
|
|
|
<IntlProvider>
|
|
|
|
<Router history={history}>{children}</Router>
|
|
|
|
</IntlProvider>
|
|
|
|
</ReduxProvider>
|
|
|
|
</HelmetProvider>
|
|
|
|
);
|
|
|
|
|
2019-12-09 12:37:07 +05:30
|
|
|
export default ContextProvider;
|