-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
51 lines (45 loc) · 1.11 KB
/
App.js
File metadata and controls
51 lines (45 loc) · 1.11 KB
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
import React, { useState, useEffect, useCallback } from 'react';
import { View, StyleSheet, SafeAreaView, Image } from 'react-native';
import { StatusBar } from 'expo-status-bar';
import 'react-native-gesture-handler';
import Routes from './src/routes';
export default function App() {
const [isReady, setIsReady] = useState(false);
useEffect(() => {
setIsReady(true);
}, []);
if (!isReady) {
return (
<>
<SafeAreaView style={styles.container}>
<StatusBar style="auto" />
<View style={styles.container2}>
<Image
source={require('./assets/splash.png')}
style={{ width: 350, height: 350 }}
/>
</View>
</SafeAreaView>
</>
);
} else {
return (
<SafeAreaView style={styles.container}>
<StatusBar style="auto" />
<Routes />
</SafeAreaView>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
container2: {
flex: 1,
backgroundColor: '#F8F8F2',
alignItems: 'center',
justifyContent: 'center',
},
});