-
Notifications
You must be signed in to change notification settings - Fork 4
/
App.js
200 lines (190 loc) · 5.92 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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
import React from 'react';
import {
createSwitchNavigator,
createStackNavigator,
createBottomTabNavigator,
} from 'react-navigation';
import { YellowBox } from 'react-native';
import { Root } from 'native-base';
import LoginScreen from './src/components/Account/LoginScreen';
import RegisterScreen from './src/components/Account/RegisterScreen';
import EditProfile from './src/components/Account/EditProfile';
import UploadDocumentScreen from './src/components/Account/UploadDocumentScreen';
import BankAccounts from './src/components/BankAccounts/BankAccounts';
import AddBankAccount from './src/components/BankAccounts/AddBankAccount';
import ForgotScreen from './src/components/Account/ForgotScreen';
import TermsAndConditionsScreen from './src/components/Account/TermsAndConditionsScreen';
import ChangePassword from './src/components/Account/ChangePassword';
import PublicProfile from './src/components/Account/PublicProfile';
import Profile from './src/components/Account/Profile';
import DashboardScreen from './src/components/Dashboard';
import JobInvites from './src/components/Invite/JobInvites';
import InviteDetailsV2 from './src/components/Invite/InviteDetailsV2';
import JobPreferences from './src/components/Invite/JobPreferences';
import Position from './src/components/Invite/Position';
import Availability from './src/components/Invite/Availability';
import MyJobs from './src/components/MyJobs';
import RateEmployer from './src/components/MyJobs/RateEmployer';
import UpcomingJobScreen from './src/components/MyJobs/UpcomingJobScreen';
import JobDetailsNewOneScreen from './src/components/MyJobs/WorkModeScreen';
import JobDetailsNewTwoScreen from './src/components/MyJobs/JobDetailsNewTwo';
import JobPaymentsScreen from './src/components/MyJobs/JobPayments';
import WorkModeScreen from './src/components/MyJobs/WorkModeScreen';
import Reviews from './src/components/MyJobs/Reviews';
import Help from './src/components/Help';
import {
DASHBOARD_ROUTE,
LOGIN_ROUTE,
REGISTER_ROUTE,
FORGOT_ROUTE,
JOB_INVITES_ROUTE,
JOB_PREFERENCES_ROUTE,
MYJOBS_ROUTE,
SETTING_ROUTE,
APP_ROUTE,
AUTH_ROUTE,
RESET_ROUTE,
AVAILABILITY_ROUTE,
INVITE_DETAILS_ROUTE_V2,
POSITION_ROUTE,
EDIT_LOCATION_ROUTE,
RATE_EMPLOYER_ROUTE,
REVIEWS_ROUTE,
JOB_DETAILS_NEW_ONE_ROUTE,
JOB_DETAILS_NEW_TWO_ROUTE,
JOB_PAYMENTS_ROUTE,
HELP_ROUTE,
TERMS_AND_CONDITIONS_ROUTE,
UPDATE_APP_ROUTE,
} from './src/constants/routes';
import {
BLUE_DARK,
BLUE_LIGHT,
GRAY_MAIN,
BLUE_SEMI_LIGHT,
} from './src/shared/colorPalette';
import SettingScreen from './src/components/Setting';
import Splash from './src/components/Splash';
import EditLocation from './src/components/Invite/EditLocation';
import ApplicationDetailScreen from './src/components/MyJobs/ApplicationDetailScreen';
import JobCompletedScreen from './src/components/MyJobs/JobCompletedScreen';
import UpdateApp from './src/components/UpdateApp';
YellowBox.ignoreWarnings([
'Warning: isMounted(...) is deprecated',
'Warning: Failed prop type',
'Module RCTImageLoader',
]);
window.DEBUG = false;
export const AuthStack = createStackNavigator({
[LOGIN_ROUTE]: {
screen: LoginScreen,
path: 'login/:email',
},
[REGISTER_ROUTE]: {
screen: RegisterScreen,
path: 'register',
},
[FORGOT_ROUTE]: ForgotScreen,
[TERMS_AND_CONDITIONS_ROUTE]: TermsAndConditionsScreen,
});
export const Tabs = createBottomTabNavigator(
{
[DASHBOARD_ROUTE]: { screen: DashboardScreen },
[JOB_INVITES_ROUTE]: { screen: JobInvites },
[JOB_PREFERENCES_ROUTE]: { screen: JobPreferences },
[MYJOBS_ROUTE]: { screen: MyJobs },
[Profile.routeName]: { screen: Profile },
},
{
tabBarPosition: 'bottom',
tabBarOptions: {
activeBackgroundColor: BLUE_SEMI_LIGHT,
inactiveBackgroundColor: BLUE_LIGHT,
activeTintColor: BLUE_DARK,
inactiveTintColor: GRAY_MAIN,
showLabel: true,
showIcon: true,
labelStyle: {
fontSize: 10,
},
style: {
backgroundColor: BLUE_LIGHT,
height: 60,
borderTopColor: 'transparent',
},
tabStyle: {
width: 100,
},
},
},
);
export const AppStack = createStackNavigator(
{
Tabs,
[SETTING_ROUTE]: SettingScreen,
[RESET_ROUTE]: ChangePassword,
[UploadDocumentScreen.routeName]: UploadDocumentScreen,
[BankAccounts.routeName]: BankAccounts,
[AddBankAccount.routeName]: AddBankAccount,
[EditProfile.routeName]: EditProfile,
[PublicProfile.routeName]: PublicProfile,
[EDIT_LOCATION_ROUTE]: EditLocation,
[AVAILABILITY_ROUTE]: Availability,
[POSITION_ROUTE]: Position,
[RATE_EMPLOYER_ROUTE]: RateEmployer,
[REVIEWS_ROUTE]: Reviews,
// [INVITE_DETAILS_ROUTE]: {
// screen: InviteDetails,
// path: 'invite/:inviteId',
// },
[INVITE_DETAILS_ROUTE_V2]: {
screen: InviteDetailsV2,
path: 'invite/:inviteId',
},
[UpcomingJobScreen.routeName]: {
screen: UpcomingJobScreen,
path: 'shift/:shiftId',
},
[WorkModeScreen.routeName]: {
screen: WorkModeScreen,
},
[JOB_DETAILS_NEW_ONE_ROUTE]: {
screen: JobDetailsNewOneScreen,
},
[JOB_DETAILS_NEW_TWO_ROUTE]: {
screen: JobDetailsNewTwoScreen,
},
[JOB_PAYMENTS_ROUTE]: {
screen: JobPaymentsScreen,
},
[ApplicationDetailScreen.routeName]: {
screen: ApplicationDetailScreen,
path: 'application/:applicationId',
},
[JobCompletedScreen.routeName]: {
screen: JobCompletedScreen,
path: 'job-completed/:shiftId',
},
[HELP_ROUTE]: {
screen: Help,
},
},
{ navigationOptions: { header: null } },
);
const SwitchNavigator = createSwitchNavigator(
{
AuthLoading: Splash,
[AUTH_ROUTE]: AuthStack,
[APP_ROUTE]: AppStack,
[UPDATE_APP_ROUTE]: UpdateApp,
},
{
initialRouteName: 'AuthLoading',
},
);
const prefix = 'https://talent.jobcore.co/';
export default () => (
<Root>
<SwitchNavigator uriPrefix={prefix} />
</Root>
);