Skip to content

Commit

Permalink
add links to reach the print page
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Aug 6, 2024
1 parent 6590f1e commit f3ef9b8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 20 deletions.
10 changes: 9 additions & 1 deletion src/Components/Medicine/ManagePrescriptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ export default function ManagePrescriptions() {
const { goBack } = useAppHistory();

return (
<Page title={t("manage_prescriptions")}>
<Page
title={t("manage_prescriptions")}
options={
<ButtonV2 href="prescriptions/print">
<CareIcon icon="l-print" className="text-lg" />
Print
</ButtonV2>
}
>
<div
className="mx-auto flex w-full max-w-4xl flex-col gap-10 rounded bg-white p-6 transition-all sm:rounded-xl sm:p-12"
id="medicine-preview"
Expand Down
46 changes: 27 additions & 19 deletions src/Components/Medicine/MedicineAdministrationSheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ const MedicineAdministrationSheet = ({ readonly, is_prn }: Props) => {

const prescriptionList = [
...(data?.results ?? []),
...(showDiscontinued ? discontinuedPrescriptions.data?.results ?? [] : []),
...(showDiscontinued
? (discontinuedPrescriptions.data?.results ?? [])
: []),
];

const { activityTimelineBounds, prescriptions } = useMemo(
Expand Down Expand Up @@ -90,25 +92,31 @@ const MedicineAdministrationSheet = ({ readonly, is_prn }: Props) => {
options={
!readonly &&
!!data?.results && (
<AuthorizedForConsultationRelatedActions>
<ButtonV2
id="edit-prescription"
variant="secondary"
border
href="prescriptions"
className="w-full"
>
<CareIcon icon="l-pen" className="text-lg" />
<span className="hidden lg:block">
{t("edit_prescriptions")}
</span>
<span className="block lg:hidden">{t("edit")}</span>
<>
<AuthorizedForConsultationRelatedActions>
<ButtonV2
id="edit-prescription"
variant="secondary"
border
href="prescriptions"
className="w-full"
>
<CareIcon icon="l-pen" className="text-lg" />
<span className="hidden lg:block">
{t("edit_prescriptions")}
</span>
<span className="block lg:hidden">{t("edit")}</span>
</ButtonV2>
<BulkAdminister
prescriptions={data.results}
onDone={() => refetch()}
/>
</AuthorizedForConsultationRelatedActions>
<ButtonV2 href="prescriptions/print" ghost border>
<CareIcon icon="l-print" className="text-lg" />
Print
</ButtonV2>
<BulkAdminister
prescriptions={data.results}
onDone={() => refetch()}
/>
</AuthorizedForConsultationRelatedActions>
</>
)
}
/>
Expand Down

0 comments on commit f3ef9b8

Please sign in to comment.