Skip to content

Commit

Permalink
fix scroll overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
AshrafMd-1 committed Nov 14, 2023
1 parent d411946 commit 2817c98
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions src/Components/Medicine/MedicineAdministrationSheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ const MedicineAdministrationSheet = ({ readonly, is_prn }: Props) => {
<CareIcon icon="l-arrow-down" className="animate-bounce text-2xl" />
</div>
}
disableOverlay={loading || !prescriptions?.length}
disableOverlay={
loading || !prescriptions?.length || !(prescriptions?.length > 1)
}
>
{loading && <Loading />}
{prescriptions?.length === 0 && <NoPrescriptions prn={is_prn} />}
Expand All @@ -121,23 +123,22 @@ const MedicineAdministrationSheet = ({ readonly, is_prn }: Props) => {
}}
/>
)}

{!showDiscontinued && !!discontinuedCount && (
<ButtonV2
variant="secondary"
className="group sticky left-0 w-full rounded-b-lg rounded-t-none bg-gray-100"
onClick={() => setShowDiscontinued(true)}
>
<span className="flex w-full items-center justify-start gap-1 text-xs transition-all duration-200 ease-in-out group-hover:gap-3 md:text-sm">
<CareIcon icon="l-eye" className="text-lg" />
<span>
Show <strong>{discontinuedCount}</strong> discontinued
prescription(s)
</span>
</span>
</ButtonV2>
)}
</ScrollOverlay>
{!showDiscontinued && !!discontinuedCount && (
<ButtonV2
variant="secondary"
className="group sticky left-0 w-full rounded-b-lg rounded-t-none bg-gray-100"
onClick={() => setShowDiscontinued(true)}
>
<span className="flex w-full items-center justify-start gap-1 text-xs transition-all duration-200 ease-in-out group-hover:gap-3 md:text-sm">
<CareIcon icon="l-eye" className="text-lg" />
<span>
Show <strong>{discontinuedCount}</strong> discontinued
prescription(s)
</span>
</span>
</ButtonV2>
)}
</div>
);
};
Expand Down

0 comments on commit 2817c98

Please sign in to comment.