Skip to content

Commit 87301a3

Browse files
committed
Update linting in learn app
1 parent 21cf282 commit 87301a3

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

src-ts/tools/learn/course-completed/CourseCompletedPage.tsx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,23 @@ const CourseCompletedPage: FC<{}> = () => {
7676
{ enabled: !!tcaCertificationName },
7777
)
7878

79-
const isLoggedIn: boolean = profileReady && !!profile
80-
const certificatesDataReady: boolean = progressReady && certifReady
81-
const tcaCertReady: boolean = progressReady && (!progress?.id || !!tcaCertifCompletedCheckReady)
82-
const ready: boolean = profileReady && courseDataReady && (
83-
!isLoggedIn || (certificatesDataReady && tcaCertReady)
84-
)
79+
const ready: boolean = useMemo(() => {
80+
const isLoggedIn: boolean = profileReady && !!profile
81+
const certificatesDataReady: boolean = progressReady && certifReady
82+
const tcaCertReady: boolean = progressReady && (!progress?.id || !!tcaCertifCompletedCheckReady)
83+
84+
return profileReady && courseDataReady && (
85+
!isLoggedIn || (certificatesDataReady && tcaCertReady)
86+
)
87+
}, [
88+
certifReady,
89+
courseDataReady,
90+
profile,
91+
profileReady,
92+
progress?.id,
93+
progressReady,
94+
tcaCertifCompletedCheckReady,
95+
])
8596

8697
const location: any = useLocation()
8798

src-ts/tools/learn/course-completed/tca-certification-view/TCACertificationView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import styles from '../CourseCompletedPage.module.scss'
1010
interface TCACertificationViewProps {
1111
courseData: LearnCourse
1212
certification?: TCACertification
13+
// eslint-disable-next-line react/no-unused-prop-types
1314
certificationParam: string
15+
// eslint-disable-next-line react/no-unused-prop-types
1416
userHandle?: string
1517
}
1618

src-ts/tools/learn/learn-lib/course-title/CourseTitle.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ const CourseTitle: FC<CourseTitleProps> = (props: CourseTitleProps) => {
3939
<div className={classNames(styles.wrap, props.size)}>
4040
<div className={classNames('badge-icon', props.size)}>
4141
{props.badgeType === TitleBadgeType.tcaCertification ? (
42-
<CertificateBadgeIcon type={props.trackType ?? 'DEV'} level={props.learnLevel!} />
42+
<CertificateBadgeIcon
43+
type={props.trackType ?? 'DEV'}
44+
level={props.learnLevel as TCACertificationLearnLevel}
45+
/>
4346
) : (
4447
<CourseBadge type={props.trackType ?? 'DEV'} />
4548
)}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const CertificateView: FC<{}> = () => {
2828
const userHandle: string = `${routeParams.memberHandle}`
2929
const certificationParam: string = routeParams.certification ?? ''
3030

31-
3231
const tcaCertificationPath: string = getTCACertificationPath(certificationParam)
3332

3433
const {

src-ts/tools/learn/tca-certificate/user-certification-view/UserCertificationPreview.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const placeholderUserProfile: UserProfile = {
1717
} as UserProfile
1818

1919
const placeholderEnrollment: TCACertificationEnrollmentBase = {
20-
completedAt: new Date().toISOString(),
20+
completedAt: new Date()
21+
.toISOString(),
2122
completionUuid: 'test-uuid',
2223
userHandle: 'your_handle',
2324
userName: 'Your Name',

0 commit comments

Comments
 (0)