Skip to content

Commit dced9f6

Browse files
committed
use singular modular component for lesson and course navigation
1 parent 85e6463 commit dced9f6

File tree

6 files changed

+9
-35
lines changed

6 files changed

+9
-35
lines changed

src/components/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export { default as CourseInfo } from './course/CourseInfo';
1010
// ========================================
1111
// lesson
1212
export { default as LessonInfo } from './lesson/LessonInfo';
13-
export { default as LessonNav } from './lesson/LessonNav';
13+
export { default as LessonNavBar } from './lesson/LessonNavBar';
1414
export { default as LessonVideo } from './lesson/LessonVideo';
1515
export { default as LessonLink } from './lesson/LessonLink';
1616
export { default as LessonsPane } from './lesson/LessonsPane';

src/components/lesson/LessonInfo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { LessonNav } from '..';
2+
import { LessonNavBar } from '..';
33
import PropTypes from 'prop-types';
44
import '../../css/lesson/LessonInfo.scss';
55

@@ -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-
<LessonNav order={order} base_path={base_path} course_size={course_size} prev_path={prevPath} next_path={nextPath} />
14+
<LessonNavBar 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/LessonNav.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/components/lesson/CourseNav.js renamed to src/components/lesson/LessonNavBar.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import { Link } from 'react-router-dom';
33
import PropTypes from 'prop-types';
4-
import '../../css/lesson/LessonNav.scss';
4+
import '../../css/lesson/LessonNavBar.scss';
55

6-
const CourseNav = ({prev_path, next_path}) => (
6+
const LessonNavBar = ({prev_path, next_path}) => (
77
<div className="lesson-nav">
88
{ prev_path
99
? <button type="button" className='btn prev-btn'>
@@ -18,9 +18,9 @@ const CourseNav = ({prev_path, next_path}) => (
1818
</div>
1919
);
2020

21-
CourseNav.propTypes = {
21+
LessonNavBar.propTypes = {
2222
prev_path: PropTypes.string.isRequired,
2323
next_path: PropTypes.string.isRequired,
2424
};
2525

26-
export default CourseNav;
26+
export default LessonNavBar;

src/components/lesson/LessonsPane.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import { LessonLink } from '..';
44
import '../../css/lesson/LessonsPane.scss';
5-
import LessonNav from './CourseNav';
5+
import LessonNavBar from './LessonNavBar';
66

77
// TODO: add next and previous course buttons
88
const LessonsPane = ({ course_title, lessons, curr_lesson_num, base_path, prev_slug, next_slug }) => (
99
<div className="lessons-pane">
10-
<LessonNav prev_path={prev_slug ? `/courses/${prev_slug}/0`: undefined} next_path={next_slug ? `/courses/${next_slug}/0` : undefined} />
10+
<LessonNavBar prev_path={prev_slug ? `/courses/${prev_slug}/0`: undefined} next_path={next_slug ? `/courses/${next_slug}/0` : undefined} />
1111
<h2>{course_title}</h2>
1212
{lessons.map(({ order, title, length }) => (
1313
<LessonLink
File renamed without changes.

0 commit comments

Comments
 (0)