-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
69 lines (62 loc) · 1.88 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
import React from "react";
import {
createBottomTabNavigator,
createAppContainer,
createSwitchNavigator
} from "react-navigation";
import GroupScreen from "./src/screens/Main/GroupScreen";
import NotificationsScreen from "./src/screens/Main/NotificationsScreen";
import SettingsScreen from "./src/screens/Main/SettingsScreen";
import PersonalCalendar from "./src/screens/Main/PersonalCalendar";
import AuthLoading from "./src/screens/Auth/AuthLoading";
// import Auth from "./src/screens/Auth/Auth";
import MyIcon from "./src/components/MyIcon";
import IconWithBadge from "./src/components/IconWithBadge";
import { cliqueBlue } from "./src/assets/constants";
const AppNavigator = createBottomTabNavigator(
{
Group: GroupScreen,
Calendar: PersonalCalendar,
Notifications: NotificationsScreen,
Profile: SettingsScreen
},
{
defaultNavigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, horizontal, tintColor }) => {
const { routeName } = navigation.state;
let IconComponent = MyIcon;
let iconName;
if (routeName === "Group") {
iconName = `md-chatboxes`;
} else if (routeName === "Calendar") {
iconName = `md-calendar`;
} else if (routeName === "Notifications") {
iconName = `md-notifications`;
} else if (routeName === "Profile") {
iconName = `md-contact`;
}
return <IconComponent name={iconName} size={28} color={tintColor} />;
}
}),
tabBarOptions: {
activeTintColor: cliqueBlue,
inactiveTintColor: "gray"
}
}
);
const InitialNavigator = createSwitchNavigator(
{
AuthLoading: AuthLoading,
App: AppNavigator
},
{
initialRouteName: "AuthLoading"
}
);
const AppContainer = createAppContainer(InitialNavigator);
class App extends React.Component {
render() {
return <AppContainer />;
}
}
export default App;