-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
72 lines (67 loc) · 2.49 KB
/
App.js
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
import * as SplashScreen from 'expo-splash-screen'
import { useFonts } from 'expo-font'
import { NavigationContainer } from '@react-navigation/native'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import {
Walkthrough,
Verification,
ProfileAccount,
PhoneNumber,
PersonalChat,
} from './screens'
import { useCallback } from 'react'
import BottomTabNavigation from './navigation/BottomTabNavigation'
SplashScreen.preventAutoHideAsync()
const Stack = createNativeStackNavigator()
export default function App() {
// load fonts
const [fontsLoaded] = useFonts({
black: require('./assets/fonts/Mulish-Black.ttf'),
regular: require('./assets/fonts/Mulish-Regular.ttf'),
bold: require('./assets/fonts/Mulish-Bold.ttf'),
medium: require('./assets/fonts/Mulish-Medium.ttf'),
mediumItalic: require('./assets/fonts/Mulish-MediumItalic.ttf'),
semiBold: require('./assets/fonts/Mulish-SemiBold.ttf'),
semiBoldItalic: require('./assets/fonts/Mulish-SemiBoldItalic.ttf'),
})
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded) {
await SplashScreen.hideAsync()
}
}, [fontsLoaded])
if (!fontsLoaded) {
return null
}
return (
<SafeAreaProvider onLayout={onLayoutRootView}>
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerShown: false,
}}
initialRouteName="Walkthrough"
>
<Stack.Screen
name="BottomTabNavigation"
component={BottomTabNavigation}
/>
<Stack.Screen name="Walkthrough" component={Walkthrough} />
<Stack.Screen
name="Verification"
component={Verification}
/>
<Stack.Screen
name="ProfileAccount"
component={ProfileAccount}
/>
<Stack.Screen name="PhoneNumber" component={PhoneNumber} />
<Stack.Screen
name="PersonalChat"
component={PersonalChat}
/>
</Stack.Navigator>
</NavigationContainer>
</SafeAreaProvider>
)
}