Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant "Add Consultation" button #9095

Merged
73 changes: 0 additions & 73 deletions src/components/Patient/PatientHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,6 @@ export const PatientHome = (props: any) => {
);
};

const isPatientEligibleForNewConsultation = (patientData: PatientModel) => {
return patientData.is_active &&
(!patientData?.last_consultation ||
patientData?.last_consultation?.discharge_date)
? true
: false;
};

return (
<Page
title={t("patient_details")}
Expand Down Expand Up @@ -1061,49 +1053,6 @@ export const PatientHome = (props: any) => {
<section className="mt-4 space-y-2 md:flex">
<div className="hidden lg:block">
<div className="mt-4 grid grid-cols-6 gap-5 xl:grid-cols-7">
<div
className={classNames(
"w-full rounded-lg border",
isPatientEligibleForNewConsultation(patientData)
? "cursor-pointer border-green-700 hover:bg-primary-400"
: "border-secondary-700 text-secondary-700 hover:cursor-not-allowed",
)}
onClick={() =>
isPatientEligibleForNewConsultation(patientData) &&
navigate(
`/facility/${patientData?.facility}/patient/${id}/consultation`,
)
}
>
<div
className={classNames(
"h-full space-y-2 rounded-lg bg-white p-4 shadow",
isPatientEligibleForNewConsultation(patientData) &&
"hover:bg-secondary-200",
)}
>
<div
className={classNames(
"text-center",
isPatientEligibleForNewConsultation(patientData) &&
"text-green-700",
)}
>
<span>
<CareIcon
icon="l-chat-bubble-user"
className="text-5xl"
/>
</span>
</div>

<div>
<p className="text-center text-sm font-medium">
Add Consultation
</p>
</div>
</div>
</div>
<div
className="w-full"
onClick={() => navigate(`/patient/${id}/investigation_reports`)}
Expand Down Expand Up @@ -1290,28 +1239,6 @@ export const PatientHome = (props: any) => {
<div className="mx-2 w-full lg:hidden">
<div className="h-full space-y-2 rounded-lg bg-white p-4 shadow">
<div className="space-y-2 border-b border-dashed text-left text-lg font-semibold text-secondary-900">
<div>
<ButtonV2
className="w-full"
disabled={
!(
patientData.is_active &&
(!patientData?.last_consultation ||
patientData?.last_consultation?.discharge_date)
)
}
onClick={() =>
navigate(
`/facility/${patientData?.facility}/patient/${id}/consultation`,
)
}
>
<span className="flex w-full items-center justify-start gap-2">
<CareIcon icon="l-chat-bubble-user" className="text-xl" />
Add Consultation
</span>
</ButtonV2>
</div>
<div>
<ButtonV2
className="w-full"
Expand Down
Loading