-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.tsx
139 lines (129 loc) · 4.46 KB
/
App.tsx
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
const Stack = createNativeStackNavigator();
import * as React from "react";
import { NavigationContainer } from "@react-navigation/native";
import Setting from "./screens/Setting";
import PlantMoreInfo from "./screens/PlantMoreInfo";
import PlantDetails from "./screens/PlantDetails";
import PlantStatusPage from "./screens/PlantStatusPage";
import AddPlantPage3 from "./screens/AddPlantPage3";
import AddPlantPage2 from "./screens/AddPlantPage2";
import AddPlantPage1 from "./screens/AddPlantPage1";
import HomePage from "./screens/HomePage";
import ManualChooseSchedule from "./screens/ManualChooseSchedule";
import Schedulemethod from "./screens/Schedulemethod";
import Geolocation1 from "./screens/Geolocation1";
import WelcomeScreen from "./screens/WelcomeScreen";
import Notifications from "./screens/Notifications";
import Hometab1 from "./components/Hometab1";
import Hometab from "./components/Hometab";
import Statustab1 from "./components/Statustab1";
import Statustab from "./components/Statustab";
import BottomTabsRoot from "./components/BottomTabsRoot";
import MIcon from "react-native-vector-icons/MaterialCommunityIcons";
import { IconRegistry, ApplicationProvider } from "@ui-kitten/components";
import * as eva from "@eva-design/eva";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import {
View,
Text,
Pressable,
TouchableOpacity,
StyleSheet,
} from "react-native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
const App = () => {
const [hideSplashScreen, setHideSplashScreen] = React.useState(true);
function MaterialIcon({ name, style }) {
const { height, tintColor, ...iconStyle } = StyleSheet.flatten(style);
return (
<MIcon name={name} size={height} color={tintColor} style={iconStyle} />
);
}
const IconProvider = (name) => ({
toReactElement: (props) => MaterialIcon({ name, ...props }),
});
function createIconsMap() {
return new Proxy(
{},
{
get(target, name) {
return IconProvider(name);
},
}
);
}
const MaterialIconsPack = {
name: "material",
icons: createIconsMap(),
};
return (
<>
<IconRegistry icons={[MaterialIconsPack]} />
<ApplicationProvider {...eva} theme={eva.light}>
<NavigationContainer>
{hideSplashScreen ? (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="BottomTabsRoot" component={BottomTabsRoot} />
<Stack.Screen
name="Setting"
component={Setting}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Notifications"
component={Notifications}
options={{ headerShown: false }}
/>
<Stack.Screen
name="PlantMoreInfo"
component={PlantMoreInfo}
options={{ headerShown: false }}
/>
<Stack.Screen
name="PlantDetails"
component={PlantDetails}
options={{ headerShown: false }}
/>
<Stack.Screen
name="AddPlantPage3"
component={AddPlantPage3}
options={{ headerShown: false }}
/>
<Stack.Screen
name="AddPlantPage2"
component={AddPlantPage2}
options={{ headerShown: false }}
/>
<Stack.Screen
name="AddPlantPage1"
component={AddPlantPage1}
options={{ headerShown: false }}
/>
<Stack.Screen
name="ManualChooseSchedule"
component={ManualChooseSchedule}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Schedulemethod"
component={Schedulemethod}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Geolocation"
component={Geolocation1}
options={{ headerShown: false }}
/>
<Stack.Screen
name="WelcomeScreen"
component={WelcomeScreen}
options={{ headerShown: false }}
/>
</Stack.Navigator>
) : null}
</NavigationContainer>
</ApplicationProvider>
</>
);
};
export default App;