Skip to content

Commit d706a56

Browse files
authored
Merge pull request #530 from topcoder-platform/TCA-876_tca-cert-progress-in-navbar
TCA-876 - add tca-cert status in FCC sidebar -> dev
2 parents 66c7caa + f88aedd commit d706a56

File tree

9 files changed

+55
-10
lines changed

9 files changed

+55
-10
lines changed

src-ts/tools/learn/course-details/CourseDetailsPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
CoursesProviderData,
1818
CourseTitle,
1919
ResourceProviderData,
20+
TCACertificationProgressBox,
2021
useGetCertification,
2122
useGetCourses,
2223
useGetResourceProvider,
@@ -28,7 +29,6 @@ import {
2829
import { getCoursePath } from '../learn.routes'
2930

3031
import { CourseCurriculum } from './course-curriculum'
31-
import { TCACertificationBanner } from './tca-certification-banner'
3232
import styles from './CourseDetailsPage.module.scss'
3333

3434
const CourseDetailsPage: FC<{}> = () => {
@@ -194,7 +194,7 @@ const CourseDetailsPage: FC<{}> = () => {
194194
trackType={certificate?.certificationCategory.track}
195195
/>
196196

197-
<TCACertificationBanner
197+
<TCACertificationProgressBox
198198
userId={profile?.userId}
199199
className={styles.tcaCertBanner}
200200
fccCertificateId={certificate.id}

src-ts/tools/learn/course-details/tca-certification-banner/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src-ts/tools/learn/free-code-camp/FreeCodeCamp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ const FreeCodeCamp: FC<{}> = () => {
533533
currentStep={`${moduleParam}/${lessonParam}`}
534534
certificateProgress={certificateProgress}
535535
refetchProgress={refetchProgress}
536+
userId={profile?.userId}
536537
/>
537538

538539
<div className={styles['course-frame']}>

src-ts/tools/learn/free-code-camp/fcc-sidebar/FccSidebar.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@
2828
@extend .body-main-bold;
2929
flex: 0 0 auto;
3030
margin-bottom: $space-xl;
31+
margin-top: $space-lg;
3132
}

src-ts/tools/learn/free-code-camp/fcc-sidebar/FccSidebar.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { Dispatch, FC, SetStateAction, useState } from 'react'
22

3-
import { CollapsiblePane, CourseOutline, LearnCourse, LearnUserCertificationProgress } from '../../learn-lib'
3+
import {
4+
CollapsiblePane,
5+
CourseOutline,
6+
LearnCourse,
7+
LearnUserCertificationProgress,
8+
TCACertificationProgressBox,
9+
} from '../../learn-lib'
410

511
import styles from './FccSidebar.module.scss'
612

@@ -11,6 +17,7 @@ interface FccSidebarProps {
1117
courseDataReady: boolean
1218
currentStep: string
1319
refetchProgress: () => void
20+
userId?: number
1421
}
1522

1623
const FccSidebar: FC<FccSidebarProps> = (props: FccSidebarProps) => {
@@ -35,6 +42,12 @@ const FccSidebar: FC<FccSidebarProps> = (props: FccSidebarProps) => {
3542
isOpen={isOpen}
3643
>
3744
<div className={styles['course-outline-wrap']}>
45+
<TCACertificationProgressBox
46+
userId={props.userId}
47+
className={styles.tcaCertBanner}
48+
fccCertificateId={props.certificateProgress?.fccCertificationId}
49+
theme='sidebar'
50+
/>
3851
<div className={styles['course-outline-title']}>
3952
{props.courseData?.title}
4053
</div>

src-ts/tools/learn/learn-lib/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export * from './skill'
1515
export * from './sticky-sidebar'
1616
export * from './svgs'
1717
export * from './tca-certificate-preview'
18+
export * from './tca-certification-progress-box'
1819
export * from './use-certificate-canvas-hook'
1920
export * from './use-certificate-print-hook'
2021
export * from './use-certificate-scaling-hook'

src-ts/tools/learn/course-details/tca-certification-banner/TCACertificationBanner.module.scss renamed to src-ts/tools/learn/learn-lib/tca-certification-progress-box/TCACertificationProgressBox.module.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,32 @@
9393
color: $turq-75;
9494
}
9595
}
96+
97+
}
98+
99+
.wrap:global(.theme-sidebar) {
100+
background: $black-5;
101+
color: $tc-black;
102+
border: 0 none;
103+
padding: $space-lg;
104+
105+
.header {
106+
> svg {
107+
@include icon-size(36);
108+
}
109+
110+
:global(.overline) {
111+
font-size: 10px;
112+
line-height: 12px;
113+
}
114+
115+
:global(.body-main-bold) {
116+
font-size: 14px;
117+
line-height: 20px;
118+
}
119+
}
120+
121+
.statusBox {
122+
background: $tc-white;
123+
}
96124
}

src-ts/tools/learn/course-details/tca-certification-banner/TCACertificationBanner.tsx renamed to src-ts/tools/learn/learn-lib/tca-certification-progress-box/TCACertificationProgressBox.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import {
1515
useGetUserCertifications,
1616
UserCertificationProgressStatus,
1717
UserCertificationsProviderData,
18-
} from '../../learn-lib'
18+
} from '..'
1919
import { getTCACertificationPath } from '../../learn.routes'
2020

21-
import styles from './TCACertificationBanner.module.scss'
21+
import styles from './TCACertificationProgressBox.module.scss'
2222

2323
interface ProgressByIdCollection {
2424
[key: string]: LearnUserCertificationProgress
@@ -37,13 +37,14 @@ function getStatusBox(icon: ReactNode, text: string, theme: string = 'gray'): Re
3737
)
3838
}
3939

40-
export interface TCACertificationBannerProps {
40+
export interface TCACertificationProgressBoxProps {
4141
userId?: number
4242
className?: string
4343
fccCertificateId?: string
44+
theme?: 'sidebar'
4445
}
4546

46-
const TCACertificationBanner: FC<TCACertificationBannerProps> = (props: TCACertificationBannerProps) => {
47+
const TCACertificationProgressBox: FC<TCACertificationProgressBoxProps> = (props: TCACertificationProgressBoxProps) => {
4748

4849
const {
4950
certifications: tcaCertifications,
@@ -117,7 +118,7 @@ const TCACertificationBanner: FC<TCACertificationBannerProps> = (props: TCACerti
117118
}
118119

119120
return (
120-
<div className={classNames(props.className, styles.wrap)}>
121+
<div className={classNames(props.className, styles.wrap, props.theme && `theme-${props.theme}`)}>
121122
<div className={styles.header}>
122123
<CertificateBadgeIcon
123124
type={certification.certificationCategory.track}
@@ -159,4 +160,4 @@ const TCACertificationBanner: FC<TCACertificationBannerProps> = (props: TCACerti
159160
)
160161
}
161162

162-
export default TCACertificationBanner
163+
export default TCACertificationProgressBox
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as TCACertificationProgressBox } from './TCACertificationProgressBox'

0 commit comments

Comments
 (0)