-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
36 lines (30 loc) · 1.09 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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { useState, useEffect } from 'react';
import DrawerContent from './screens/DrawerContent';
import HomeScreen from './screens/HomeScreen';
import Splash from './screens/Splash';
import SignInScreen from './screens/SignInScreen';
const Drawer = createDrawerNavigator();
function App() {
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
setTimeout(() => {
setIsLoading(false);
}, 1000)
}, [])
if (isLoading) {
return <Splash/>
}
return (
<NavigationContainer>
<Drawer.Navigator drawerContent={props => <DrawerContent {...props}/>}>
<Drawer.Screen name="Signin" component={SignInScreen} />
<Drawer.Screen name="HomeScreen" component={HomeScreen} />
<Drawer.Screen name="Splash" component={Splash} />
</Drawer.Navigator>
</NavigationContainer>
);
}
export default App;