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

responsive print in prescription module #8330

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/CAREUI/misc/PrintPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@
export default function PrintPreview(props: Props) {
return (
<Page title={props.title}>
<div className="mx-auto my-8 w-[50rem]">
<div className="top-0 z-20 flex justify-end gap-2 bg-secondary-100 px-2 py-4 xl:absolute xl:right-6 xl:top-8">
<ButtonV2 disabled={props.disabled} onClick={() => window.print()}>
<CareIcon icon="l-print" className="text-lg" />
Print
</ButtonV2>
</div>
<div className="my-8 md:mx-auto md:w-[50rem]">
<div className="top-0 z-20 flex flex-wrap justify-end gap-2 bg-secondary-100 px-2 py-4 xl:absolute xl:right-6 xl:top-8"></div>

<div className="bg-white p-10 text-sm shadow-2xl transition-all duration-200 ease-in-out">
<div className="bg-white text-sm shadow-2xl transition-all duration-200 ease-in-out md:p-10">

Check failure on line 20 in src/CAREUI/misc/PrintPreview.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `·`
<div className="flex justify-end p-5">
<ButtonV2 disabled={props.disabled} onClick={() => window.print()}>
<CareIcon icon="l-print" className="text-lg" />
Print
</ButtonV2>
</div>
<div
id="section-to-print"
className={classNames("w-full", props.className)}
className={classNames(
"w-full scale-75 md:scale-100",
props.className,
)}
>
{props.children}
</div>
Expand Down
16 changes: 7 additions & 9 deletions src/Components/Medicine/ManagePrescriptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ export default function ManagePrescriptions() {
const { goBack } = useAppHistory();

return (
<Page
title={t("manage_prescriptions")}
options={
<ButtonV2 href="prescriptions/print">
<CareIcon icon="l-print" className="text-lg" />
Print
</ButtonV2>
}
>
<Page title={t("manage_prescriptions")}>
<div
className="mx-auto flex w-full max-w-5xl flex-col gap-10 rounded bg-white p-6 transition-all sm:rounded-xl sm:p-12"
id="medicine-preview"
>
<div className="flex justify-end">
<ButtonV2 href="prescriptions/print">
<CareIcon icon="l-print" className="text-lg" />
Print
</ButtonV2>
</div>
<div className="flex flex-col gap-10 divide-y-2 divide-dashed divide-secondary-600">
<div>
<h3 className="mb-4 text-lg font-semibold">
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Medicine/PrintPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<img className="h-10 w-auto" src={main_logo.dark} alt="care logo" />
</div>
<div className="mb-6 grid grid-cols-8 gap-y-1.5 border-2 border-secondary-400 p-2">
<PatientDetail name="Patient" className="col-span-5">
<PatientDetail name="Patient" className="col-span-5 ">

Check failure on line 55 in src/Components/Medicine/PrintPreview.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `·`
{patient && (
<>
<span className="uppercase">{patient.name}</span> -{" "}
Expand All @@ -71,7 +71,7 @@
? `${t(`encounter_suggestion__${encounter.suggestion}`)} on`
: ""
}
className="col-span-5"
className="col-span-5 "

Check failure on line 74 in src/Components/Medicine/PrintPreview.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `·`
>
{formatDate(encounter?.encounter_date)}
</PatientDetail>
Expand Down Expand Up @@ -122,7 +122,7 @@
return (
<div
className={classNames(
"inline-flex items-center whitespace-nowrap text-sm tracking-wide",
"inline-flex items-center whitespace-nowrap text-[9px] tracking-wide md:text-sm",
className,
)}
>
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = {
...defaultTheme.screens,
"3xl": "1920px",
},

extend: {
fontFamily: {
sans: ["Inter", "sans-serif"],
Expand Down
Loading