-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
69 lines (60 loc) · 2.04 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
import React, { useCallback, useEffect, useRef, useState } from "react";
import { Text, View, StyleSheet, Dimensions } from "react-native";
import SplashScreen from "react-native-splash-screen";
import { useFonts } from "expo-font";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { NavigationContainer, useNavigation } from "@react-navigation/native";
import Navigation from "./router/Navigation";
import { useAppStore } from "./stores/store";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { StatusBar } from "expo-status-bar";
const windowHeight = Dimensions.get("window").height;
export default function App() {
const [appIsReady, setAppIsReady] = useState(false);
const store = useAppStore();
let [fontsLoaded] = useFonts({
"font-L": require("./assets/fonts/Pretendard-Light.ttf"),
"font-R": require("./assets/fonts/Pretendard-Regular.ttf"),
"font-M": require("./assets/fonts/Pretendard-Medium.ttf"),
"font-SM": require("./assets/fonts/Pretendard-SemiBold.ttf"),
"font-B": require("./assets/fonts/Pretendard-Bold.ttf"),
});
useEffect(() => {
try {
setTimeout(() => {
setAppIsReady(true);
SplashScreen.hide();
}, 2000); //스플래시 활성화 시간 2초
} catch (e) {
console.log(e.message);
}
}, []);
// const onLayoutRootView = useCallback(async () => {
// if (appIsReady) {
// SplashScreen.hide();
// }
// }, [appIsReady]);
// if (!appIsReady) {
// return (
// <View style={[styles.container, { backgroundColor: "#6D61FF" }]}>
// <StatusBar barStyle="auto" />
// </View>
// );
// }
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<NavigationContainer style={styles.container}>
<StatusBar barStyle="auto" />
<Navigation />
</NavigationContainer>
</GestureHandlerRootView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
minHeight: windowHeight,
},
});