-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3ef9b8
commit 03f8926
Showing
2 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,36 @@ | ||
import { ReactNode } from "react"; | ||
import useAppHistory from "../../Common/hooks/useAppHistory"; | ||
import ButtonV2 from "../../Components/Common/components/ButtonV2"; | ||
import CareIcon from "../icons/CareIcon"; | ||
import { classNames } from "../../Utils/utils"; | ||
import Page from "../../Components/Common/components/Page"; | ||
|
||
type Props = { | ||
children: ReactNode; | ||
disabled?: boolean; | ||
className?: string; | ||
title: string; | ||
}; | ||
|
||
export default function PrintPreview(props: Props) { | ||
const { goBack } = useAppHistory(); | ||
|
||
return ( | ||
<div className="mx-auto my-8 w-[48rem]"> | ||
<div className="top-0 z-20 flex justify-end gap-2 bg-secondary-100 px-2 py-4 xl:absolute xl:right-6"> | ||
<ButtonV2 disabled={props.disabled} onClick={() => window.print()}> | ||
<CareIcon icon="l-print" className="text-lg" /> | ||
</ButtonV2> | ||
<ButtonV2 variant="secondary" onClick={() => goBack()}> | ||
<CareIcon icon="l-times" className="text-lg" /> Close | ||
</ButtonV2> | ||
</div> | ||
<Page title={props.title}> | ||
<div className="mx-auto my-8 w-[48rem]"> | ||
<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" /> | ||
</ButtonV2> | ||
</div> | ||
|
||
<div className="bg-white p-6 text-sm shadow-2xl transition-all duration-200 ease-in-out"> | ||
<div | ||
id="section-to-print" | ||
className={classNames("w-full p-4", props.className)} | ||
> | ||
{props.children} | ||
<div className="bg-white p-6 text-sm shadow-2xl transition-all duration-200 ease-in-out"> | ||
<div | ||
id="section-to-print" | ||
className={classNames("w-full p-4", props.className)} | ||
> | ||
{props.children} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</Page> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters