-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.tsx
63 lines (57 loc) · 1.28 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
51
52
53
54
55
56
57
58
59
60
61
62
63
import 'react-native-get-random-values'
import { Buffer } from 'buffer'
global.Buffer = Buffer
import 'react-native-url-polyfill/auto'
import 'react-native-gesture-handler'
import '@/lib/i18n'
import { useDeviceContext } from 'twrnc'
import tw from '@/lib/tailwind'
import { useFonts } from 'expo-font'
import {
Inter_300Light,
Inter_400Regular,
Inter_500Medium,
Inter_700Bold,
} from '@expo-google-fonts/inter'
import AppLoading from '@/components/loading/AppLoading'
import { Suspense } from 'react'
import { RecoilRoot } from 'recoil'
import { MenuProvider } from 'react-native-popup-menu'
import Toast from 'react-native-toast-message'
import { toastConfig } from '@/lib/toast'
import Routes from '@/routes/Routes'
export default function App() {
useDeviceContext(tw)
const [fontsLoaded] = useFonts({
Inter_300Light,
Inter_400Regular,
Inter_500Medium,
Inter_700Bold,
})
if (!fontsLoaded) {
return (
<>
<AppLoading />
</>
)
}
return (
<>
<Suspense fallback={<AppLoading />}>
<RecoilRoot>
<SkeetApp />
</RecoilRoot>
</Suspense>
</>
)
}
function SkeetApp() {
return (
<>
<MenuProvider>
<Routes />
<Toast config={toastConfig} />
</MenuProvider>
</>
)
}