Skip to content

Commit

Permalink
Merge branch 'main' into chore/update-transifex
Browse files Browse the repository at this point in the history
  • Loading branch information
NethmiRodrigo committed Jun 18, 2024
2 parents 789488e + 9b23e7d commit b1e4906
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const PrintIdentifierSticker: React.FC<PrintIdentifierStickerProps> = ({ closeMo
if (isPrinting && onBeforeGetContentResolve.current) {
onBeforeGetContentResolve.current();
}
}, [isPrinting, printIdentifierStickerSize]);
}, [isPrinting]);

const patientDetails = useMemo(() => {
if (!patient) {
Expand Down Expand Up @@ -123,10 +123,16 @@ const PrintIdentifierSticker: React.FC<PrintIdentifierStickerProps> = ({ closeMo
<ModalHeader closeModal={closeModal} title={t('printIdentifierSticker', 'Print identifier sticker')} />
<ModalBody>
<div ref={contentToPrintRef}>
<style type="text/css" media="print">
{`
@page {
size: ${printIdentifierStickerSize};
}
`}
</style>
<PrintComponent
patientDetails={patientDetails}
printIdentifierStickerFields={printIdentifierStickerFields}
printIdentifierStickerSize={printIdentifierStickerSize}
t={t}
/>
</div>
Expand All @@ -147,21 +153,9 @@ const PrintIdentifierSticker: React.FC<PrintIdentifierStickerProps> = ({ closeMo
);
};

const PrintComponent = ({
patientDetails,
printIdentifierStickerFields,
printIdentifierStickerSize,
t,
}: PrintComponentProps) => {
const PrintComponent = ({ patientDetails, printIdentifierStickerFields, t }: PrintComponentProps) => {
return (
<div className={styles.stickerContainer}>
<style type="text/css" media="print">
{`
@page {
size: ${printIdentifierStickerSize};
}
`}
</style>
{printIdentifierStickerFields.includes('name') && <div className={styles.patientName}>{patientDetails.name}</div>}
<div className={styles.detailsGrid}>
{patientDetails.identifiers.map((identifier) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,12 @@
@include type.type-style('body-01');
}
}

@media print {
html, body {
height: 100vh;
margin: 0 !important;
padding: 0 !important;
overflow: hidden;
}
}

0 comments on commit b1e4906

Please sign in to comment.