Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import classNames from 'classnames'

import {
TCACertificationProgressProviderData,
TCACertificationProgressStatus,
TCACertificationProviderData,
useGetTCACertification,
useGetTCACertificationProgress,
Expand Down Expand Up @@ -58,13 +59,15 @@ const CertificationDetailsPage: FC<{}> = () => {

const isEnrolled: boolean = progressReady && !!progress
const isNotEnrolledView: boolean = !progressReady || !progress
const isCompleted: boolean = progress?.status === TCACertificationProgressStatus.completed

function renderCertificationCurriculum(): ReactNode {
return (
<div className={classNames(styles['text-section'], isEnrolled && styles['no-top'])}>
<CertificationCurriculum
certification={certification}
isEnrolled={isEnrolled}
isCompleted={isCompleted}
certsProgress={certsProgress}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface CertificationCurriculumProps {
certification: TCACertification
certsProgress?: ReadonlyArray<LearnUserCertificationProgress>
isEnrolled: boolean
isCompleted: boolean
}

interface ProgressByIdCollection {
Expand Down Expand Up @@ -84,7 +85,10 @@ const CertificationCurriculum: FC<CertificationCurriculumProps> = (props: Certif
trackType={props.certification.certificationCategory.track}
/>
</div>
<CertificationSummary certification={props.certification} />
<CertificationSummary
certification={props.certification}
isCompleted={props.isCompleted}
/>
</div>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

> svg {
display: block;
width: 96px;
height: 96px;
@include icon-size(96);
}

:global(.body-large-bold) {
Expand All @@ -19,3 +18,11 @@
}
}
}

.completedIcon {
margin-left: auto;
svg {
@include icon-size(52);
color: $turq-75;
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { FC } from 'react'

import { IconSolid } from '../../../../../lib'
import { CertificateBadgeIcon, TCACertification } from '../../../learn-lib'

import styles from './CertificationSummary.module.scss'

interface CertificationSummaryProps {
certification: TCACertification
isCompleted?: boolean
}

const CertificationSummary: FC<CertificationSummaryProps> = (props: CertificationSummaryProps) => (
Expand All @@ -20,6 +22,11 @@ const CertificationSummary: FC<CertificationSummaryProps> = (props: Certificatio
{props.certification.title}
</span>
</div>
{props.isCompleted && (
<div className={styles.completedIcon}>
<IconSolid.CheckCircleIcon />
</div>
)}
</div>
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { TCACertification } from '../tca-certification.model'

import { TCAFccCertificationProgress } from './tca-fcc-certification-progress.model'

export type TCACertificationProgressStatus = 'enrolled' | 'completed'
export enum TCACertificationProgressStatus {
enrolled = 'enrolled',
completed = 'completed',
}

export interface TCACertificationProgress {
id: number
Expand Down