Skip to content

Commit 49137bd

Browse files
committed
component style improvements
1 parent 996a73e commit 49137bd

File tree

25 files changed

+65
-73
lines changed

25 files changed

+65
-73
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1414
- update tutorial button
1515
- remove 'lodash' dependency
1616
- attach hints to toolbar
17-
- style fix for Atom v1.8
17+
- style fixes for Atom v1.8
1818

1919
## [0.6.0] - 2016-04-01
2020
- fixes

lib/components/App.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ var App = (function (_super) {
3535
_super.apply(this, arguments);
3636
}
3737
App.prototype.render = function () {
38-
console.log(this.props.store);
3938
return (React.createElement("section", {className: 'cr', key: 'main', style: { height: height }}, React.createElement(index_1.AppMenu, __assign({}, this.props.store)), React.createElement(Routes_1.Routes, __assign({}, this.props.store)), React.createElement(index_1.Alert, __assign({}, this.props.store))));
4039
};
4140
App = __decorate([

lib/components/Markdown/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ function formatText(text) {
2424
}
2525
;
2626
exports.Markdown = function (_a) {
27-
var children = _a.children;
28-
return (React.createElement("span", {className: 'cr-markdown', dangerouslySetInnerHTML: { __html: formatText(children) }}));
27+
var style = _a.style, children = _a.children;
28+
return (React.createElement("span", {className: 'cr-markdown', style: style ? style : null, dangerouslySetInnerHTML: { __html: formatText(children) }}));
2929
};

lib/components/Page/PageComplete/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ var styles = {
1010
padding: '10px 15px 30px',
1111
right: '0px',
1212
margin: '0',
13-
width: '400px',
13+
width: '400px'
14+
};
15+
var textStyles = {
16+
color: colors_1.grey100,
17+
fontSize: '1.1em'
1418
};
1519
exports.PageComplete = function (_a) {
1620
var page = _a.page;
1721
return (React.createElement("div", {className: 'cr-page-onComplete'}, page.completed && page.onPageComplete
18-
? React.createElement(Card_1.Card, {style: styles}, React.createElement(Card_1.CardText, null, React.createElement(index_1.Markdown, null, page.onPageComplete)))
22+
? React.createElement(Card_1.Card, {style: styles}, React.createElement(Card_1.CardText, null, React.createElement(index_1.Markdown, {style: textStyles}, page.onPageComplete)))
1923
: null));
2024
};

lib/components/Page/Tasks/Task.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
"use strict";
22
var React = require('react');
33
var index_1 = require('../../index');
4+
var TaskCheckbox_1 = require('./TaskCheckbox');
45
var List_1 = require('material-ui/List');
56
var colors_1 = require('material-ui/styles/colors');
67
function getStatus(index, taskPosition, testRun) {
7-
switch (true) {
8-
case index < taskPosition:
9-
return colors_1.lightGreen200;
10-
case testRun:
11-
return colors_1.orange200;
12-
default:
13-
return 'inherit';
14-
}
8+
return index < taskPosition ? colors_1.lightGreen200 : 'inherit';
159
}
1610
exports.Task = function (_a) {
1711
var task = _a.task, taskPosition = _a.taskPosition, index = _a.index, testRun = _a.testRun;
1812
var backgroundColor = getStatus(index, taskPosition, testRun);
19-
return (React.createElement(List_1.ListItem, {key: index, className: 'cr-task', style: { backgroundColor: backgroundColor }}, React.createElement("span", {className: 'cr-task-index'}, index + 1, "."), React.createElement("div", {className: 'cr-task-description'}, React.createElement(index_1.Markdown, null, task.description))));
13+
return (React.createElement(List_1.ListItem, {key: index, className: 'cr-task', style: { backgroundColor: backgroundColor }}, testRun ? React.createElement(TaskCheckbox_1.TaskCheckbox, null) : null, React.createElement("span", {className: 'cr-task-index'}, index + 1, "."), React.createElement("div", {className: 'cr-task-description'}, React.createElement(index_1.Markdown, null, task.description))));
2014
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"use strict";
2+
var React = require('react');
3+
var colors_1 = require('material-ui/styles/colors');
4+
var indeterminate_check_box_1 = require('material-ui/svg-icons/toggle/indeterminate-check-box');
5+
exports.TaskCheckbox = function () { return (React.createElement("span", {className: 'cr-task-checkbox'}, React.createElement(indeterminate_check_box_1.default, {color: colors_1.orange500}))); };

lib/components/Progress/ProgressChapter.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ var React = require('react');
33
var classnames = require('classnames');
44
var List_1 = require('material-ui/List');
55
var ProgressPage_1 = require('./ProgressPage');
6-
var progressIcon_1 = require('./progressIcon');
76
var index_1 = require('../index');
87
exports.ProgressChapter = function (_a) {
98
var chapter = _a.chapter, chapterIndex = _a.chapterIndex, position = _a.position;
109
var isActive = chapterIndex === position.chapter;
1110
return (React.createElement(List_1.ListItem, {key: 'c' + chapterIndex, className: classnames({
1211
'chapter': true,
1312
'isActive': isActive
14-
}), initiallyOpen: chapterIndex === 0, leftIcon: progressIcon_1.progressIcon(chapter.completed), primaryTogglesNestedList: chapterIndex === position.chapter && !chapter.completed, nestedItems: chapter.pages.map(function (page, pageIndex) { return (React.createElement(ProgressPage_1.ProgressPage, {key: chapterIndex + '_' + pageIndex, pageIndex: pageIndex, page: page, chapterIndex: chapterIndex, position: position})); })}, React.createElement("h3", null, chapterIndex + 1, ". ", chapter.title), React.createElement("span", {className: 'chapter-description'}, React.createElement(index_1.Markdown, null, chapter.description))));
13+
}), initiallyOpen: chapterIndex === 0, primaryTogglesNestedList: chapterIndex === position.chapter && !chapter.completed, nestedItems: chapter.pages.map(function (page, pageIndex) { return (React.createElement(ProgressPage_1.ProgressPage, {key: chapterIndex + '_' + pageIndex, pageIndex: pageIndex, page: page, chapterIndex: chapterIndex, position: position})); })}, React.createElement("h3", null, chapterIndex + 1, ". ", chapter.title), React.createElement("span", {className: 'chapter-description'}, React.createElement(index_1.Markdown, null, chapter.description))));
1514
};

lib/components/Progress/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ var pageStyle = {
99
margin: 0,
1010
};
1111
exports.Progress = function (_a) {
12-
var progress = _a.progress, position = _a.position;
13-
return (React.createElement(Paper_1.default, {className: 'cr-progress', style: pageStyle, zDepth: 1}, React.createElement(List_1.List, null, React.createElement(Subheader_1.default, null, "Progress"), progress.chapters.map(function (chapter, chapterIndex) { return (React.createElement(ProgressChapter_1.ProgressChapter, {chapter: chapter, chapterIndex: chapterIndex, position: position})); }))));
12+
var progress = _a.progress, position = _a.position, info = _a.info;
13+
return (React.createElement(Paper_1.default, {className: 'cr-progress', style: pageStyle, zDepth: 1}, React.createElement(List_1.List, null, React.createElement(Subheader_1.default, null, info.title), progress.chapters.map(function (chapter, chapterIndex) { return (React.createElement(ProgressChapter_1.ProgressChapter, {chapter: chapter, chapterIndex: chapterIndex, position: position})); }))));
1414
};

lib/components/Progress/progressIcon.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ function progressIcon(completed, current) {
1111
else if (current) {
1212
return React.createElement(play_circle_filled_1.default, {color: colors_1.pink500});
1313
}
14-
else if (typeof current === 'undefined') {
15-
return null;
16-
}
1714
else {
1815
return React.createElement(check_box_outline_blank_1.default, null);
1916
}

lib/components/Routes/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var Routes = (function (_super) {
2424
case 'page':
2525
return React.createElement(index_1.Page, __assign({}, this.props));
2626
case 'progress':
27-
return React.createElement(index_1.Progress, __assign({}, this.props));
27+
return React.createElement(index_1.Progress, __assign({}, this.props, {info: this.props.tutorial.info}));
2828
case 'start':
2929
return React.createElement(index_1.Start, __assign({}, this.props));
3030
case 'tutorials':

0 commit comments

Comments
 (0)