forked from dharakhatri88/ReactNative-Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRouter.js
88 lines (85 loc) · 1.96 KB
/
Router.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
import React from "react";
import { StackNavigator, TabNavigator } from "react-navigation";
import { Icon } from 'native-base';
import SignUp from "./components/SignUp";
import SignIn from "./components/SignIn";
import ForgotPwd from "./components/ForgotPwd";
import Comments from "./components/Comments";
import SocialAccounts from "./components/SocialAccounts";
import Home from "./components/Home";
export const SignedOut = StackNavigator({
SignIn: {
screen: SignIn,
navigationOptions: {
title: "Sign In"
}
},
SignUp: {
screen: SignUp,
navigationOptions: {
title: "Sign Up"
}
},
ForgotPwd: {
screen: ForgotPwd,
navigationOptions: {
title: "Forgot Password"
}
},
});
export const SignedIn = TabNavigator({
Home: {
screen: Home,
navigationOptions: {
tabBarLabel: "Home",
tabBarIcon: ({ tintColor }) => (
<Icon name='home' style={{color: tintColor}} />
),
}
},
Comments: {
screen: Comments,
navigationOptions: {
tabBarLabel: "Comments",
tabBarIcon: ({ tintColor }) => (
<Icon name='chatbubbles' style={{color: tintColor}} />
),
}
},
SocialAccounts: {
screen: SocialAccounts,
navigationOptions: {
tabBarLabel: "Social Accounts",
tabBarIcon: ({ tintColor }) => (
<Icon name='settings' style={{color: tintColor}} />
),
}
},
},
{
animationEnabled: true,
tabBarOptions: {
inactiveTintColor: '#939393',
}
});
export const createRootNavigator = (signedIn = false) => {
return StackNavigator({
SignedIn: {
screen: SignedIn,
navigationOptions: {
gesturesEnabled: false
}
},
SignedOut: {
screen: SignedOut,
navigationOptions: {
gesturesEnabled: false
}
},
},
{
headerMode: "none",
mode: "modal",
initialRouteName: signedIn ? "SignedIn" : "SignedOut"
});
};