Skip to content

Commit 2a7119e

Browse files
committed
update styles for nav buttons
1 parent c376589 commit 2a7119e

File tree

3 files changed

+39
-14
lines changed

3 files changed

+39
-14
lines changed

src/components/lesson/LessonNavBar.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Link } from 'react-router-dom';
33
import PropTypes from 'prop-types';
44
import '../../css/lesson/LessonNavBar.scss';
55

6-
const LessonNavBar = ({prev_path, next_path}) => (
7-
<div className="lesson-nav">
6+
const LessonNavBar = ({prev_path, next_path, className}) => (
7+
<div className={`lesson-nav-bar ${className}`}>
88
{ prev_path
99
? <button type="button" className='btn prev-btn'>
1010
<Link to={prev_path} >← Prev</Link>
@@ -21,6 +21,7 @@ const LessonNavBar = ({prev_path, next_path}) => (
2121
LessonNavBar.propTypes = {
2222
prev_path: PropTypes.string,
2323
next_path: PropTypes.string,
24+
className: PropTypes.string.isRequired,
2425
};
2526

2627
LessonNavBar.defaultProps = {

src/components/lesson/LessonsPane.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import LessonNavBar from './LessonNavBar';
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-
<LessonNavBar prev_path={prev_slug ? `/courses/${prev_slug}/0`: undefined} next_path={next_slug ? `/courses/${next_slug}/0` : undefined} />
11-
<h2>{course_title}</h2>
10+
<h2>
11+
<LessonNavBar className="course-nav" prev_path={prev_slug ? `/courses/${prev_slug}/0`: undefined} next_path={next_slug ? `/courses/${next_slug}/0` : undefined} />
12+
{course_title}
13+
</h2>
1214
{lessons.map(({ order, title, length }) => (
1315
<LessonLink
1416
key={order}

src/css/lesson/LessonNavBar.scss

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
1-
.lesson-nav {
2-
margin-top: -1rem;
3-
margin-bottom: 2rem;
4-
1+
.lesson-nav-bar {
52
.btn {
63
border: none;
74

85
a {
96
font-family: var(--fontfamily);
10-
background-color: var(--navy);
117
font-size: 1rem;
128
height: 100%;
139
width: 100%;
10+
background-color: var(--navy);
1411
color:var(--cream);
1512
text-decoration: none;
16-
padding: 0.75rem 1.5rem;
17-
}
1813

19-
a:hover {
20-
background-color: var(--brown);
2114
}
2215
}
2316

@@ -30,7 +23,36 @@
3023
}
3124
}
3225

33-
.lesson-nav:after {
26+
.lesson-nav {
27+
margin-top: -1rem;
28+
margin-bottom: 2rem;
29+
30+
a {
31+
background-color: var(--navy);
32+
color:var(--cream);
33+
padding: 0.75rem 1.5rem;
34+
}
35+
& a:hover {
36+
background-color: var(--brown);
37+
}
38+
}
39+
40+
.course-nav {
41+
margin-bottom: 1rem;
42+
a {
43+
display: inline-block;
44+
padding: 0.75rem 0;
45+
}
46+
a:hover {
47+
text-decoration: underline;
48+
}
49+
}
50+
51+
52+
53+
54+
// clear floats
55+
.lesson-nav-bar:after {
3456
content: '';
3557
display: block;
3658
clear: both;

0 commit comments

Comments
 (0)