-
Notifications
You must be signed in to change notification settings - Fork 46
/
Root.jsx
56 lines (49 loc) · 1.3 KB
/
Root.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from 'react'
import { Provider } from 'react-redux'
import { ConnectedRouter } from 'react-router-redux'
import ReduxToastr from 'react-redux-toastr'
import { I18nextProvider } from 'react-i18next'
import { i18nInitialized, languageChanged, namespaceLoaded } from 'Actions/i18n'
import i18n from './i18n'
import App from 'Components/App'
import store from './store'
import history from './history'
import ReactGA from 'react-ga'
ReactGA.initialize('UA-100689193-1')
ReactGA.set({
dimension1: 'faast'
})
if (!window.faast) window.faast = {}
window.faast.intervals = {
orderStatus: [],
txReceipt: []
}
const Root = () => {
i18n.on('languageChanged', (lng) => {
store.dispatch(languageChanged(lng))
})
i18n.on('loaded', (loaded) => {
store.dispatch(namespaceLoaded(loaded))
})
i18n.on('initialized', (info) => {
store.dispatch(i18nInitialized(info))
})
return (
<I18nextProvider i18n={i18n}>
<Provider store={store}>
<ConnectedRouter history={history}>
<div>
<App/>
<ReduxToastr
timeOut={4000}
newestOnTop={false}
preventDuplicates
position='top-right'
/>
</div>
</ConnectedRouter>
</Provider>
</I18nextProvider>
)
}
export default Root