Skip to content

Commit

Permalink
Edit course duration
Browse files Browse the repository at this point in the history
  • Loading branch information
martincadoux authored and elfakamal committed Mar 8, 2018
1 parent 3552e31 commit 7081c6f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
20 changes: 20 additions & 0 deletions src/assets/scss/includes/_header.scss
Expand Up @@ -97,7 +97,27 @@
flex: 1 1 25em;
}

&__title {
$context: 24px;

font-size: em($context);
margin-bottom: em(20px, $context);
@media (min-width: 48em) {
margin-bottom: 0;
}
}

&__duration {
$context: 20px;

font-size: $context;
margin: 0;
&:before {
content: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2MCA2MCI+PHBhdGggZD0iTTMwIDBDMTMuNDU4IDAgMCAxMy40NTggMCAzMHMxMy40NTggMzAgMzAgMzAgMzAtMTMuNDU4IDMwLTMwUzQ2LjU0MiAwIDMwIDB6bTAgNThDMTQuNTYxIDU4IDIgNDUuNDM5IDIgMzBTMTQuNTYxIDIgMzAgMnMyOCAxMi41NjEgMjggMjgtMTIuNTYxIDI4LTI4IDI4eiIvPjxwYXRoIGQ9Ik0zMCA2YTEgMSAwIDAgMC0xIDF2MjNIMTRhMSAxIDAgMSAwIDAgMmgxNmExIDEgMCAwIDAgMS0xVjdhMSAxIDAgMCAwLTEtMXoiLz48L3N2Zz4=");
display: inline-block;
margin-right: em(10px, $context);
width: em(35px, $context);
vertical-align: middle;
}
}
}
13 changes: 0 additions & 13 deletions src/assets/scss/objects/_course-page.scss
Expand Up @@ -117,19 +117,6 @@
}
}

&__duration {
$context: 20px;

font-size: $context;
&:before {
content: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2MCA2MCI+PHBhdGggZD0iTTMwIDBDMTMuNDU4IDAgMCAxMy40NTggMCAzMHMxMy40NTggMzAgMzAgMzAgMzAtMTMuNDU4IDMwLTMwUzQ2LjU0MiAwIDMwIDB6bTAgNThDMTQuNTYxIDU4IDIgNDUuNDM5IDIgMzBTMTQuNTYxIDIgMzAgMnMyOCAxMi41NjEgMjggMjgtMTIuNTYxIDI4LTI4IDI4eiIvPjxwYXRoIGQ9Ik0zMCA2YTEgMSAwIDAgMC0xIDF2MjNIMTRhMSAxIDAgMSAwIDAgMmgxNmExIDEgMCAwIDAgMS0xVjdhMSAxIDAgMCAwLTEtMXoiLz48L3N2Zz4=");
display: inline-block;
margin-right: em(10px, $context);
width: em(35px, $context);
vertical-align: middle;
}
}

&__text {
h3 {
$context: 17px;
Expand Down
9 changes: 2 additions & 7 deletions src/containers/Course.jsx
Expand Up @@ -4,6 +4,7 @@ import { connect } from 'react-redux';

import Summary from '../components/Summary';

import clock from '../assets/images/icons/icon_clock.svg';
import arrow from '../assets/images/icons/icon_arrow.svg';

import {
Expand Down Expand Up @@ -139,10 +140,7 @@ export class Course extends React.Component {

render() {
const {
course: {
duration = {},
stepTitles = [],
} = {},
course: { stepTitles = [] } = {},
currentStep,
} = this.state;

Expand All @@ -161,9 +159,6 @@ export class Course extends React.Component {
/>

<article className="course__content">
{stepTitles.length > 0 && (
<h1 className="course__chapter">{currentStep + 1} - {stepTitles[currentStep]}</h1>
)}
<div className="course__text">{step.map((renderer, key) => renderer({ key }))}</div>
<div className="course__navigation">
<button
Expand Down
6 changes: 3 additions & 3 deletions src/containers/Header.jsx
Expand Up @@ -25,7 +25,7 @@ export class Header extends React.Component {
currentCourse,
} = this.props;

const headerClasses = cx('site-header container', {
const headerClasses = cx('container site-header', {
'-yellow': currentCourse.title,
});

Expand All @@ -36,8 +36,8 @@ export class Header extends React.Component {
</div>

<div className="course-header">
{currentCourse && <h2 className="course-header__title">{currentCourse.title}</h2>}
<p className="course-header__duration" data-icon={clock}>{/*course.time*/} minutes</p>
{currentCourse.title && <h2 className="course-header__title">{currentCourse.title}</h2>}
{currentCourse.time && <p className="course-header__duration" data-icon={clock}>{currentCourse.time} minutes</p>}
</div>
</nav>
);
Expand Down

0 comments on commit 7081c6f

Please sign in to comment.