File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
learn-lib/courses-provider/courses-functions Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 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 {
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { LearnModule } from '../../lesson-provider'
44export interface LearnCourse extends LearnModelBase {
55 certification : string
66 certificationId : string
7+ completionSuggestions : Array < string >
78 estimatedCompletionTime : {
89 units : string
910 value : number
You can’t perform that action at this time.
0 commit comments