Skip to content

Commit f2ea3a2

Browse files
committed
rewire some lessons props'
1 parent de75d38 commit f2ea3a2

File tree

5 files changed

+46
-32
lines changed

5 files changed

+46
-32
lines changed

src/DUMMY_DATA.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ const make_rules = {
6868
length: 3603,
6969
title: 'You Make the Rules!',
7070
description: `The published D&D sourcebooks have their fair share of suggested rules... but as the DM, you have the special privilege to bend those to your will! Learn in this video how to set house rules for your campaign and your world, and begin collecting these guidelines in a Player's Guide for your party.`,
71+
yt_chan_name: 'Nerdarchy',
72+
yt_chan_src: 'https://www.youtube.com/channel/UCHLzgnQu3OWn31g2PebQV5Q',
73+
yt_title: 'How to Use House Rules in Your D&D Campaign| Game Master Tips',
74+
yt_desc: 'formatted youtube description',
75+
7176
};
7277

7378
const expectations = {

src/components/lesson/Lesson.js

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

6-
const Lesson = ({ title, src, description, order, course_size, base_path }) => (
7-
<div className="lesson" key={order}>
8-
<LessonVideo title={title} src={src} />
9-
<LessonInfo title={title} order={order} description={description} course_size={course_size} base_path={base_path} />
6+
const Lesson = ({ lesson, course_size, base_path }) => (
7+
<div className="lesson" key={lesson.order}>
8+
<LessonVideo title={lesson.title} src={lesson.src} />
9+
<LessonInfo lesson={lesson} course_size={course_size} base_path={base_path} />
1010
</div>
1111
);
1212

src/components/lesson/LessonInfo.js

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

6-
const LessonInfo = ({ title, description, order, base_path, course_size }) => (
7-
<div className="lesson-info">
8-
<LessonNav order={order} base_path={base_path} course_size={course_size} />
9-
<h4 id="lesson-playing">Now playing:</h4>
10-
<h2>{title || 'Lesson'}</h2>
11-
<hr />
12-
<p id="lesson-description">{description || 'No description provided'}</p>
13-
<hr />
14-
<div id="yt-info">
15-
{/* link to YT chan, original video name, desc */}
16-
<p id="yt-chan">
17-
<span className="title">Creator: </span>
18-
Youtube channel
19-
</p>
20-
<p id="yt-title">
21-
<span className="title">Original video title: </span>
22-
Original Youtube Title
23-
</p>
24-
<p id="yt-desc">
25-
<span className="title">Original description: </span>
26-
Youtube description
27-
</p>
6+
const LessonInfo = ({ lesson, base_path, course_size }) => {
7+
const {title, description, order, yt_chan_name, yt_chan_src, yt_title, yt_desc} = lesson;
8+
return (
9+
<div className="lesson-info">
10+
<LessonNav order={order} base_path={base_path} course_size={course_size} />
11+
<h4 id="lesson-playing">Now playing:</h4>
12+
<h2>{title || 'Lesson'}</h2>
13+
<hr />
14+
<p id="lesson-description">{description || 'No description provided'}</p>
15+
<hr />
16+
<div id="yt-info">
17+
{/* link to YT chan, original video name, desc */}
18+
<h3 className="subheader">Youtube credits</h3>
19+
<p id="yt-chan">
20+
<span className="title">Creator: </span>
21+
<a href={yt_chan_src} target="_blank" rel="noopener noreferrer">{yt_chan_name || 'YT Channel'}</a>
22+
</p>
23+
<p id="yt-title">
24+
<span className="title">Video title: </span>
25+
{yt_title || 'Original Youtube Title'}
26+
</p>
27+
<p id="yt-desc">
28+
<span className="title">Video Description: </span>
29+
{yt_desc || 'Youtube description'}
30+
</p>
31+
</div>
2832
</div>
29-
</div>
30-
);
31-
33+
);
34+
};
3235
LessonInfo.propTypes = {
3336
title: PropTypes.string.isRequired,
3437
description: PropTypes.string.isRequired,

src/components/pages/LessonPage.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import '../../css/pages/LessonPage.scss';
66
function LessonPage(props) {
77
const { curr_lesson_num, lessons, base_path } = props;
88
// const { title, src, description, id } = lessons.find(elem => elem.id === activeId);
9-
const { title, src, description, order } = lessons[curr_lesson_num];
9+
// const { title, src, description, order } = lessons[curr_lesson_num];
10+
const lesson = lessons[curr_lesson_num];
1011
const total = lessons.length;
1112

1213
return (
1314
<div className="lesson-page">
14-
<Lesson order={order} title={title} src={src} description={description} course_size={total} base_path={base_path}/>
15+
<Lesson lesson={lesson} course_size={total} base_path={base_path}/>
1516
<LessonsPane lessons={lessons} curr_lesson_num={curr_lesson_num} base_path={base_path} />
1617
</div>
1718
);

src/css/lesson/LessonInfo.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
margin: 1rem 0;
2626
}
2727

28+
.subheader {
29+
color: var(--brown);
30+
}
31+
2832
.title {
29-
font-family: var(--fontfamily);
33+
font-family: var(--fontfamily-roboto);
34+
// font-size: 1.1em;
3035
}

0 commit comments

Comments
 (0)