Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit d32b813

Browse files
committed
final page with styles
1 parent 49137bd commit d32b813

File tree

27 files changed

+65
-55
lines changed

27 files changed

+65
-55
lines changed

lib/actions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ exports.pageNext = page_1.pageNext;
1616
var position_1 = require('./position');
1717
exports.positionSet = position_1.positionSet;
1818
var route_1 = require('./route');
19-
exports.setRoute = route_1.setRoute;
19+
exports.routeSet = route_1.routeSet;
2020
var setup_1 = require('./setup');
2121
exports.setupVerify = setup_1.setupVerify;
2222
var test_1 = require('./test');

lib/actions/page.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use strict";
22
var _types_1 = require('./_types');
3-
var index_1 = require('./index');
43
var store_1 = require('../store');
54
var _position = {
65
chapter: 0,
@@ -17,20 +16,21 @@ function pageNext() {
1716
};
1817
}
1918
else if (chapter < chapters.length - 1) {
20-
store_1.store.dispatch(index_1.completePage());
2119
position = {
2220
chapter: chapter + 1,
2321
page: 0,
2422
};
2523
}
2624
else {
27-
store_1.store.dispatch(index_1.completeTutorial());
28-
position = {
29-
chapter: chapter,
30-
page: page
25+
return {
26+
payload: { route: 'final' },
27+
type: _types_1.ROUTE_SET,
3128
};
3229
}
33-
return { type: _types_1.PAGE_SET, payload: { position: position } };
30+
return {
31+
payload: { position: position },
32+
type: _types_1.PAGE_SET,
33+
};
3434
}
3535
exports.pageNext = pageNext;
3636
function pageSet(position) {

lib/actions/progress.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function completePage() {
99
var position = store_1.store.getState().position;
1010
var pageLength = store_1.store.getState().progress.chapters[position.chapter].pages.length;
1111
if (position.page >= pageLength - 1) {
12-
return completeChapter();
12+
store_1.store.dispatch(completeChapter());
1313
}
1414
return {
1515
payload: { position: position },
@@ -21,7 +21,7 @@ function completeChapter() {
2121
var chapter = store_1.store.getState().position.chapter;
2222
var chapterLength = store_1.store.getState().progress.chapters.length;
2323
if (chapter >= chapterLength - 1) {
24-
return completeTutorial();
24+
store_1.store.dispatch(completeTutorial());
2525
}
2626
return {
2727
payload: { chapter: chapter },

lib/actions/route.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var store_1 = require('../store');
33
var _types_1 = require('./_types');
44
var tutorial_1 = require('./tutorial');
55
var previous = null;
6-
function setRoute(route) {
6+
function routeSet(route) {
77
if (route && route !== previous) {
88
switch (route) {
99
case 'tutorials':
@@ -16,4 +16,4 @@ function setRoute(route) {
1616
};
1717
}
1818
}
19-
exports.setRoute = setRoute;
19+
exports.routeSet = routeSet;

lib/components/App.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ var App = (function (_super) {
3535
_super.apply(this, arguments);
3636
}
3737
App.prototype.render = function () {
38+
console.log(this.props.store);
3839
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))));
3940
};
4041
App = __decorate([

lib/components/AppMenu/MenuLink.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var MenuLink = (function (_super) {
2929
MenuLink = __decorate([
3030
react_redux_1.connect(null, function (dispatch) {
3131
return {
32-
routeTo: function (route) { return dispatch(actions_1.setRoute(route)); },
32+
routeTo: function (route) { return dispatch(actions_1.routeSet(route)); },
3333
};
3434
}),
3535
__metadata('design:paramtypes', [])

lib/components/Common/RouteButton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var RouteButton = (function (_super) {
2929
RouteButton = __decorate([
3030
react_redux_1.connect(null, function (dispatch) {
3131
return {
32-
routeTo: function (route) { return dispatch(actions_1.setRoute(route)); },
32+
routeTo: function (route) { return dispatch(actions_1.routeSet(route)); },
3333
};
3434
}),
3535
__metadata('design:paramtypes', [])

lib/components/FinalPage/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"use strict";
22
var React = require('react');
3-
var Paper_1 = require('material-ui/Paper');
43
var Card_1 = require('material-ui/Card');
54
var FlatButton_1 = require('material-ui/FlatButton');
6-
exports.FinalPage = function () { return (React.createElement(Paper_1.default, null, React.createElement(Card_1.Card, null, React.createElement(Card_1.CardTitle, {title: 'Congratulations!', subtitle: 'Tutorial Complete!'}), React.createElement(Card_1.CardText, null, "What's next?"), React.createElement(Card_1.CardActions, null, React.createElement("a", {href: 'https://coderoad.github.io/#tutorials'}, React.createElement(FlatButton_1.default, {label: 'See More Tutorials', disabled: true})), React.createElement("a", {href: 'https://coderoad.github.io/build'}, React.createElement(FlatButton_1.default, {label: 'Learn how to Create a Tutorial'})))))); };
5+
var styles = {
6+
margin: '5px',
7+
padding: '10px',
8+
};
9+
exports.FinalPage = function () { return (React.createElement(Card_1.Card, {style: styles}, React.createElement(Card_1.CardTitle, {title: 'Congratulations!', subtitle: 'Tutorial Complete!'}), React.createElement(Card_1.CardText, null, "What's next?", React.createElement("br", null), React.createElement("br", null), React.createElement("a", {href: 'https://coderoad.github.io/#tutorials'}, React.createElement(FlatButton_1.default, {label: 'See More Tutorials', disabled: true})), React.createElement("span", null, " (coming soon)"), React.createElement("br", null), React.createElement("br", null), React.createElement("a", {href: 'https://coderoad.github.io/build'}, React.createElement(FlatButton_1.default, {label: 'Learn how to Create a Tutorial'}))))); };

lib/components/Page/PageToolbar/Continue.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ var Continue = (function (_super) {
2828
Continue = __decorate([
2929
react_redux_1.connect(null, function (dispatch, state) {
3030
return {
31-
callNextPage: function () { return dispatch(actions_1.pageNext()); },
31+
callNextPage: function () {
32+
dispatch(actions_1.pageNext());
33+
dispatch(actions_1.testsLoad());
34+
}
3235
};
3336
}),
3437
__metadata('design:paramtypes', [])

lib/components/Page/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ var Page = (function (_super) {
3636
var _a = this.props, page = _a.page, taskPosition = _a.taskPosition, hintPosition = _a.hintPosition, tasks = _a.tasks, testRun = _a.testRun;
3737
var task = taskPosition <= tasks.length ? tasks[taskPosition] : null;
3838
var allComplete = taskPosition >= tasks.length;
39-
console.log('page', page);
4039
return (React.createElement("section", {className: 'cr-page'}, React.createElement(PageContent_1.PageContent, __assign({}, this.props)), React.createElement(Tasks_1.Tasks, __assign({}, this.props, {completed: page.completed})), React.createElement("div", {className: 'listEnd', ref: 'listEnd'}), React.createElement(PageComplete_1.PageComplete, __assign({}, this.props)), React.createElement(Hints_1.Hints, {task: task, hintPosition: hintPosition}), React.createElement(PageToolbar_1.PageToolbar, __assign({}, this.props), React.createElement(ProgressBar_1.ProgressBar, {taskPosition: taskPosition, taskCount: tasks.length, completed: page.completed}))));
4140
};
4241
return Page;

0 commit comments

Comments
 (0)