@@ -10,13 +10,10 @@ import { useSearchParams } from 'react-router-dom'
10
10
import classNames from 'classnames'
11
11
12
12
import {
13
- FacebookSocialShareBtn ,
14
13
fileDownloadCanvasAsImage ,
15
14
IconOutline ,
16
- LinkedinSocialShareBtn ,
17
15
LoadingSpinner ,
18
16
NavigateBackFunction ,
19
- TwitterSocialShareBtn ,
20
17
useNavigateBack ,
21
18
} from '../../../../lib'
22
19
import { useCertificateScaling } from '../use-certificate-scaling-hook'
@@ -25,6 +22,7 @@ import { ActionButton } from '../action-button'
25
22
import { hideSiblings } from '../functions'
26
23
import { getViewStyleParamKey } from '../../learn.routes'
27
24
import { TCAShareCertificateModalData , useTCAShareCertificateModal } from '../tca-share-certificate-modal'
25
+ import { useCertificatePrint } from '../use-certificate-print-hook'
28
26
29
27
import styles from './CertificatePageLayout.module.scss'
30
28
@@ -77,6 +75,9 @@ const CertificatePageLayout: FC<CertificatePageLayoutProps> = (props: Certificat
77
75
78
76
} , [ props . title , getCertificateCanvas ] )
79
77
78
+ const handlePrint : ( ) => Promise < void >
79
+ = useCertificatePrint ( props . certificateElRef , props . title ?? '' )
80
+
80
81
useLayoutEffect ( ( ) => {
81
82
const el : HTMLElement = wrapElRef . current
82
83
if ( props . fullScreenCertLayout !== true || ! el ) {
@@ -120,6 +121,10 @@ const CertificatePageLayout: FC<CertificatePageLayoutProps> = (props: Certificat
120
121
)
121
122
}
122
123
>
124
+ < ActionButton
125
+ icon = { < IconOutline . PrinterIcon /> }
126
+ onClick = { handlePrint }
127
+ />
123
128
< ActionButton
124
129
icon = { < IconOutline . DownloadIcon /> }
125
130
onClick = { handleDownload }
0 commit comments