Fakultas Ilmu Komputer UI

navigation.ts 2.27 KB
Newer Older
1
import * as ROUTES from 'constants/routes';
2
3
import {
  AllAccessQuestionnaire,
4
  Checkout,
5
6
7
8
  ChoosePlan,
  ComingSoonPage,
  DietelaQuizResult,
  InitialPage,
9
  ManualRegistrationPage,
10
  LoginPage,
11
  ProgramDetail,
12
  NutritionistDetail,
Wulan Mantiri's avatar
Wulan Mantiri committed
13
  PaymentResult,
Wulan Mantiri's avatar
Wulan Mantiri committed
14
  ExtendedQuestionnaire,
15
} from 'scenes';
16
import { FC } from 'react';
17

18
19
20
21
22
23
export interface NavRoute {
  name: string;
  component: FC;
  header?: string;
}

Wulan Mantiri's avatar
Wulan Mantiri committed
24
const navigation: NavRoute[] = [
25
26
27
28
29
  {
    name: ROUTES.allAccessQuestionnaire,
    component: AllAccessQuestionnaire,
    header: 'Dietela Quiz',
  },
30
31
32
33
34
  {
    name: ROUTES.dietelaQuizResult,
    component: DietelaQuizResult,
    header: 'Dietela Quiz Result',
  },
35
36
37
38
39
40
41
  {
    name: ROUTES.choosePlan,
    component: ChoosePlan,
    header: 'Choose Plan',
  },
  {
    name: ROUTES.programDetail,
42
    component: ProgramDetail,
43
44
45
46
    header: 'Program Dietela',
  },
  {
    name: ROUTES.nutritionistDetail,
47
    component: NutritionistDetail,
48
49
    header: 'Nutrisionis',
  },
Wulan Mantiri's avatar
Wulan Mantiri committed
50
51
52
53
54
55
56
57
];

export const publicNavigation: NavRoute[] = [
  {
    name: ROUTES.initial,
    component: InitialPage,
  },
  ...navigation,
58
59
60
61
62
  {
    name: ROUTES.registration,
    component: ManualRegistrationPage,
    header: 'Registrasi',
  },
63
64
65
66
67
  {
    name: ROUTES.login,
    component: LoginPage,
    header: 'Login',
  },
Wulan Mantiri's avatar
Wulan Mantiri committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
];

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

export const privateNavigation: NavRoute[] = [
85
86
87
88
89
  {
    name: ROUTES.profile,
    component: ComingSoonPage,
    header: 'Profile',
  },
Wulan Mantiri's avatar
Wulan Mantiri committed
90
91
92
93
94
  {
    name: ROUTES.extendedQuestionnaire,
    component: ExtendedQuestionnaire,
    header: 'Diet Questionnaire',
  },
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

export const testNavigation: NavRoute[] = [
  ...navigation,
  ...privateNavigation,
  {
    name: ROUTES.initial,
    component: InitialPage,
  },
  {
    name: ROUTES.registration,
    component: ManualRegistrationPage,
    header: 'Registrasi',
  },
  {
    name: ROUTES.login,
    component: LoginPage,
    header: 'Login',
  },
  {
    name: ROUTES.checkout,
    component: Checkout,
    header: 'Checkout',
  },
  {
    name: ROUTES.paymentResult,
    component: PaymentResult,
    header: 'Pembayaran',
  },
];