Fakultas Ilmu Komputer UI

Commit b26cd915 authored by Kefas Satrio Bangkit Solideantyo's avatar Kefas Satrio Bangkit Solideantyo
Browse files

[REFACTOR] change nutritionist's chat button redirection

parent bef1c9a0
Pipeline #84176 failed with stages
in 8 minutes and 39 seconds
......@@ -13,19 +13,18 @@ import EmptyDataPage from '../../core/EmptyDataPage';
import { Section } from 'components/layout';
import { UserRole } from 'services/auth/models';
import { FileType } from 'hooks/useDownloadFiles/schema';
import { redirectToWA } from 'utils/chat';
interface Props {
role: string;
clientProfileRoute: string;
clientDietReportRoute: string;
clientChatRoute: string;
}
const ClientList: FC<Props> = ({
role,
clientProfileRoute,
clientDietReportRoute,
clientChatRoute,
}) => {
const navigation = useNavigation();
const { isLoading, data: clients = [] } = useApi(retrieveClientListApi);
......@@ -81,9 +80,7 @@ const ClientList: FC<Props> = ({
id: client.user.id,
});
}}
onPressClientChat={() => {
navigation.navigate(clientChatRoute, {});
}}
onPressClientChat={() => redirectToWA(client.user.phone_number)}
/>
))}
</ScrollView>
......
......@@ -9,7 +9,6 @@ const ClientListAdmin: FC = () => {
role={UserRole.ADMIN}
clientProfileRoute={ROUTES.clientProfileAdmin}
clientDietReportRoute={ROUTES.clientDietReportAdmin}
clientChatRoute={ROUTES.clientChatAdmin}
/>
);
};
......
......@@ -20,7 +20,6 @@ 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> {
......
......@@ -9,7 +9,6 @@ const ClientListNutritionist: FC = () => {
role={UserRole.NUTRITIONIST}
clientProfileRoute={ROUTES.clientProfileNutritionist}
clientDietReportRoute={ROUTES.weeklyReportChooseWeekForNutritionist}
clientChatRoute={ROUTES.clientChatNutritionist}
/>
);
};
......
......@@ -23,6 +23,8 @@ export interface User {
email: string;
name: string;
role: UserRole | null;
phone_number: string | null;
deadline: string | null;
}
export interface AuthUserResponse extends User {
......
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