Fakultas Ilmu Komputer UI

navigation.ts 4.37 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
} from 'scenes';
28
import { FC } from 'react';
29
import DietReportForNutritionist from 'scenes/nutritionist/DietReportForNutritionist';
30

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

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

export const publicNavigation: NavRoute[] = [
  {
    name: ROUTES.initial,
    component: InitialPage,
  },
  ...navigation,
71
72
73
74
75
  {
    name: ROUTES.registration,
    component: ManualRegistrationPage,
    header: 'Registrasi',
  },
76
77
78
79
80
  {
    name: ROUTES.login,
    component: LoginPage,
    header: 'Login',
  },
81
82
83
84
85
  {
    name: ROUTES.loginChoosePlan,
    component: LoginChoosePlan,
    header: 'Login',
  },
86
87
88
89
90
  {
    name: ROUTES.nutritionistAdminLogin,
    component: NutritionistAdminLogin,
    header: 'Login Tim Dietela',
  },
Wulan Mantiri's avatar
Wulan Mantiri committed
91
92
];

Wulan Mantiri's avatar
Wulan Mantiri committed
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
export const unpaidClientNavigation: NavRoute[] = [
  {
    name: ROUTES.checkout,
    component: Checkout,
    header: 'Checkout',
  },
  {
    name: ROUTES.payment,
    component: PaymentWebView,
    header: 'Pembayaran',
  },
  {
    name: ROUTES.paymentResult,
    component: PaymentResult,
  },
  ...navigation,
  {
110
111
112
    name: ROUTES.clientTabNavigation,
    component: ClientNavigation,
    header: 'Dietela',
Wulan Mantiri's avatar
Wulan Mantiri committed
113
114
115
  },
];

116
export const paidClientNavigation: NavRoute[] = [
117
  {
118
119
120
    name: ROUTES.clientTabNavigation,
    component: ClientNavigation,
    header: 'Dietela',
121
  },
122
];
123

124
125
126
127
export const nutritionistNavigation: NavRoute[] = [
  {
    name: ROUTES.clientListForNutritionist,
    component: ClientListNutritionist,
Wulan Mantiri's avatar
Wulan Mantiri committed
128
    header: 'Daftar Klien',
129
130
131
132
133
134
  },
  {
    name: ROUTES.clientChatNutritionist,
    component: ComingSoonPage,
    header: 'Chat Klien',
  },
135
136
137
  {
    name: ROUTES.weeklyReportChooseWeekForNutritionist,
    component: ChooseWeekForNutritionist,
138
    header: 'Riwayat Laporan Diet Klien',
139
  },
140
141
  {
    name: ROUTES.clientDietReportNutritionist,
142
    component: DietReportForNutritionist,
143
144
145
146
147
148
149
    header: 'Laporan Klien',
  },
  {
    name: ROUTES.clientProfileNutritionist,
    component: ReadOnlyDietProfile,
    header: 'Profil Klien',
  },
150
151
152
153
154
  {
    name: ROUTES.profileDietRecommendation,
    component: ProfileDietRecommendation,
    header: 'Rekomendasi Profil Diet',
  },
155
156
];

157
158
export const adminNavigation: NavRoute[] = [
  {
159
160
    name: ROUTES.clientListForAdmin,
    component: ClientListAdmin,
Wulan Mantiri's avatar
Wulan Mantiri committed
161
    header: 'Daftar Klien',
162
163
164
  },
  {
    name: ROUTES.clientProfileAdmin,
165
    component: ReadOnlyDietProfile,
166
167
    header: 'Profil Klien',
  },
168
169
170
171
172
173
174
175
176
177
  {
    name: ROUTES.clientDietReportAdmin,
    component: ComingSoonPage,
    header: 'Profil Klien',
  },
  {
    name: ROUTES.clientChatAdmin,
    component: ComingSoonPage,
    header: 'Profil Klien',
  },
178
179
180
181
182
  {
    name: ROUTES.clientDietRecommendation,
    component: ClientDietRecommendationForAdmin,
    header: 'Rekomendasi Profil Diet',
  },
183
184
];

185
// FOR TESTING PURPOSES
186
export const testNavigation: NavRoute[] = [
Wulan Mantiri's avatar
Wulan Mantiri committed
187
  ...unpaidClientNavigation,
188
  ...nutritionistNavigation,
189
  ...adminNavigation,
190
191
192
193
194
195
196
197
198
199
200
201
202
203
  {
    name: ROUTES.initial,
    component: InitialPage,
  },
  {
    name: ROUTES.registration,
    component: ManualRegistrationPage,
    header: 'Registrasi',
  },
  {
    name: ROUTES.login,
    component: LoginPage,
    header: 'Login',
  },
204
205
206
207
208
  {
    name: ROUTES.loginChoosePlan,
    component: LoginChoosePlan,
    header: 'Login',
  },
209
210
211
212
213
  {
    name: ROUTES.nutritionistAdminLogin,
    component: NutritionistAdminLogin,
    header: 'Login Tim Dietela',
  },
214
];