Skip to content

Commit 0cd9daa

Browse files
committed
add youtube links
1 parent 0ae2b8c commit 0cd9daa

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/components/lesson/LessonInfo.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import { LessonNav } from '..';
33
import PropTypes from 'prop-types';
44
import '../../css/lesson/LessonInfo.scss';
55

6+
const getVideoURL = embedLink => embedLink.replace('embed/', 'watch?v=');
7+
68
const 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>

src/css/lesson/LessonInfo.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
.lesson-info p {
2020
font-family: var(--fontfamily-alt);
21+
font-weight: bold;
2122
color: var(--black);
2223
}
2324

@@ -32,4 +33,13 @@
3233
.title {
3334
font-family: var(--fontfamily-roboto);
3435
// font-size: 1.1em;
36+
}
37+
38+
#yt-info a {
39+
text-decoration: none;
40+
color: var(--light-blue);
41+
}
42+
43+
#yt-info a:hover {
44+
text-decoration: underline;
3545
}

0 commit comments

Comments
 (0)