-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
93 lines (86 loc) · 3.54 KB
/
Copy pathApp.js
File metadata and controls
93 lines (86 loc) · 3.54 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
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
import React from "react";
import { View } from "react-native";
import { createStackNavigator, createAppContainer, createSwitchNavigator, createMaterialTopTabNavigator } from "react-navigation";
import createAnimatedSwitchNavigator from "react-navigation-animated-switch";
import { Icon } from "react-native-elements";
import HomeScreen from "./src/screens/HomeScreen";
import LoadingScreen from "./src/screens/LoadingScreen";
import LoginScreen from "./src/screens/LoginScreen";
import RegisterScreen from "./src/screens/RegisterScreen";
import ItemsScreen from "./src/screens/ItemsScreen";
import ProfileScreen from "./src/screens/ProfileScreen";
import ResetPassScreen from "./src/screens/ResetPassScreen";
import ItemScreen from "./src/screens/ItemScreen";
import AddItemScreen from "./src/screens/AddItemScreen";
import EmailVerificationScreen from "./src/screens/EmailVerificationScreen";
import AdminControlPanelScreen from "./src/screens/AdminControlPanelScreen";
import UserPanelScreen from "./src/screens/UserPanelScreen";
import ItemEditScreen from "./src/screens/ItemEditScreen";
import "./src/fixTimerBug";
const LoginRegisterStack = createStackNavigator({ Login: { screen: LoginScreen }, Register: { screen: RegisterScreen }, ResetPass: { screen: ResetPassScreen }, EmailVerification: { screen: EmailVerificationScreen }}, { initialRouteName: "Login" });
const AuthLoadingStack = createStackNavigator({ Loading: { screen: LoadingScreen } });
const AuthSwitch = createSwitchNavigator({ LoginRegister: { screen: LoginRegisterStack }, Loading: { screen: AuthLoadingStack } }, { initialRouteName: "Loading" })
const HomeStack = createStackNavigator({Home: { screen: HomeScreen }});
const ItemsStack = createStackNavigator({Items: { screen: ItemsScreen }, Item: { screen: ItemScreen }, AddItem: { screen: AddItemScreen }, EditItem: { screen: ItemEditScreen } }, { initialRouteName: "Items" });
const AdminControlPanelStack = createStackNavigator({ AdminControlPanel: { screen: AdminControlPanelScreen }, UserPanel: { screen: UserPanelScreen } }, { initialRouteName: "AdminControlPanel", navigationOptions: { header: null } });
const ProfileStack = createStackNavigator({Profile: { screen: ProfileScreen }, ResetPassProfile: { screen: ResetPassScreen }, AdminControlPanel: { screen: AdminControlPanelStack }}, { initialRouteName: "Profile" });
const AppTabs = createMaterialTopTabNavigator(
{
Home: {
screen: HomeStack,
navigationOptions: {
tabBarIcon: ({ tintColor }) => (
<View>
<Icon color={tintColor} type="material" name="home" />
</View>
)
}
},
Items: {
screen: ItemsStack,
navigationOptions: {
tabBarIcon: ({ tintColor }) => (
<View>
<Icon color={tintColor} type="material" name="toc" />
</View>
)
}
},
Profile: {
screen: ProfileStack,
navigationOptions: {
tabBarIcon: ({ tintColor }) => (
<View>
<Icon color={tintColor} type="material" name="person" />
</View>
)
}
}
},
{
initialRouteName: "Home",
barStyle: { backgroundColor: "#076c91" },
tabBarPosition: "bottom",
swipeEnabled: true,
animationEnabled: true,
tabBarOptions: {
activeTintColor: "#eee",
inactiveTintColor: "#222",
showIcon: true,
tabStyle: {
marginBottom: -15
}
}
}
);
export default createAppContainer(
createAnimatedSwitchNavigator(
{
App: AppTabs,
Auth: AuthSwitch
},
{
initialRouteName: "Auth"
}
)
);