-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
77 lines (71 loc) · 2.45 KB
/
Copy pathindex.js
File metadata and controls
77 lines (71 loc) · 2.45 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import { registerRootComponent } from 'expo'
import { AppState, StatusBar } from 'react-native'
import { SafeAreaView, View, Text } from 'react-native'
import {
useFonts,
Montserrat_100Thin,
Montserrat_200ExtraLight,
Montserrat_300Light,
Montserrat_400Regular,
Montserrat_500Medium,
Montserrat_600SemiBold,
Montserrat_700Bold,
Montserrat_800ExtraBold,
Montserrat_900Black,
} from '@expo-google-fonts/montserrat'
import * as SplashScreen from 'expo-splash-screen'
import React, { useCallback, useEffect } from 'react'
import { AppProvider } from './FrameWork/Components/GlobalVariables'
import { Themes } from './FrameWork/Components/Themes'
import { Preloader } from './FrameWork/Components/Preloader'
import { supabase } from './FrameWork/Supabase/Supabase'
import NavigationStack from './FrameWork/Navigator/Navigator'
import * as Linking from 'expo-linking'
import { Provider, useDispatch, useSelector } from 'react-redux'
import store from './FrameWork/Components/redux/store'
// Prevent the splash screen from auto-hiding
SplashScreen.preventAutoHideAsync()
export default function App() {
const [fontsLoaded, fontError] = useFonts({
Montserrat_100Thin,
Montserrat_200ExtraLight,
Montserrat_300Light,
Montserrat_400Regular,
Montserrat_500Medium,
Montserrat_600SemiBold,
Montserrat_700Bold,
Montserrat_800ExtraBold,
Montserrat_900Black,
})
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded || fontError) {
// This tells the splash screen to hide immediately
await SplashScreen.hideAsync()
}
}, [fontsLoaded, fontError])
// If fonts are not loaded, return null
if (!fontsLoaded && !fontError) {
return null
}
return (
<Provider store={store}>
<AppProvider>
<SafeAreaView
style={{
flex: 1,
backgroundColor: Themes.colors.backgroundColor,
}}
onLayout={onLayoutRootView}
>
<StatusBar
backgroundColor={Themes.colors.backgroundColor}
barStyle="dark-content"
/>
<NavigationStack />
<Preloader />
</SafeAreaView>
</AppProvider>
</Provider>
)
}
registerRootComponent(App)