@@ -20,11 +20,17 @@ import {
20
20
Calendar ,
21
21
Person ,
22
22
Close ,
23
+ ChevronLeft ,
23
24
} from '@openedx/paragon/icons' ;
24
25
import { useCourseDetail } from './data/queries' ;
25
26
import { buildAssetUrl } from '../util/assetUrl' ;
26
27
27
- const CourseDetailContent = ( { course, isModalView, onClose } ) => {
28
+ const CourseDetailContent = ( {
29
+ course,
30
+ isModalView,
31
+ onClose,
32
+ learningPathTitle,
33
+ } ) => {
28
34
const {
29
35
name,
30
36
shortDescription,
@@ -70,19 +76,31 @@ const CourseDetailContent = ({ course, isModalView, onClose }) => {
70
76
< div className = "hero-section p-4" >
71
77
{ ! isModalView && (
72
78
< div className = "mb-3" >
73
- < Link to = "/" style = { { fontWeight : 600 } } > Explore</ Link >
79
+ < Link to = "/" style = { { fontWeight : 600 } } className = "d-flex" >
80
+ < Icon src = { ChevronLeft } />
81
+ < span > Go Back</ span >
82
+ </ Link >
74
83
</ div >
75
84
) }
76
85
{ isModalView && (
77
- < div className = "pgn__modal-close-container" >
78
- < ModalCloseButton variant = "tertiary" onClick = { handleClose } >
79
- < Icon src = { Close } />
80
- </ ModalCloseButton >
81
- </ div >
86
+ < >
87
+ < div className = "lp-course-modal-header d-flex align-items-center justify-content-between py-2" >
88
+ { learningPathTitle && (
89
+ < h5 className = "mb-0" >
90
+ Learning Path: { learningPathTitle }
91
+ </ h5 >
92
+ ) }
93
+ < div className = "pgn__modal-close-container" >
94
+ < ModalCloseButton variant = "tertiary" onClick = { handleClose } >
95
+ < Icon src = { Close } />
96
+ </ ModalCloseButton >
97
+ </ div >
98
+ </ div >
99
+ </ >
82
100
) }
83
- < Row >
101
+ < Row className = "border-bottom border-light" >
84
102
< Col xs = { 12 } md = { 8 } >
85
- < div className = "course-type-label text-uppercase mb-2" >
103
+ < div className = "course-detail- type-label d-flex text-uppercase mb-2" >
86
104
< Icon src = { LmsBook } className = "mr-1" />
87
105
< span > Course</ span >
88
106
</ div >
@@ -185,14 +203,21 @@ CourseDetailContent.propTypes = {
185
203
} ) . isRequired ,
186
204
isModalView : PropTypes . bool ,
187
205
onClose : PropTypes . func ,
206
+ learningPathTitle : PropTypes . string ,
188
207
} ;
189
208
190
209
CourseDetailContent . defaultProps = {
191
210
isModalView : false ,
192
211
onClose : undefined ,
212
+ learningPathTitle : undefined ,
193
213
} ;
194
214
195
- const CourseDetailPage = ( { isModalView = false , onClose, courseKey : propCourseKey } ) => {
215
+ const CourseDetailPage = ( {
216
+ isModalView = false ,
217
+ onClose,
218
+ courseKey : propCourseKey ,
219
+ learningPathTitle,
220
+ } ) => {
196
221
const { courseKey : urlCourseKey } = useParams ( ) ;
197
222
const courseKey = propCourseKey || urlCourseKey ;
198
223
@@ -236,7 +261,12 @@ const CourseDetailPage = ({ isModalView = false, onClose, courseKey: propCourseK
236
261
237
262
return (
238
263
< div className = "course-detail-page" >
239
- < CourseDetailContent course = { courseWithFallbacks } isModalView = { isModalView } onClose = { onClose } />
264
+ < CourseDetailContent
265
+ course = { courseWithFallbacks }
266
+ isModalView = { isModalView }
267
+ onClose = { onClose }
268
+ learningPathTitle = { learningPathTitle }
269
+ />
240
270
</ div >
241
271
) ;
242
272
} ;
@@ -245,12 +275,14 @@ CourseDetailPage.propTypes = {
245
275
isModalView : PropTypes . bool ,
246
276
onClose : PropTypes . func ,
247
277
courseKey : PropTypes . string ,
278
+ learningPathTitle : PropTypes . string ,
248
279
} ;
249
280
250
281
CourseDetailPage . defaultProps = {
251
282
isModalView : false ,
252
283
onClose : undefined ,
253
284
courseKey : undefined ,
285
+ learningPathTitle : undefined ,
254
286
} ;
255
287
256
288
export default CourseDetailPage ;
0 commit comments