-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
62 lines (56 loc) · 1.42 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
import {
useFonts,
IBMPlexSerif_100Thin,
IBMPlexSerif_200ExtraLight,
IBMPlexSerif_300Light,
IBMPlexSerif_400Regular,
IBMPlexSerif_500Medium,
IBMPlexSerif_600SemiBold,
IBMPlexSerif_700Bold,
} from "@expo-google-fonts/ibm-plex-serif";
import React, { useEffect, useRef } from "react";
import { StyleSheet, View, Animated } from "react-native";
import StackNavigator from "./src/Navigators/StackNavigator";
export default function App() {
const [fontsLoaded] = useFonts({
IBMPlexSerif_100Thin,
IBMPlexSerif_200ExtraLight,
IBMPlexSerif_300Light,
IBMPlexSerif_400Regular,
IBMPlexSerif_500Medium,
IBMPlexSerif_600SemiBold,
IBMPlexSerif_700Bold,
});
const scaleValue = useRef(new Animated.Value(10)).current;
useEffect(() => {
Animated.timing(scaleValue, {
toValue: 1,
duration: 700,
useNativeDriver: true,
}).start();
}, []);
if (!fontsLoaded) {
return (
<View style={styles.loadingContainer}>
<Animated.Image
source={require("./assets/splash.png")}
style={[styles.imageStyle, { transform: [{ scale: scaleValue }] }]}
/>
</View>
);
}
return <StackNavigator />;
}
const styles = StyleSheet.create({
loadingContainer: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#004F84",
},
imageStyle: {
width: 90,
height: 90,
resizeMode: "contain",
},
});