|
1 | | -import { Dispatch, MutableRefObject, ReactNode, SetStateAction, useState } from 'react' |
| 1 | +import { Dispatch, SetStateAction, useState } from 'react' |
2 | 2 | import { bind } from 'lodash' |
3 | 3 |
|
4 | 4 | import { |
5 | 5 | CertificateBadgeIcon, |
6 | 6 | CourseBadge, |
| 7 | + HiringManagerView, |
7 | 8 | LearnUserCertificationProgress, |
8 | | - TCACertificatePreview, |
9 | 9 | TCACertification, |
10 | 10 | TCACertificationEnrollmentBase, |
11 | 11 | } from '~/apps/learn/src/lib' |
12 | | -import { CertificateModal } from '~/apps/learn/src/lib/components/hiring-manager-view/certificate-modal' |
13 | 12 | import { CertificateView } from '~/apps/learn/src/course-certificate/certificate-view' |
14 | 13 | import { getTCACertificationValidationUrl } from '~/apps/learn/src/learn.routes' |
15 | 14 | import { UserCompletedCertificationsData, UserProfile, useUserCompletedCertifications } from '~/libs/core' |
@@ -41,20 +40,6 @@ const MemberTCAInfo: React.FC<MemberTCAInfoProps> = (props: MemberTCAInfoProps) |
41 | 40 | LearnUserCertificationProgress | undefined, Dispatch<SetStateAction<LearnUserCertificationProgress | undefined>> |
42 | 41 | ] = useState<LearnUserCertificationProgress | undefined>(undefined) |
43 | 42 |
|
44 | | - function renderTCACertificatePreview(ref?: MutableRefObject<HTMLDivElement | any>): ReactNode { |
45 | | - return ( |
46 | | - <TCACertificatePreview |
47 | | - certification={selectedCertification?.topcoderCertification as TCACertification} |
48 | | - userName={selectedCertification?.userName || props.profile?.handle} |
49 | | - completedDate={selectedCertification?.completedAt as string} |
50 | | - completionUuid={selectedCertification?.completionUuid as string} |
51 | | - validateLink={validateLink} |
52 | | - certificateElRef={ref} |
53 | | - maxScale={Math.min()} |
54 | | - /> |
55 | | - ) |
56 | | - } |
57 | | - |
58 | 43 | function onCertClick(enrollment: TCACertificationEnrollmentBase): void { |
59 | 44 | setCertPreviewModalIsOpen(true) |
60 | 45 | setSelectedCertification(enrollment) |
@@ -126,17 +111,28 @@ const MemberTCAInfo: React.FC<MemberTCAInfoProps> = (props: MemberTCAInfoProps) |
126 | 111 | </div> |
127 | 112 |
|
128 | 113 | {certPreviewModalIsOpen && ( |
129 | | - <CertificateModal open onClose={handleHideCertPreviewModal}> |
130 | | - {renderTCACertificatePreview()} |
131 | | - </CertificateModal> |
| 114 | + <BaseModal |
| 115 | + onClose={handleHideCertPreviewModal} |
| 116 | + open |
| 117 | + size='body' |
| 118 | + theme='clear' |
| 119 | + > |
| 120 | + <HiringManagerView |
| 121 | + certification={selectedCertification?.topcoderCertification as TCACertification} |
| 122 | + completionUuid={selectedCertification?.completionUuid as string} |
| 123 | + isModalView |
| 124 | + userProfile={props.profile as UserProfile} |
| 125 | + validationUrl={validateLink} |
| 126 | + /> |
| 127 | + </BaseModal> |
132 | 128 | )} |
133 | 129 |
|
134 | 130 | {coursePreviewModalIsOpen && ( |
135 | 131 | <BaseModal |
136 | 132 | onClose={handleHideCoursePreviewModal} |
137 | 133 | open |
138 | 134 | size='body' |
139 | | - theme='clear' |
| 135 | + title='TOPCODER ACADEMY' |
140 | 136 | > |
141 | 137 | <CertificateView |
142 | 138 | certification={selectedCourse?.certification as string} |
|
0 commit comments