-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
130 lines (112 loc) · 4.85 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
import React, { useState, useEffect } from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import { SafeAreaView, StatusBar } from 'react-native';
import Toast from "react-native-toast-message";
import LoadingScreen from "./src/LoadingScreen";
import UsersList from "./src/functions/UsersList";
import LoginScreen from "./src/LoginScreen";
import Register from "./src/Register";
import HomeScreen from "./src/HomeScreen";
import Home from "./src/service_pages/Home";
import Agriculture from "./src/service_pages/Agriculture";
import Aware from "./src/service_pages/Aware";
import Counselling from "./src/service_pages/Classroom";
import Electronics from "./src/service_pages/Electronics";
import Others from "./src/service_pages/Others";
import Professional from "./src/service_pages/Professional";
import Vehicle from "./src/service_pages/Vehicle";
import Classroom from "./src/service_pages/Classroom";
import AboutUs from "./src/features/Aboutus";
import Budget from "./src/features/Budget";
import Contact from "./src/features/Contact";
import Reminders from "./src/features/Reminders";
import ToDoList from "./src/features/ToDoList";
import MyProfile from "./src/profile/MyProfile";
import UsersProfile from "./src/profile/UsersProfile";
import ShopProduct from "./src/service_pages/ShoppingPages/ShopProduct";
import EditProduct from "./src/service_pages/ShoppingPages/EditProduct";
import Shopping from "./src/service_pages/ShoppingPages/Shopping";
import ShoppingList from "./src/service_pages/ShoppingPages/ShoppingList";
import SellProduct from "./src/service_pages/ShoppingPages/SellProduct";
import MyProduct from "./src/service_pages/ShoppingPages/MyProduct";
const Stack = createStackNavigator();
const App = () => {
const [isAppReady, setIsAppReady] = useState(false);
useEffect(() => {
setTimeout(() => {
setIsAppReady(true);
}, 3000);
return () => {
};
}, []);
const capitalizeFirstLetter = (str) => {
return str.charAt(0).toUpperCase() + str.slice(1);
};
return (
<SafeAreaView style={{ flex: 1, backgroundColor: 'white' }}>
<StatusBar
backgroundColor="white"
barStyle="dark-content"
/>
<>
<NavigationContainer>
<Stack.Navigator>
{isAppReady ? (
<>
<Stack.Screen name="Login" component={LoginScreen} />
<Stack.Screen
name="HomeScreen"
component={HomeScreen}
options={{ headerShown: false }}
/>
<Stack.Screen name="Register" component={Register} />
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Agriculture" component={Agriculture} />
<Stack.Screen name="Aware" component={Aware} />
<Stack.Screen name="Counselling" component={Counselling} />
<Stack.Screen name="Electronics" component={Electronics} />
<Stack.Screen name="Others" component={Others} />
<Stack.Screen name="Professional" component={Professional} />
<Stack.Screen name="Vehicle" component={Vehicle} />
<Stack.Screen name="Classroom" component={Classroom} />
<Stack.Screen name="AboutUs" component={AboutUs} />
<Stack.Screen name="Budget" component={Budget} />
<Stack.Screen name="Contact" component={Contact} />
<Stack.Screen name="Reminders" component={Reminders} />
<Stack.Screen name="ToDoList" component={ToDoList} />
<Stack.Screen name="MyProfile" component={MyProfile} />
<Stack.Screen name="UsersProfile" component={UsersProfile} />
<Stack.Screen name="Shopping" component={Shopping} />
<Stack.Screen name="ShoppingList" component={ShoppingList} />
<Stack.Screen name="ShopProduct" component={ShopProduct} />
<Stack.Screen name="EditProduct" component={EditProduct} />
<Stack.Screen name="SellProduct" component={SellProduct} />
<Stack.Screen name="MyProduct" component={MyProduct} />
<Stack.Screen
name="UsersList"
component={UsersList}
options={({ route }) => ({
title:
route.params && route.params.skillSector
? `${capitalizeFirstLetter(route.params.skillSector)}`
: "Users List",
headerShown: true,
})}
/>
</>
) : (
<Stack.Screen
name="Loading"
component={LoadingScreen}
options={{ headerShown: false }}
/>
)}
</Stack.Navigator>
</NavigationContainer>
<Toast />
</>
</SafeAreaView>
);
};
export default App;