Skip to content

Commit 8d89e85

Browse files
authored
Merge pull request #297 from topcoder-platform/TCA-428_ui-for-course-instructions
TCA-428 - add "completion suggestions" on course landing page
2 parents 6233f09 + f4d55e5 commit 8d89e85

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

src-ts/tools/learn/course-details/CourseDetailsPage.module.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@
4747
@extend .body-main;
4848
margin-top: $space-xxl;
4949
}
50-
50+
5151
p {
5252
margin: $space-sm 0;
5353
}
54+
55+
:global(.details.mtop) {
56+
margin-top: $space-xxl;
57+
}
5458
}
5559

5660
.coming-soon {

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,27 @@ const CourseDetailsPage: FC<{}> = () => {
9999
)
100100
}
101101

102+
function getCompletionSuggestion(): ReactNode {
103+
if (!course) {
104+
return
105+
}
106+
107+
return progress?.status === UserCertificationProgressStatus.completed ? (
108+
<></>
109+
) : (
110+
!!course.completionSuggestions?.length && (
111+
<>
112+
<h3 className='details mtop'>Suggestions for completing this course</h3>
113+
114+
<div
115+
className={styles['text']}
116+
dangerouslySetInnerHTML={{ __html: (course.completionSuggestions ?? []).join('<br /><br />') }}
117+
></div>
118+
</>
119+
)
120+
)
121+
}
122+
102123
function getFooter(): ReactNode {
103124
if (!resourceProvider) {
104125
return
@@ -141,6 +162,7 @@ const CourseDetailsPage: FC<{}> = () => {
141162

142163
<div className={styles['description']}>
143164
{getDescription()}
165+
{getCompletionSuggestion()}
144166
<div className={styles['coming-soon']}>
145167
<PromoCourse />
146168
</div>

src-ts/tools/learn/learn-lib/courses-provider/courses-functions/learn-course.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { LearnModule } from '../../lesson-provider'
44
export interface LearnCourse extends LearnModelBase {
55
certification: string
66
certificationId: string
7+
completionSuggestions: Array<string>
78
estimatedCompletionTime: {
89
units: string
910
value: number

0 commit comments

Comments
 (0)