Skip to content

Commit b151d73

Browse files
authored
Merge pull request #635 from topcoder-platform/profiles-app
MP-17 qa fixes & tca view
2 parents ecd93dc + aeac0a9 commit b151d73

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed

src/apps/profiles/src/member-badges/MemberBadgesPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const MemberBadgesPage: FC<{}> = () => {
5555
<ContentLayout
5656
outerClass={styles.container}
5757
>
58-
<div className={styles.backLink}>
58+
<Link to={`/${profile?.handle}`} className={styles.backLink}>
5959
<svg
6060
xmlns='http://www.w3.org/2000/svg'
6161
width='14'
@@ -71,8 +71,8 @@ const MemberBadgesPage: FC<{}> = () => {
7171
clipRule='evenodd'
7272
/>
7373
</svg>
74-
<Link to={`/profiles/${profile?.handle}`}>Return to Profile</Link>
75-
</div>
74+
Return to Profile
75+
</Link>
7676

7777
<div className={styles.badgesWrapper}>
7878
<h3>COMMUNITY AWARDS & HONORS</h3>

src/apps/profiles/src/member-profile/tca-info/MemberTCAInfo.tsx

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import { Dispatch, MutableRefObject, ReactNode, SetStateAction, useState } from 'react'
1+
import { Dispatch, SetStateAction, useState } from 'react'
22
import { bind } from 'lodash'
33

44
import {
55
CertificateBadgeIcon,
66
CourseBadge,
7+
HiringManagerView,
78
LearnUserCertificationProgress,
8-
TCACertificatePreview,
99
TCACertification,
1010
TCACertificationEnrollmentBase,
1111
} from '~/apps/learn/src/lib'
12-
import { CertificateModal } from '~/apps/learn/src/lib/components/hiring-manager-view/certificate-modal'
1312
import { CertificateView } from '~/apps/learn/src/course-certificate/certificate-view'
1413
import { getTCACertificationValidationUrl } from '~/apps/learn/src/learn.routes'
1514
import { UserCompletedCertificationsData, UserProfile, useUserCompletedCertifications } from '~/libs/core'
@@ -41,20 +40,6 @@ const MemberTCAInfo: React.FC<MemberTCAInfoProps> = (props: MemberTCAInfoProps)
4140
LearnUserCertificationProgress | undefined, Dispatch<SetStateAction<LearnUserCertificationProgress | undefined>>
4241
] = useState<LearnUserCertificationProgress | undefined>(undefined)
4342

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-
5843
function onCertClick(enrollment: TCACertificationEnrollmentBase): void {
5944
setCertPreviewModalIsOpen(true)
6045
setSelectedCertification(enrollment)
@@ -126,17 +111,28 @@ const MemberTCAInfo: React.FC<MemberTCAInfoProps> = (props: MemberTCAInfoProps)
126111
</div>
127112

128113
{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>
132128
)}
133129

134130
{coursePreviewModalIsOpen && (
135131
<BaseModal
136132
onClose={handleHideCoursePreviewModal}
137133
open
138134
size='body'
139-
theme='clear'
135+
title='TOPCODER ACADEMY'
140136
>
141137
<CertificateView
142138
certification={selectedCourse?.certification as string}

0 commit comments

Comments
 (0)