Fakultas Ilmu Komputer UI

navigation.ts 5.43 KB
Newer Older
1
import * as ROUTES from 'constants/routes';
2
import {
3
  // Public
4
5
6
7
  AllAccessQuestionnaire,
  ChoosePlan,
  DietelaQuizResult,
  InitialPage,
8
  ManualRegistrationPage,
9
  LoginPage,
10
  NutritionistAdminLogin,
11
  ProgramDetail,
12
  NutritionistDetail,
13
14
15

  // Private
  Checkout,
Wulan Mantiri's avatar
Wulan Mantiri committed
16
  PaymentResult,
17
  ReadOnlyDietProfile,
18
  ClientListNutritionist,
19
  ComingSoonPage,
20
  ClientDietRecommendationForAdmin,
21
  PaymentWebView,
22
23
24
  ProfileDietRecommendation,
  ClientListAdmin,
  LoginChoosePlan,
25
  ClientNavigation,
26
  ChooseWeekForNutritionist,
27
  AllCartsExpiredPage,
28
} from 'scenes';
29
import { FC } from 'react';
30
import DietReportForNutritionist from 'scenes/nutritionist/DietReportForNutritionist';
31

32
export interface NavRoute<T = any> {
33
  name: string;
34
  component: FC<T>;
35
36
37
  header?: string;
}

Wulan Mantiri's avatar
Wulan Mantiri committed
38
const navigation: NavRoute[] = [
39
40
41
42
43
  {
    name: ROUTES.allAccessQuestionnaire,
    component: AllAccessQuestionnaire,
    header: 'Dietela Quiz',
  },
44
45
46
47
48
  {
    name: ROUTES.dietelaQuizResult,
    component: DietelaQuizResult,
    header: 'Dietela Quiz Result',
  },
49
50
51
52
53
54
55
  {
    name: ROUTES.choosePlan,
    component: ChoosePlan,
    header: 'Choose Plan',
  },
  {
    name: ROUTES.programDetail,
56
    component: ProgramDetail,
57
58
59
60
    header: 'Program Dietela',
  },
  {
    name: ROUTES.nutritionistDetail,
61
    component: NutritionistDetail,
62
63
    header: 'Nutrisionis',
  },
Wulan Mantiri's avatar
Wulan Mantiri committed
64
65
66
67
68
69
70
71
];

export const publicNavigation: NavRoute[] = [
  {
    name: ROUTES.initial,
    component: InitialPage,
  },
  ...navigation,
72
73
74
75
76
  {
    name: ROUTES.registration,
    component: ManualRegistrationPage,
    header: 'Registrasi',
  },
77
78
79
80
81
  {
    name: ROUTES.login,
    component: LoginPage,
    header: 'Login',
  },
82
83
84
85
86
  {
    name: ROUTES.loginChoosePlan,
    component: LoginChoosePlan,
    header: 'Login',
  },
87
88
89
90
91
  {
    name: ROUTES.nutritionistAdminLogin,
    component: NutritionistAdminLogin,
    header: 'Login Tim Dietela',
  },
Wulan Mantiri's avatar
Wulan Mantiri committed
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
export const takeQuizClientNavigation: NavRoute[] = [
  ...navigation,
  {
    name: ROUTES.allCartsExpired,
    component: AllCartsExpiredPage,
    header: 'Dietela',
  },
  {
    name: ROUTES.checkout,
    component: Checkout,
    header: 'Checkout',
  },
  {
    name: ROUTES.payment,
    component: PaymentWebView,
    header: 'Pembayaran',
  },
  {
    name: ROUTES.paymentResult,
    component: PaymentResult,
  },
  {
    name: ROUTES.clientTabNavigation,
    component: ClientNavigation,
    header: 'Dietela',
  },
];

export const cartsExpireClientNavigation: NavRoute[] = [
  {
    name: ROUTES.allCartsExpired,
    component: AllCartsExpiredPage,
    header: 'Dietela',
  },
  {
    name: ROUTES.checkout,
    component: Checkout,
    header: 'Checkout',
  },
  {
    name: ROUTES.payment,
    component: PaymentWebView,
    header: 'Pembayaran',
  },
  {
    name: ROUTES.paymentResult,
    component: PaymentResult,
  },
  ...navigation,
  {
    name: ROUTES.clientTabNavigation,
    component: ClientNavigation,
    header: 'Dietela',
  },
];

Wulan Mantiri's avatar
Wulan Mantiri committed
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
export const unpaidClientNavigation: NavRoute[] = [
  {
    name: ROUTES.checkout,
    component: Checkout,
    header: 'Checkout',
  },
  {
    name: ROUTES.payment,
    component: PaymentWebView,
    header: 'Pembayaran',
  },
  {
    name: ROUTES.paymentResult,
    component: PaymentResult,
  },
  ...navigation,
  {
167
168
169
    name: ROUTES.clientTabNavigation,
    component: ClientNavigation,
    header: 'Dietela',
Wulan Mantiri's avatar
Wulan Mantiri committed
170
171
172
  },
];

173
export const paidClientNavigation: NavRoute[] = [
174
  {
175
176
177
    name: ROUTES.clientTabNavigation,
    component: ClientNavigation,
    header: 'Dietela',
178
  },
179
180
];

181
182
183
184
export const nutritionistNavigation: NavRoute[] = [
  {
    name: ROUTES.clientListForNutritionist,
    component: ClientListNutritionist,
Wulan Mantiri's avatar
Wulan Mantiri committed
185
    header: 'Daftar Klien',
186
187
188
189
190
191
  },
  {
    name: ROUTES.clientChatNutritionist,
    component: ComingSoonPage,
    header: 'Chat Klien',
  },
192
193
194
195
196
  {
    name: ROUTES.weeklyReportChooseWeekForNutritionist,
    component: ChooseWeekForNutritionist,
    header: 'Riwayat Laporan Diet Klien',
  },
197
198
  {
    name: ROUTES.clientDietReportNutritionist,
199
    component: DietReportForNutritionist,
200
201
202
203
204
205
206
    header: 'Laporan Klien',
  },
  {
    name: ROUTES.clientProfileNutritionist,
    component: ReadOnlyDietProfile,
    header: 'Profil Klien',
  },
207
208
209
210
211
  {
    name: ROUTES.profileDietRecommendation,
    component: ProfileDietRecommendation,
    header: 'Rekomendasi Profil Diet',
  },
212
213
];

214
215
export const adminNavigation: NavRoute[] = [
  {
216
217
    name: ROUTES.clientListForAdmin,
    component: ClientListAdmin,
Wulan Mantiri's avatar
Wulan Mantiri committed
218
    header: 'Daftar Klien',
219
220
221
  },
  {
    name: ROUTES.clientProfileAdmin,
222
    component: ReadOnlyDietProfile,
223
224
    header: 'Profil Klien',
  },
225
226
227
228
229
230
231
232
233
234
  {
    name: ROUTES.clientDietReportAdmin,
    component: ComingSoonPage,
    header: 'Profil Klien',
  },
  {
    name: ROUTES.clientChatAdmin,
    component: ComingSoonPage,
    header: 'Profil Klien',
  },
235
236
237
238
239
  {
    name: ROUTES.clientDietRecommendation,
    component: ClientDietRecommendationForAdmin,
    header: 'Rekomendasi Profil Diet',
  },
240
241
];

242
// FOR TESTING PURPOSES
243
export const testNavigation: NavRoute[] = [
Wulan Mantiri's avatar
Wulan Mantiri committed
244
  ...unpaidClientNavigation,
245
  ...nutritionistNavigation,
246
  ...adminNavigation,
247
248
249
250
251
252
253
254
255
256
257
258
259
260
  {
    name: ROUTES.initial,
    component: InitialPage,
  },
  {
    name: ROUTES.registration,
    component: ManualRegistrationPage,
    header: 'Registrasi',
  },
  {
    name: ROUTES.login,
    component: LoginPage,
    header: 'Login',
  },
261
262
263
264
265
  {
    name: ROUTES.loginChoosePlan,
    component: LoginChoosePlan,
    header: 'Login',
  },
266
267
268
269
270
  {
    name: ROUTES.nutritionistAdminLogin,
    component: NutritionistAdminLogin,
    header: 'Login Tim Dietela',
  },
271
];