-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
219 lines (218 loc) · 6.66 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
import { StatusBar } from "expo-status-bar";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { Ionicons, MaterialIcons } from "@expo/vector-icons";
import Sos from "./screens/Sos";
import Complaint from "./screens/Complaint";
import Forum from "./screens/Forum";
import Home from "./screens/Home";
import Contribute from "./screens/Contribute";
import Adminer from "./screens/Admin";
import Login from "./screens/Login";
import Signup from "./screens/Signup";
import Profiler from "./screens/Profile";
import Announcement from "./screens/Announcement";
import TOS from "./screens/TOS";
import Privacy from "./screens/Privacy";
import StateWise from "./screens/admin_control/StateWise";
import ComplaintPosts from "./screens/admin_control/ComplaintPosts";
import AddAnnouncement from "./screens/admin_control/AddAnnouncement";
import Resource from "./screens/Resource";
import Request_Resource_Cat from "./screens/admin_control/Request_Resource_Cat";
import ResourceRequestsScreen from "./screens/admin_control/ResourceRequestsScreen";
import VerifyContributors from "./screens/admin_control/VerifyContributors";
import SosDetails from "./screens/SosDetails";
import Map from "./screens/Map";
import WaterState from "./Data";
const Tab = createBottomTabNavigator();
const Stack = createNativeStackNavigator();
const Stacker = () => {
return (
<Stack.Navigator
screenOptions={({ navigation }) => ({
headerTitleAlign: "center",
headerTitleStyle: {
fontWeight: "bold",
},
headerLeft: () => {
return (
<Ionicons
name="person"
onPress={() => {
navigation.navigate("Profile");
}}
size={32}
color="black"
style={{ marginRight: 5, marginTop: 5 }}
/>
);
},
})}
>
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Announcement" component={Announcement} />
<Stack.Screen name="Complaint" component={Complaint} />
<Stack.Screen name="Contribute" component={Contribute} />
</Stack.Navigator>
);
};
const Emergency = () => {
return (
<>
<Stack.Navigator initialRouteName="mainemergency">
<Stack.Screen
name="mainemergency"
component={Sos}
options={{ headerShown: false }}
/>
<Stack.Screen
name="SosDetails"
component={SosDetails}
options={{ headerShown: false }}
/>
</Stack.Navigator>
</>
);
};
const NormalUser = () => {
return (
<Tab.Navigator
screenOptions={({ navigation }) => ({
headerTitleAlign: "center",
headerTitleStyle: {
fontWeight: "bold",
},
headerLeft: () => {
return (
<Ionicons
name="person"
onPress={() => {
navigation.navigate("Profile");
}}
size={32}
color="black"
style={{ marginRight: 5, marginTop: 5 }}
/>
);
},
})}
>
<Tab.Screen
name="Stacker"
component={Stacker}
options={{
headerShown: false,
title: "Home",
tabBarIcon: ({ color, size }) => {
return <Ionicons name="home" color={color} size={size} />;
},
}}
/>
<Tab.Screen
name="HeatMap"
component={Map}
options={{
title: "HeatMap",
tabBarIcon: ({ color, size }) => {
return <Ionicons name="map" color={color} size={size} />;
},
}}
/>
<Tab.Screen
name="SOS"
component={Emergency}
options={{
title: "SOS",
tabBarIcon: ({ color, size }) => {
return <MaterialIcons name="dangerous" color={color} size={size} />;
},
}}
/>
<Tab.Screen
name="Resource"
component={Resource}
options={{
title: "Request Resource",
tabBarIcon: ({ color, size }) => {
return <Ionicons name="warning" color={color} size={size} />;
},
}}
/>
<Tab.Screen
name="CommunityForum"
component={Forum}
options={{
title: "Forum",
tabBarIcon: ({ color, size }) => {
return <MaterialIcons name="forum" color={color} size={size} />;
},
}}
/>
</Tab.Navigator>
);
};
const Profile = () => {
return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="main" component={Profiler} />
<Stack.Screen name="contribute" component={Contribute} />
<Stack.Screen name="tos" component={TOS} />
<Stack.Screen name="privacy" component={Privacy} />
</Stack.Navigator>
);
};
export default function App() {
return (
<>
<NavigationContainer>
<WaterState>
<StatusBar style="auto" />
<Stack.Navigator
// initialRouteName="adminmain"
screenOptions={{
headerTitleAlign: "center",
headerTitleStyle: {
fontWeight: "bold",
},
}}
>
<Stack.Screen
name="Login"
component={Login}
options={{
title: "JalSamadhan",
headerLeft: () => {
return <Ionicons name="add-circle" color="white"></Ionicons>;
},
}}
/>
<Stack.Screen
name="NormalUser"
component={NormalUser}
options={{ headerShown: false }}
/>
<Stack.Screen name="adminmain" component={Adminer} />
<Stack.Screen name="States" component={StateWise} />
<Stack.Screen name="ComplaintPosts" component={ComplaintPosts} />
<Stack.Screen name="AddAnnouncement" component={AddAnnouncement} />
<Stack.Screen
name="Request_Resource_Cat"
component={Request_Resource_Cat}
/>
<Stack.Screen
name="ResourceRequestsScreen"
component={ResourceRequestsScreen}
/>
<Stack.Screen name="Signup" component={Signup} />
<Stack.Screen name="Profile" component={Profile} />
<Stack.Screen
name="VerifyContributors"
component={VerifyContributors}
/>
</Stack.Navigator>
</WaterState>
</NavigationContainer>
</>
);
}