-
Notifications
You must be signed in to change notification settings - Fork 36
/
App.tsx
47 lines (41 loc) · 1.42 KB
/
App.tsx
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
import 'react-native-gesture-handler'
import 'crypto'
import React, { useRef } from 'react'
import { Platform, UIManager } from 'react-native'
import { Provider } from 'react-redux'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { I18nextProvider } from 'react-i18next'
import RootNavigation from '~/RootNavigation'
import ErrorBoundary from '~/errors/ErrorBoundary'
import { AgentContextProvider } from '~/utils/sdk/context'
import configureStore from './configureStore'
import Overlays from '~/Overlays'
import { NavigationContainerRef } from '@react-navigation/native'
import { i18n } from '~/translations'
import { ErrorContextProvider } from '~/errors/errorContext'
const store = configureStore()
if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true)
}
}
const App = () => {
const navRef = useRef<NavigationContainerRef>(null)
return (
<SafeAreaProvider>
<Provider store={store}>
<I18nextProvider i18n={i18n}>
<ErrorContextProvider>
<ErrorBoundary>
<AgentContextProvider>
<Overlays navRef={navRef} />
<RootNavigation ref={navRef} />
</AgentContextProvider>
</ErrorBoundary>
</ErrorContextProvider>
</I18nextProvider>
</Provider>
</SafeAreaProvider>
)
}
export default App