Skip to content

Commit d1288ce

Browse files
committed
TCA-1106 - add print button on certificate page
1 parent ab6c408 commit d1288ce

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src-ts/tools/learn/learn-lib/certificate-page-layout/CertificatePageLayout.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { getViewStyleParamKey } from '../../learn.routes'
2727
import { TCAShareCertificateModalData, useTCAShareCertificateModal } from '../tca-share-certificate-modal'
2828

2929
import styles from './CertificatePageLayout.module.scss'
30+
import { useCertificatePrint } from '../use-certificate-print-hook'
3031

3132
export type CertificatePageLayoutStyle = 'large-container'
3233

@@ -77,6 +78,9 @@ const CertificatePageLayout: FC<CertificatePageLayoutProps> = (props: Certificat
7778

7879
}, [props.title, getCertificateCanvas])
7980

81+
const handlePrint: () => Promise<void>
82+
= useCertificatePrint(props.certificateElRef, props.title ?? '')
83+
8084
useLayoutEffect(() => {
8185
const el: HTMLElement = wrapElRef.current
8286
if (props.fullScreenCertLayout !== true || !el) {
@@ -120,6 +124,10 @@ const CertificatePageLayout: FC<CertificatePageLayoutProps> = (props: Certificat
120124
)
121125
}
122126
>
127+
<ActionButton
128+
icon={<IconOutline.PrinterIcon />}
129+
onClick={handlePrint}
130+
/>
123131
<ActionButton
124132
icon={<IconOutline.DownloadIcon />}
125133
onClick={handleDownload}

0 commit comments

Comments
 (0)