-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathApp.tsx
50 lines (47 loc) · 1.77 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
48
49
50
import { useState } from 'react'
import { StatusBar } from 'expo-status-bar'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { QueryClient, QueryClientProvider } from 'react-query'
import { StoreProvider } from 'easy-peasy'
import { MnemonicProvider } from './src/contexts/MnemonicContext'
import { AuthProvider } from './src/contexts/AuthProvider'
import useCachedResources from './src/hooks/useCachedResources'
import useColorScheme from './src/hooks/useColorScheme'
import Navigation from './src/navigation'
import store from './src/store'
import { Provider } from 'react-native-paper'
import { theme } from './src/theme'
import { IdentityServiceProvider } from './src/contexts/IdentityService'
import Toast from 'react-native-toast-message';
const queryClient = new QueryClient()
export default function App() {
const isLoadingComplete = useCachedResources()
const colorScheme = useColorScheme()
if (!isLoadingComplete) {
return null
} else {
return (
<StoreProvider store={store}>
<MnemonicProvider>
<IdentityServiceProvider>
<SafeAreaProvider>
<Provider theme={theme}>
<QueryClientProvider client={queryClient}>
<AuthProvider>
<Navigation colorScheme={colorScheme} />
</AuthProvider>
<StatusBar
style={colorScheme === 'dark' ? 'light' : 'dark'}
backgroundColor="transparent"
translucent={true}
/>
<Toast />
</QueryClientProvider>
</Provider>
</SafeAreaProvider>
</IdentityServiceProvider>
</MnemonicProvider>
</StoreProvider>
)
}
}