Skip to content

Commit

Permalink
Remove redundant "Add Consultation" button (ohcnetwork#9095)
Browse files Browse the repository at this point in the history
  • Loading branch information
Srayash authored and UdaySagar-Git committed Dec 3, 2024
1 parent 17f5125 commit 68537f7
Showing 1 changed file with 0 additions and 73 deletions.
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

0 comments on commit 68537f7

Please sign in to comment.