Fakultas Ilmu Komputer UI

Commit bef1c9a0 authored by wulanmantiri's avatar wulanmantiri
Browse files

[REFACTOR] Add nutritionist during auth and revise navigation

parent 5962c9a0
Pipeline #84048 passed with stages
in 9 minutes and 54 seconds
import { jest } from '@jest/globals';
import { iUserContext } from 'provider/UserContext/types';
export const mockUserContext: iUserContext = {
user: {
id: null,
email: '',
name: '',
role: null,
transaction_status: null,
is_finished_onboarding: false,
cart_id: null,
nutritionist: null,
},
isAuthenticated: false,
isLoading: false,
isFirstLoading: false,
setUser: jest.fn(),
getUser: jest.fn(),
signup: jest.fn(),
login: jest.fn(),
loginWithGoogle: jest.fn(),
logout: jest.fn(),
};
......@@ -30,6 +30,7 @@ export const initialUser = {
transaction_status: null,
is_finished_onboarding: false,
cart_id: null,
nutritionist: null,
};
export const UserContext = createContext<iUserContext>({
......
......@@ -9,7 +9,6 @@ import { styles, tabBarOptions } from './styles';
import ClientRecommendation from 'scenes/recommendation/ClientRecommendation';
import WeeklyReport from 'scenes/report/WeeklyReport';
import ComingSoonPage from 'scenes/common/ComingSoonPage';
import ExtendedQuestionnaire from 'scenes/questionnaire/ExtendedQuestionnaire';
import {
ConsentForm,
......@@ -21,6 +20,8 @@ import {
} from 'scenes/questionnaire/ExtendedQuestionnaire/components';
import ReadOnlyWeeklyReport from 'scenes/report/ReadOnlyWeeklyReport';
import ChooseWeekForClient from 'scenes/report/ChooseWeekForClient';
//import ComingSoonPage from 'scenes/common/ComingSoonPage';
import ChatForClient from 'scenes/chat/ChatForClient';
interface NavRoute<T = any> {
name: string;
......@@ -154,7 +155,7 @@ const ClientNavigation: FC = () => {
/>
<ClientTab.Screen
name={ROUTES.clientChat}
component={ComingSoonPage}
component={ChatForClient}
options={{
tabBarLabel: 'Chat',
tabBarIcon: ({ color, size }) => (
......
......@@ -29,6 +29,10 @@ export interface AuthUserResponse extends User {
transaction_status: TransactionStatus | null;
is_finished_onboarding: boolean;
cart_id: number | null;
nutritionist: {
full_name_and_degree: string;
phone_number: string | null;
} | null;
}
export interface LoginRequest {
......
Markdown is supported
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