Fakultas Ilmu Komputer UI

Commit 17cb1384 authored by wulanmantiri's avatar wulanmantiri
Browse files

[GREEN] Implement extended questionnaire layout and navigation

parent 27973cec
Pipeline #75107 passed with stages
in 21 minutes and 58 seconds
...@@ -11,6 +11,7 @@ import { ...@@ -11,6 +11,7 @@ import {
ProgramDetail, ProgramDetail,
NutritionistDetail, NutritionistDetail,
PaymentResult, PaymentResult,
ExtendedQuestionnaire,
} from 'scenes'; } from 'scenes';
import { FC } from 'react'; import { FC } from 'react';
...@@ -86,6 +87,11 @@ export const privateNavigation: NavRoute[] = [ ...@@ -86,6 +87,11 @@ export const privateNavigation: NavRoute[] = [
component: ComingSoonPage, component: ComingSoonPage,
header: 'Profile', header: 'Profile',
}, },
{
name: ROUTES.extendedQuestionnaire,
component: ExtendedQuestionnaire,
header: 'Diet Questionnaire',
},
]; ];
export const testNavigation: NavRoute[] = [ export const testNavigation: NavRoute[] = [
......
...@@ -4,6 +4,10 @@ export const comingSoon = '*'; ...@@ -4,6 +4,10 @@ export const comingSoon = '*';
const questionnaire = 'questionnaire'; const questionnaire = 'questionnaire';
export const allAccessQuestionnaire = `${questionnaire}/all-access`; export const allAccessQuestionnaire = `${questionnaire}/all-access`;
export const dietelaQuizResult = `${questionnaire}/dietela-quiz-result`; export const dietelaQuizResult = `${questionnaire}/dietela-quiz-result`;
export const consentForm = `${questionnaire}/consent`;
export const extendedQuestionnaire = `${questionnaire}/extended`;
export const extendedQuestionnaireById = (id: number) =>
`${extendedQuestionnaire}/${id}`;
export const checkout = 'checkout'; export const checkout = 'checkout';
export const choosePlan = `${checkout}/choose-plan`; export const choosePlan = `${checkout}/choose-plan`;
......
...@@ -6,6 +6,7 @@ export { default as ComingSoonPage } from './common/ComingSoonPage'; ...@@ -6,6 +6,7 @@ export { default as ComingSoonPage } from './common/ComingSoonPage';
export { default as AllAccessQuestionnaire } from './questionnaire/AllAccessQuestionnaire'; export { default as AllAccessQuestionnaire } from './questionnaire/AllAccessQuestionnaire';
export { default as DietelaQuizResult } from './questionnaire/DietelaQuizResult'; export { default as DietelaQuizResult } from './questionnaire/DietelaQuizResult';
export { default as ExtendedQuestionnaire } from './questionnaire/ExtendedQuestionnaire';
export { default as Checkout } from './cart/Checkout'; export { default as Checkout } from './cart/Checkout';
export { default as ChoosePlan } from './cart/ChoosePlan'; export { default as ChoosePlan } from './cart/ChoosePlan';
......
import React, { FC, useState } from 'react';
import * as ROUTES from 'constants/routes';
import { StepByStepForm } from 'components/form';
import { pages } from './schema';
const ExtendedQuestionnaire: FC = () => {
const [currentPage] = useState(1);
return (
<StepByStepForm
currentPage={currentPage}
title={'Lengkapi Profil Anda'}
pages={pages.map((name, i) => ({
name,
route: ROUTES.extendedQuestionnaireById(i),
}))}
finishRedirectRoute={ROUTES.profile}
/>
);
};
export default ExtendedQuestionnaire;
export const pages: string[] = [
'Identitas Diri',
'Pola Makan',
'Konsumsi Makanan Seharian',
'Gaya Hidup dan Kebiasaan Diet',
'Kondisi Pribadi',
];
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment