-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
140 lines (137 loc) · 4.63 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import React, { useEffect } from "react";
import { Router, Scene, Actions, Lightbox, ActionConst } from "react-native-router-flux";
import LoginScreen from "./screens/LoginScreen";
import SignupScreen from "./screens/SignupScreen";
import LoadingScreen from "./screens/LoadingScreen";
import UsingScreen from "./screens/UsingScreen";
import RespondingScreen from "./screens/RespondingScreen";
import AlarmScreen from "./screens/AlarmScreen";
import SnoozeScreen from "./screens/SnoozeScreen";
import ProfileScreen from "./screens/ProfileScreen";
import ResourceScreen from "./screens/ResourceScreen";
import MyRespondersScreen from "./screens/MyRespondersScreen";
import LocationScreen from "./screens/LocationScreen";
import AddRespondersScreen from "./screens/AddRespondersScreen";
import RemoveRespondersScreen from "./screens/RemoveRespondersScreen";
import ResponderHelpRequestModal from "./screens/modals/ResponderHelpRequestModal";
import DirectionsScreen from "./screens/DirectionsScreen";
import DrawerContent from "./components/drawer/DrawerContent";
import Modal from "./components/popups/Modal";
import Alert from "./components/popups/Alert";
import { Provider } from "react-redux";
import { store } from "./store/store";
import { setupInterceptors } from "./services/axios";
import { registerLocationTask } from "./services/task-manager";
// Task manager needs to be defined in the global scope
registerLocationTask();
export default function App() {
useEffect(() => {
console.log("use effect App.js");
setupInterceptors();
});
return (
<Provider store={store}>
<Router>
<Lightbox>
<Scene key="root">
<Scene
key="loading"
component={LoadingScreen}
title="Loading"
hideNavBar
initial
/>
<Scene key="auth" type={ActionConst.REPLACE} hideNavBar>
<Scene key="login" component={LoginScreen} title="Login" />
<Scene key="signup" component={SignupScreen} title="Signup" />
</Scene>
<Scene
key="main"
drawer
type={ActionConst.REPLACE}
hideNavBar
contentComponent={DrawerContent}
headerMode="none"
>
<Scene key="using" component={UsingScreen} title="Using" initial />
<Scene
key="responding"
component={RespondingScreen}
title="Responding"
/>
<Scene key="profile"
component={ProfileScreen}
title="Profile"
/>
<Scene key="resource"
component={ResourceScreen}
title="Resource"
/>
</Scene>
<Scene key="location" hideNavBar>
<Scene key="location"
component={LocationScreen}
title="Location"
/>
</Scene>
<Scene key="alarm" type={ActionConst.REPLACE} hideNavBar>
<Scene
key="start"
component={AlarmScreen}
title="Alarm Start"
type={ActionConst.REPLACE}
initial
/>
<Scene
key="snooze"
component={SnoozeScreen}
title="Snooze"
type={ActionConst.REPLACE}
/>
</Scene>
<Scene key="responders" hideNavBar>
<Scene
key="list"
component={MyRespondersScreen}
title="My Responders"
initial
/>
<Scene
key="add"
component={AddRespondersScreen}
title="Add Responders"
/>
<Scene
key="remove"
component={RemoveRespondersScreen}
title="Remove Responders"
/>
</Scene>
<Scene key="assignment" type={ActionConst.REPLACE} hideNavBar>
<Scene key="directions"
component={DirectionsScreen}
title="Directions"
initial
/>
</Scene>
</Scene>
<Scene
key="responderHelpRequestModal"
component={ResponderHelpRequestModal}
hideNavBar
/>
<Scene
key="modal"
component={Modal}
hideNavBar
/>
<Scene
key="alert"
component={Alert}
hideNavBar
/>
</Lightbox>
</Router>
</Provider>
);
}