-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
67 lines (62 loc) · 2.3 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
64
65
66
67
import React, { useEffect, useState } from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import { RootStackParamList } from "./src/types/RootStackParamList";
import StartScreen from "./src/screens/Start";
import OnboardingScreen from "./src/screens/Onboarding";
import SelectScreen from "./src/screens/Select";
import LocalScreen from "./src/screens/Local";
import TravelScreen from "./src/screens/Travel";
import ItemsScreen from "./src/screens/Items";
import MainScreen from "./src/screens/Main";
import { RecoilRoot } from "recoil";
import { loadAsync } from "expo-font";
import LoadingScreen from "./src/screens/Loading";
const RootStack = createStackNavigator<RootStackParamList>();
const App = () => {
useEffect(() => {
async function fetchFont() {
await loadAsync({
"NotoSansKR-Bold": require("./src/assets/fonts/NotoSansKR-Bold.otf"),
"NotoSansKR-Medium": require("./src/assets/fonts/NotoSansKR-Medium.otf"),
"NotoSansKR-Regular": require("./src/assets/fonts/NotoSansKR-Regular.otf"),
"Inter-Medium": require("./src/assets/fonts/Inter-Medium.ttf"),
});
}
fetchFont();
}, []);
const [Loading, setLoading] = useState(true);
useEffect(() => {
const pageLoading = async () => {
setTimeout(() => {
setLoading(false);
}, 2500);
};
pageLoading();
});
return (
<>
{Loading ? (
<LoadingScreen />
) : (
<RecoilRoot>
<NavigationContainer>
<RootStack.Navigator screenOptions={{ headerShown: false }}>
{/* <RootStack.Screen
name="Onboarding"
component={OnboardingScreen}
/> */}
<RootStack.Screen name="Start" component={StartScreen} />
<RootStack.Screen name="Select" component={SelectScreen} />
<RootStack.Screen name="Local" component={LocalScreen} />
<RootStack.Screen name="Travel" component={TravelScreen} />
<RootStack.Screen name="Items" component={ItemsScreen} />
<RootStack.Screen name="Main" component={MainScreen} />
</RootStack.Navigator>
</NavigationContainer>
</RecoilRoot>
)}
</>
);
};
export default App;