-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.js
123 lines (117 loc) · 3.41 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
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
import * as React from 'react';
import BottomNav from './screens';
import Call from './screens/call';
import Chat from './screens/chat';
import Order from './screens/history';
import Login from './screens/login';
import Contacts from './screens/contacts';
import Membership from './screens/plans/membership.tsx';
import MonthlyService from './screens/plans/monthlyService';
import TermsForMember from './screens/plans/termForMember';
import TermsForMonthly from './screens/plans/termForMonthly';
import {Context} from './store';
import {service} from './repository';
import {theme} from './theme';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import ViewImage from './screens/viewImage';
import Confirm from './screens/confirm';
import EditProfile from './screens/editProfile';
const Stack = createStackNavigator();
function Router() {
const [state] = React.useContext(Context);
return (
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerTitleAlign: 'center',
headerTintColor: theme.light_text,
headerTitleStyle: {
fontWeight: '100',
},
}}>
<Stack.Screen
name="Main"
component={BottomNav}
options={{headerShown: false}}
/>
<Stack.Screen
name="chat"
component={state.uid ? Chat : Login}
options={{
headerShown: state.uid ? true : false,
title: 'Live Chat',
}}
/>
<Stack.Screen
name="membership"
component={Membership}
options={{
title: 'Membership Plan',
}}
/>
<Stack.Screen
name="monthly"
component={MonthlyService}
options={{
title: 'Monthly Service',
}}
/>
<Stack.Screen
name="login"
component={Login}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="confirm"
component={state.uid ? Confirm : Login}
options={{
headerShown: state.uid ? true : false,
title: 'Confirmation',
}}
/>
<Stack.Screen
name="termsMember"
component={TermsForMember}
options={{
title: 'Terms and Conditions',
}}
/>
<Stack.Screen
name="termsMonthly"
component={TermsForMonthly}
options={{
title: 'Terms and Conditions',
}}
/>
<Stack.Screen name="contacts" component={Contacts} />
<Stack.Screen
name="editProfile"
component={state.uid ? EditProfile : Login}
options={{
title: 'Edit Profile',
headerShown: true,
}}
/>
<Stack.Screen
options={{
headerShown: false,
}}
name="viewImage"
component={ViewImage}
/>
<Stack.Screen
name="call"
component={state.uid ? Call : Login}
options={{
headerShown: state.uid ? true : false,
title: 'Admin',
}}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default Router;