Skip to content

Commit 82e9d20

Browse files
TCA-488 clean-up
1 parent b400f08 commit 82e9d20

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src-ts/tools/learn/course-certificate/certificate-view/CertificateView.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,17 @@ const CertificateView: FC<CertificateViewProps> = (props: CertificateViewProps)
5252
ready: courseReady,
5353
}: CoursesProviderData = useCourses(props.provider, props.certification)
5454

55-
const certificationTitle: string = `${userName || props.profile.handle} - ${course?.title} Certification`
55+
function getCertTitle(user: string): string {
56+
return `${user} - ${course?.title} Certification`
57+
}
58+
59+
const certificationTitle: string = getCertTitle(userName || props.profile.handle)
5660

5761
const certUrl: string = getUserCertificateSsr(
5862
props.provider,
5963
props.certification,
6064
props.profile.handle,
61-
`${props.profile.handle} - ${course?.title} Certification`,
65+
getCertTitle(props.profile.handle),
6266
)
6367

6468
const {

0 commit comments

Comments
 (0)