-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
68 lines (61 loc) · 1.68 KB
/
App.js
File metadata and controls
68 lines (61 loc) · 1.68 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import React, { useState } from "react";
import { createAppContainer } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
import { createDrawerNavigator } from "react-navigation-drawer";
import AppLoading from "expo-app-loading";
import DrawerPanel from "./src/screens/DrawerPanel";
import Home from "./src/screens/Home";
import Login from "./src/screens/Login";
import Profile from "./src/screens/Profile";
import Signup from "./src/screens/Signup";
import Splash from "./src/screens/Splash";
const DrawerNavigation = createDrawerNavigator({
DrawerPanel: DrawerPanel,
Home: Home,
Login: Login,
Profile: Profile,
Signup: Signup,
Splash: Splash
});
const StackNavigation = createStackNavigator(
{
DrawerNavigation: {
screen: DrawerNavigation
},
DrawerPanel: DrawerPanel,
Home: Home,
Login: Login,
Profile: Profile,
Signup: Signup,
Splash: Splash
},
{
headerMode: "none"
}
);
const AppContainer = createAppContainer(StackNavigation);
function App() {
const [isLoadingComplete, setLoadingComplete] = useState(false);
if (!isLoadingComplete) {
return (
<AppLoading
startAsync={loadResourcesAsync}
onError={handleLoadingError}
onFinish={() => handleFinishLoading(setLoadingComplete)}
/>
);
} else {
return isLoadingComplete ? <AppContainer /> : <AppLoading />;
}
}
async function loadResourcesAsync() {
// await Promise.all([Font.loadAsync({})]);
}
function handleLoadingError(error) {
console.warn(error);
}
function handleFinishLoading(setLoadingComplete) {
console.log('loading finished'.repeat(50));
setLoadingComplete(true);
}
export default App;