-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
112 lines (105 loc) · 3.18 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import * as SplashScreen from 'expo-splash-screen';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from "@react-navigation/native-stack"
// import { Login, Signup, Welcome } from "./screens";
import { useFonts } from 'expo-font';
import { useCallback } from 'react';
import Login from './src/screens/auth/Login';
import Welcome from './src/screens/home/Welcome'
import { SafeAreaProvider } from 'react-native-safe-area-context';
import AddProfile from './src/screens/home/AddProfile';
import BottomTabNavigation from './src/navigation/BottomTabNavigator';
import { AddContact, Contact, PersonalChat, Profile, VoiceCall } from './src/screens';
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'),
meediumItalic: 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
initialRouteName='Welcome'
>
<Stack.Screen name='BottomTabNavigation' component={BottomTabNavigation}
options={{
headerShown: false
}}
/>
<Stack.Screen
name="Welcome"
component={Welcome}
options={{
headerShown: false
}}
/>
<Stack.Screen
name="Login"
component={Login}
options={{
headerShown: false
}}
/>
<Stack.Screen
name="AddProfile"
component={AddProfile}
options={{
headerShown: false
}}
/>
<Stack.Screen
name="Profile"
component={Profile}
options={{
headerShown: false
}}
/>
<Stack.Screen
name="PersonalChat"
component={PersonalChat}
options={{
headerShown: false
}}
/>
<Stack.Screen
name="Contact"
component={Contact}
options={{
headerShown: false
}}
/>
<Stack.Screen
name="AddContact"
component={AddContact}
options={{
headerShown: false
}}
/>
<Stack.Screen
name="VoiceCall"
component={VoiceCall}
options={{
headerShown: false
}}
/>
</Stack.Navigator>
</NavigationContainer>
</SafeAreaProvider>
);
}