@@ -3,8 +3,11 @@ import { LessonNav } from '..';
33import PropTypes from 'prop-types' ;
44import '../../css/lesson/LessonInfo.scss' ;
55
6+ const getVideoURL = embedLink => embedLink . replace ( 'embed/' , 'watch?v=' ) ;
7+
68const LessonInfo = ( { lesson, base_path, course_size } ) => {
7- const { title, description, order, yt_chan_name, yt_chan_src, yt_title, yt_desc} = lesson ;
9+ const { title, description, order, src, yt_chan_name, yt_chan_src, yt_title, yt_desc} = lesson ;
10+
811 return (
912 < div className = "lesson-info" >
1013 < LessonNav order = { order } base_path = { base_path } course_size = { course_size } />
@@ -18,15 +21,15 @@ const LessonInfo = ({ lesson, base_path, course_size }) => {
1821 < h3 className = "subheader" > Youtube credits</ h3 >
1922 < p id = "yt-chan" >
2023 < span className = "title" > Creator: </ span >
21- < a href = { yt_chan_src } target = "_blank" rel = "noopener noreferrer" > { yt_chan_name || 'YT Channel' } </ a >
24+ < a href = { yt_chan_src } target = "_blank" rel = "noopener noreferrer" > { yt_chan_name || 'YouTube Channel' } </ a >
2225 </ p >
2326 < p id = "yt-title" >
2427 < span className = "title" > Video title: </ span >
25- { yt_title || 'Original Youtube Title' }
28+ < a href = { getVideoURL ( src ) } target = "_blank" rel = "noopener noreferrer" > { yt_title || 'Original YouTube Video' } </ a >
2629 </ p >
2730 < p id = "yt-desc" >
2831 < span className = "title" > Video Description: </ span >
29- { yt_desc || 'Youtube description' }
32+ { yt_desc || 'YouTube description' }
3033 </ p >
3134 </ div >
3235 </ div >
0 commit comments