forked from aashishpanthi/FIFA-World-Cup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
74 lines (64 loc) · 2.12 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
import React, { useState } from "react";
// Screens
import Home from "./src/screens/Home.js";
import Chat from "./src/screens/Chat.js";
import ShowAll from "./src/screens/ShowAll.js";
// context
import Context from "./Context.js";
// external libraries
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { useFonts } from "expo-font";
import "react-native-gesture-handler";
export default function App() {
const [defaultScreen, setDefaultScreen] = useState("Home");
// creating the navigation stack
const Stack = createNativeStackNavigator();
// -----------------------------------------------------------
//------------------------------------------------------------
// using the custom fonts
const [loaded] = useFonts({
"poppins-r": require("./assets/fonts/Poppins-Regular.ttf"),
"poppins-b": require("./assets/fonts/Poppins-Bold.ttf"),
"poppins-eb": require("./assets/fonts/Poppins-ExtraBold.ttf"),
"poppins-l": require("./assets/fonts/Poppins-Light.ttf"),
"poppins-sb": require("./assets/fonts/Poppins-SemiBold.ttf"),
"poppins-t": require("./assets/fonts/Poppins-Thin.ttf"),
"poppins-m": require("./assets/fonts/Poppins-Medium.ttf"),
});
if (!loaded) return;
return (
<>
<Context>
<NavigationContainer>
<Stack.Navigator initialRouteName={defaultScreen}>
<Stack.Screen
name="Home"
component={Home}
options={{
headerShown: false,
animation: "none",
}}
/>
<Stack.Screen
name="Chat"
component={Chat}
options={{
headerShown: false,
animation: "none",
}}
/>
<Stack.Screen
name="ShowAll"
component={ShowAll}
options={{
headerShown: false,
animation: "none",
}}
/>
</Stack.Navigator>
</NavigationContainer>
</Context>
</>
);
}