Fakultas Ilmu Komputer UI

navigation.ts 4.5 KB
Newer Older
1
import * as ROUTES from 'constants/routes';
2
import {
3
4
5
6
7
8
9
10
11
  // Extended Questionnaire
  ExtendedQuestionnaire,
  ConsentForm,
  Questionnaire1,
  Questionnaire2,
  Questionnaire3,
  Questionnaire4,
  Questionnaire5,

12
  // Public
13
14
15
16
  AllAccessQuestionnaire,
  ChoosePlan,
  DietelaQuizResult,
  InitialPage,
17
  ManualRegistrationPage,
18
  LoginPage,
19
  NutritionistAdminLogin,
20
  ProgramDetail,
21
  NutritionistDetail,
22
23
24

  // Private
  Checkout,
Wulan Mantiri's avatar
Wulan Mantiri committed
25
  PaymentResult,
26
  ReadOnlyDietProfile,
27
  ClientListNutritionist,
28
  ComingSoonPage,
29
30
  ClientProfile,
  ClientProfileForAdmin,
31
  ProfileDietRecommendation,
32
  ClientListAdmin,
33
} from 'scenes';
34
import { FC } from 'react';
35

36
export interface NavRoute<T = any> {
37
  name: string;
38
  component: FC<T>;
39
40
41
  header?: string;
}

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

export const publicNavigation: NavRoute[] = [
  {
    name: ROUTES.initial,
    component: InitialPage,
  },
  ...navigation,
76
77
78
79
80
  {
    name: ROUTES.registration,
    component: ManualRegistrationPage,
    header: 'Registrasi',
  },
81
82
83
84
85
  {
    name: ROUTES.login,
    component: LoginPage,
    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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
];

export const unpaidClientNavigation: NavRoute[] = [
  {
    name: ROUTES.checkout,
    component: Checkout,
    header: 'Checkout',
  },
  {
    name: ROUTES.paymentResult,
    component: PaymentResult,
    header: 'Pembayaran',
  },
  ...navigation,
];

107
108
109
110
111
112
export const clientNavigation: NavRoute[] = [
  {
    name: ROUTES.clientProfile,
    component: ClientProfile,
    header: 'Profil Saya',
  },
Wulan Mantiri's avatar
Wulan Mantiri committed
113
114
115
  {
    name: ROUTES.extendedQuestionnaire,
    component: ExtendedQuestionnaire,
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
    header: 'Profil Saya',
  },
  ...[
    {
      component: ConsentForm,
      header: 'Persetujuan',
    },
    {
      component: Questionnaire1,
      header: 'Identitas Diri',
    },
    {
      component: Questionnaire2,
      header: 'Pola Makan',
    },
    {
      component: Questionnaire3,
      header: 'Konsumsi Makan',
    },
    {
      component: Questionnaire4,
      header: 'Gaya Hidup',
    },
    {
      component: Questionnaire5,
      header: 'Kondisi Pribadi',
    },
  ].map((nav, id) => ({
    ...nav,
    name: ROUTES.extendedQuestionnaireById(id),
  })),
];

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
export const nutritionistNavigation: NavRoute[] = [
  {
    name: ROUTES.clientListForNutritionist,
    component: ClientListNutritionist,
    header: 'List Klien',
  },
  {
    name: ROUTES.clientChatNutritionist,
    component: ComingSoonPage,
    header: 'Chat Klien',
  },
  {
    name: ROUTES.clientDietReportNutritionist,
    component: ComingSoonPage,
    header: 'Laporan Klien',
  },
  {
    name: ROUTES.clientProfileNutritionist,
    component: ReadOnlyDietProfile,
    header: 'Profil Klien',
  },
170
171
172
173
174
  {
    name: ROUTES.profileDietRecommendation,
    component: ProfileDietRecommendation,
    header: 'Rekomendasi Profil Diet',
  },
175
176
];

177
178
export const adminNavigation: NavRoute[] = [
  {
179
180
181
182
183
184
    name: ROUTES.clientListForAdmin,
    component: ClientListAdmin,
    header: 'List Klien',
  },
  {
    name: ROUTES.clientProfileAdmin,
185
    component: ClientProfileForAdmin,
186
187
188
189
190
191
192
193
194
195
    header: 'Profil Klien',
  },
  {
    name: ROUTES.clientDietReportAdmin,
    component: ComingSoonPage,
    header: 'Profil Klien',
  },
  {
    name: ROUTES.clientChatAdmin,
    component: ComingSoonPage,
196
197
198
199
    header: 'Profil Klien',
  },
];

200
201
export const testNavigation: NavRoute[] = [
  ...navigation,
202
203
  ...clientNavigation,
  ...nutritionistNavigation,
204
205
206
207
208
209
210
211
212
213
214
215
216
217
  {
    name: ROUTES.initial,
    component: InitialPage,
  },
  {
    name: ROUTES.registration,
    component: ManualRegistrationPage,
    header: 'Registrasi',
  },
  {
    name: ROUTES.login,
    component: LoginPage,
    header: 'Login',
  },
218
219
220
221
222
  {
    name: ROUTES.nutritionistAdminLogin,
    component: NutritionistAdminLogin,
    header: 'Login Tim Dietela',
  },
223
224
225
226
227
228
229
230
231
232
233
  {
    name: ROUTES.checkout,
    component: Checkout,
    header: 'Checkout',
  },
  {
    name: ROUTES.paymentResult,
    component: PaymentResult,
    header: 'Pembayaran',
  },
];