Fakultas Ilmu Komputer UI

Commit b371bfcb authored by Kefas Satrio Bangkit Solidedantyo's avatar Kefas Satrio Bangkit Solidedantyo
Browse files

Chat for nutritionist

parent 218014a4
...@@ -13,19 +13,18 @@ import EmptyDataPage from '../../core/EmptyDataPage'; ...@@ -13,19 +13,18 @@ import EmptyDataPage from '../../core/EmptyDataPage';
import { Section } from 'components/layout'; import { Section } from 'components/layout';
import { UserRole } from 'services/auth/models'; import { UserRole } from 'services/auth/models';
import { FileType } from 'hooks/useDownloadFiles/schema'; import { FileType } from 'hooks/useDownloadFiles/schema';
import { redirectToWA } from 'utils/chat';
interface Props { interface Props {
role: string; role: string;
clientProfileRoute: string; clientProfileRoute: string;
clientDietReportRoute: string; clientDietReportRoute: string;
clientChatRoute: string;
} }
const ClientList: FC<Props> = ({ const ClientList: FC<Props> = ({
role, role,
clientProfileRoute, clientProfileRoute,
clientDietReportRoute, clientDietReportRoute,
clientChatRoute,
}) => { }) => {
const navigation = useNavigation(); const navigation = useNavigation();
const { isLoading, data: clients = [] } = useApi(retrieveClientListApi); const { isLoading, data: clients = [] } = useApi(retrieveClientListApi);
...@@ -81,9 +80,7 @@ const ClientList: FC<Props> = ({ ...@@ -81,9 +80,7 @@ const ClientList: FC<Props> = ({
id: client.user.id, id: client.user.id,
}); });
}} }}
onPressClientChat={() => { onPressClientChat={() => redirectToWA(client.user.phone_number)}
navigation.navigate(clientChatRoute, {});
}}
/> />
))} ))}
</ScrollView> </ScrollView>
......
...@@ -9,7 +9,6 @@ const ClientListAdmin: FC = () => { ...@@ -9,7 +9,6 @@ const ClientListAdmin: FC = () => {
role={UserRole.ADMIN} role={UserRole.ADMIN}
clientProfileRoute={ROUTES.clientProfileAdmin} clientProfileRoute={ROUTES.clientProfileAdmin}
clientDietReportRoute={ROUTES.clientDietReportAdmin} clientDietReportRoute={ROUTES.clientDietReportAdmin}
clientChatRoute={ROUTES.clientChatAdmin}
/> />
); );
}; };
......
...@@ -20,7 +20,6 @@ import { ...@@ -20,7 +20,6 @@ import {
} from 'scenes/questionnaire/ExtendedQuestionnaire/components'; } from 'scenes/questionnaire/ExtendedQuestionnaire/components';
import ReadOnlyWeeklyReport from 'scenes/report/ReadOnlyWeeklyReport'; import ReadOnlyWeeklyReport from 'scenes/report/ReadOnlyWeeklyReport';
import ChooseWeekForClient from 'scenes/report/ChooseWeekForClient'; import ChooseWeekForClient from 'scenes/report/ChooseWeekForClient';
//import ComingSoonPage from 'scenes/common/ComingSoonPage';
import ChatForClient from 'scenes/chat/ChatForClient'; import ChatForClient from 'scenes/chat/ChatForClient';
interface NavRoute<T = any> { interface NavRoute<T = any> {
......
...@@ -9,7 +9,6 @@ const ClientListNutritionist: FC = () => { ...@@ -9,7 +9,6 @@ const ClientListNutritionist: FC = () => {
role={UserRole.NUTRITIONIST} role={UserRole.NUTRITIONIST}
clientProfileRoute={ROUTES.clientProfileNutritionist} clientProfileRoute={ROUTES.clientProfileNutritionist}
clientDietReportRoute={ROUTES.weeklyReportChooseWeekForNutritionist} clientDietReportRoute={ROUTES.weeklyReportChooseWeekForNutritionist}
clientChatRoute={ROUTES.clientChatNutritionist}
/> />
); );
}; };
......
...@@ -23,6 +23,8 @@ export interface User { ...@@ -23,6 +23,8 @@ export interface User {
email: string; email: string;
name: string; name: string;
role: UserRole | null; role: UserRole | null;
phone_number: string | null;
deadline: string | null;
} }
export interface AuthUserResponse extends User { 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