Skip to content

Commit 269417d

Browse files
authored
Merge pull request #499 from topcoder-platform/TCA-979
TCA-979
2 parents 3503875 + 70b9c85 commit 269417d

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

src-ts/tools/learn/learn.routes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function getUserTCACertificateUrl(
129129
export function getTCACertificationValidationUrl(
130130
completionUuid: string,
131131
): string {
132-
return `${EnvironmentConfig.TOPCODER_URLS.TCA}/${LEARN_PATHS.root}/${completionUuid}`
132+
return `${EnvironmentConfig.TOPCODER_URLS.TCA}${LEARN_PATHS.root}/${completionUuid}`
133133
}
134134

135135
export function getAuthenticateAndEnrollRoute(): string {

src-ts/tools/learn/welcome/tc-certifications/cert-card/TCCertCard.module.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@
6161
}
6262
}
6363

64+
.completed {
65+
background: $tc-white;
66+
border: 1px solid $black-20;
67+
}
68+
6469
.separatorBar {
6570
border-bottom: 2px solid $black-10;
6671
margin: $space-lg 0;
@@ -80,6 +85,12 @@
8085

8186
.cardBottom {
8287
margin-top: $space-lg;
88+
89+
.certCTAButtons {
90+
a:first-child {
91+
margin-right: $space-sm;
92+
}
93+
}
8394
}
8495

8596
.infoText {

src-ts/tools/learn/welcome/tc-certifications/cert-card/TCCertCard.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
TCACertificationProgress,
1313
TCACertificationProviderBase,
1414
} from '../../../learn-lib'
15-
import { getTCACertificationPath } from '../../../learn.routes'
15+
import { getTCACertificateUrl, getTCACertificationPath } from '../../../learn.routes'
1616

1717
import styles from './TCCertCard.module.scss'
1818

@@ -41,11 +41,22 @@ const TCCertCard: FC<TCCertCardProps> = (props: TCCertCardProps) => {
4141

4242
const isEnrolled: boolean = props.progress?.status === 'enrolled'
4343

44+
const isCompleted: boolean = props.progress?.status === 'completed'
45+
4446
function renderCta(): ReactNode {
45-
if (!isEnrolled) {
47+
if (!isEnrolled && !isCompleted) {
4648
return getCtaBtn('secondary', 'Details', getTCACertificationPath(dashedName))
4749
}
4850

51+
if (isCompleted) {
52+
return (
53+
<div className={styles.certCTAButtons}>
54+
{getCtaBtn('primary', 'View Certificate', getTCACertificateUrl(dashedName))}
55+
{getCtaBtn('secondary', 'Details', getTCACertificationPath(dashedName))}
56+
</div>
57+
)
58+
}
59+
4960
return getCtaBtn('primary', 'Resume', getTCACertificationPath(dashedName))
5061
}
5162

@@ -62,7 +73,7 @@ const TCCertCard: FC<TCCertCardProps> = (props: TCCertCardProps) => {
6273
}
6374

6475
return (
65-
<div className={styles.wrap}>
76+
<div className={classNames(styles.wrap, isCompleted && styles.completed)}>
6677
<div className={styles.cardHeader}>
6778
<CertificateBadgeIcon
6879
type={props.certification.certificationCategory.track}
@@ -130,7 +141,11 @@ const TCCertCard: FC<TCCertCardProps> = (props: TCCertCardProps) => {
130141
{props.certification.description.length > EXCERPT_TEXT_LEN ? '...' : ''}
131142
</p>
132143

133-
<SkillTags skills={skills} courseKey={dashedName} />
144+
<SkillTags
145+
skills={skills}
146+
courseKey={dashedName}
147+
theme={isCompleted ? 'gray' : 'white'}
148+
/>
134149

135150
<ProvidersLogoList
136151
className={styles.providers}

0 commit comments

Comments
 (0)