-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
45 lines (37 loc) · 1.25 KB
/
App.tsx
File metadata and controls
45 lines (37 loc) · 1.25 KB
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
import React, { useEffect } from 'react'
import { StatusBar, useColorScheme, LogBox } from 'react-native'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import Toast from 'react-native-toast-message'
import { ThemeProvider } from 'styled-components'
import { SWRConfig } from 'swr'
import { toastConfig } from './src/components/toast'
import { WalletProvider } from './src/contexts/wallet'
import { cacheProvider, populateCache } from './src/database/cache/provider'
import Routes from './src/routes'
import theme from './src/theme'
function App(): React.JSX.Element {
const scheme = useColorScheme()
useEffect(populateCache, [])
if (!scheme) {
return <></>
}
const colors = theme[scheme]
return (
<SafeAreaProvider>
<StatusBar
backgroundColor={colors.background}
barStyle={scheme === 'dark' ? 'light-content' : 'dark-content'}
/>
<ThemeProvider theme={theme[scheme]}>
<WalletProvider>
<SWRConfig value={{ provider: cacheProvider }}>
<Routes />
</SWRConfig>
</WalletProvider>
</ThemeProvider>
<Toast position='bottom' config={toastConfig(scheme)} bottomOffset={120} />
</SafeAreaProvider>
)
}
LogBox.ignoreLogs(['Non-serializable values were found in the navigation state'])
export default App