Skip to content

Commit 374e607

Browse files
committed
clean up unused props
1 parent 2a7119e commit 374e607

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/components/lesson/LessonInfo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const LessonInfo = ({ lesson, base_path, course_size }) => {
1111
const nextPath = order < course_size - 1 ? `/courses/${base_path}/${order + 1}` : undefined;
1212
return (
1313
<div className="lesson-info">
14-
<LessonNavBar order={order} base_path={base_path} course_size={course_size} prev_path={prevPath} next_path={nextPath} />
14+
<LessonNavBar className="lesson-nav" order={order} base_path={base_path} course_size={course_size} prev_path={prevPath} next_path={nextPath} />
1515
<h4 id="lesson-playing">Now playing:</h4>
1616
<h2>{title || 'Lesson'}</h2>
1717
<hr />

src/components/lesson/LessonNavBar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ LessonNavBar.propTypes = {
2525
};
2626

2727
LessonNavBar.defaultProps = {
28-
prev_path: undefined,
29-
next_path: undefined,
28+
prev_path: '',
29+
next_path: '',
3030
};
3131

3232
export default LessonNavBar;

src/components/lesson/LessonsPane.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ import { LessonLink } from '..';
44
import '../../css/lesson/LessonsPane.scss';
55
import LessonNavBar from './LessonNavBar';
66

7-
// TODO: add next and previous course buttons
87
const LessonsPane = ({ course_title, lessons, curr_lesson_num, base_path, prev_slug, next_slug }) => (
98
<div className="lessons-pane">
109
<h2>
11-
<LessonNavBar className="course-nav" prev_path={prev_slug ? `/courses/${prev_slug}/0`: undefined} next_path={next_slug ? `/courses/${next_slug}/0` : undefined} />
10+
<LessonNavBar className="course-nav" prev_path={prev_slug ? `/courses/${prev_slug}/0`: ''} next_path={next_slug ? `/courses/${next_slug}/0` : ''} />
1211
{course_title}
13-
</h2>
12+
</h2>
1413
{lessons.map(({ order, title, length }) => (
1514
<LessonLink
1615
key={order}
@@ -40,7 +39,7 @@ LessonsPane.propTypes = {
4039
};
4140

4241
LessonsPane.defaultProps = {
43-
prev_slug: undefined,
44-
next_slug: undefined,
42+
prev_slug: '',
43+
next_slug: '',
4544
};
4645
export default LessonsPane;

src/components/pages/LessonPage.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Lesson, LessonsPane } from '..';
44
import '../../css/pages/LessonPage.scss';
55

66
function LessonPage(props) {
7-
const { curr_lesson_num, lessons, base_path, course_title, prev_slug, next_slug } = props;
7+
const { curr_lesson_num, lessons, base_path } = props;
88
// const { title, src, description, id } = lessons.find(elem => elem.id === activeId);
99
const lesson = lessons[curr_lesson_num];
1010
const total = lessons.length;
@@ -13,12 +13,6 @@ function LessonPage(props) {
1313
<div className="lesson-page">
1414
<Lesson lesson={lesson} course_size={total} base_path={base_path}/>
1515
<LessonsPane
16-
// course_title={course_title}
17-
// lessons={lessons}
18-
// curr_lesson_num={curr_lesson_num}
19-
// base_path={base_path}
20-
// prev_slug={prev_slug}
21-
// next_slug={next_slug}
2216
{...props}
2317
/>
2418
</div>
@@ -38,6 +32,13 @@ LessonPage.propTypes = {
3832
}),
3933
).isRequired,
4034
base_path: PropTypes.string.isRequired,
35+
prev_slug: PropTypes.string,
36+
next_slug: PropTypes.string,
37+
};
38+
39+
LessonPage.defaultProps = {
40+
prev_slug: '',
41+
next_slug: '',
4142
};
4243

4344
export default LessonPage;

0 commit comments

Comments
 (0)