Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd32b813

Browse files
committed
final page with styles
1 parent49137bd commitd32b813

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
varposition_1=require('./position');
1717
exports.positionSet=position_1.positionSet;
1818
varroute_1=require('./route');
19-
exports.setRoute=route_1.setRoute;
19+
exports.routeSet=route_1.routeSet;
2020
varsetup_1=require('./setup');
2121
exports.setupVerify=setup_1.setupVerify;
2222
vartest_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-
varindex_1=require('./index');
43
varstore_1=require('../store');
54
var_position={
65
chapter:0,
@@ -17,20 +16,21 @@ function pageNext() {
1716
};
1817
}
1918
elseif(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
functionpageSet(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
varposition=store_1.store.getState().position;
1010
varpageLength=store_1.store.getState().progress.chapters[position.chapter].pages.length;
1111
if(position.page>=pageLength-1){
12-
returncompleteChapter();
12+
store_1.store.dispatch(completeChapter());
1313
}
1414
return{
1515
payload:{position:position},
@@ -21,7 +21,7 @@ function completeChapter() {
2121
varchapter=store_1.store.getState().position.chapter;
2222
varchapterLength=store_1.store.getState().progress.chapters.length;
2323
if(chapter>=chapterLength-1){
24-
returncompleteTutorial();
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
vartutorial_1=require('./tutorial');
55
varprevious=null;
6-
functionsetRoute(route){
6+
functionrouteSet(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){returndispatch(actions_1.setRoute(route));},
32+
routeTo:function(route){returndispatch(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){returndispatch(actions_1.setRoute(route));},
32+
routeTo:function(route){returndispatch(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
varReact=require('react');
3-
varPaper_1=require('material-ui/Paper');
43
varCard_1=require('material-ui/Card');
54
varFlatButton_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+
varstyles={
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(){returndispatch(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
vartask=taskPosition<=tasks.length ?tasks[taskPosition] :null;
3838
varallComplete=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
returnPage;

‎lib/components/Progress/ProgressPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var ProgressPage = (function (_super) {
5050
selectPage:function(position){
5151
dispatch(actions_1.pageSet(position));
5252
dispatch(actions_1.testsLoad());
53-
dispatch(actions_1.setRoute('page'));
53+
dispatch(actions_1.routeSet('page'));
5454
}
5555
};
5656
}),

‎lib/components/Tutorials/SelectTutorial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var SelectTutorial = (function (_super) {
4343
dispatch(actions_1.tutorialSet(name));
4444
dispatch(actions_1.positionSet({chapter:0,page:0}));
4545
dispatch(actions_1.progressLoad());
46-
dispatch(actions_1.setRoute('progress'));
46+
dispatch(actions_1.routeSet('progress'));
4747
},
4848
};
4949
}),

‎lib/reducers/test-run/test-result.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
varstore_1=require('../../store');
33
varactions_1=require('../../actions');
44
functionhandleResult(result){
5-
console.log('handleRes',result);
65
store_1.store.dispatch(actions_1.testComplete());
76
if(result.completed){
87
store_1.store.dispatch(actions_1.testResult(result));

‎src/actions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export {
55
export{hintShow,hintPositionSet}from'./hint';
66
export{pageSet,pageNext}from'./page';
77
export{positionSet}from'./position';
8-
export{setRoute}from'./route';
8+
export{routeSet}from'./route';
99
export{setupVerify}from'./setup';
1010
export{
1111
testRun,testComplete,testResult,testsLoad

‎src/actions/page.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import{ROUTE_SET,PAGE_SET}from'./_types';
2-
import{completePage,completeTutorial}from'./index';
32
import{store}from'../store';
43

54
const_position={
@@ -17,19 +16,20 @@ export function pageNext(): Action {
1716
page:page+1,
1817
};
1918
}elseif(chapter<chapters.length-1){
20-
store.dispatch(completePage());
2119
position={
2220
chapter:chapter+1,
2321
page:0,
2422
};
2523
}else{
26-
store.dispatch(completeTutorial());
27-
position={
28-
chapter,
29-
page
24+
return{
25+
payload:{route:'final'},
26+
type:ROUTE_SET,
3027
};
3128
}
32-
return{type:PAGE_SET,payload:{ position}};
29+
return{
30+
payload:{ position},
31+
type:PAGE_SET,
32+
};
3333
}
3434

3535
exportfunctionpageSet(

‎src/actions/progress.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function completePage(): Action {
1111
constposition:CR.Position=store.getState().position;
1212
constpageLength:number=store.getState().progress.chapters[position.chapter].pages.length;
1313
if(position.page>=pageLength-1){
14-
returncompleteChapter();
14+
store.dispatch(completeChapter());
1515
}
1616
return{
1717
payload:{ position},
@@ -23,7 +23,7 @@ export function completeChapter(): Action {
2323
constchapter:number=store.getState().position.chapter;
2424
constchapterLength:number=store.getState().progress.chapters.length;
2525
if(chapter>=chapterLength-1){
26-
returncompleteTutorial();
26+
store.dispatch(completeTutorial());
2727
}
2828
return{
2929
payload:{ chapter},

‎src/actions/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {tutorialsFind} from './tutorial';
55
letprevious=null;
66

77
/* Navigation */
8-
exportfunctionsetRoute(route:string):Action{
8+
exportfunctionrouteSet(route:string):Action{
99
if(route&&route!==previous){
1010

1111
// preloading for routes

‎src/components/AppMenu/MenuLink.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import*asReactfrom'react';
22
import{connect}from'react-redux';
33
importMenuItemfrom'material-ui/MenuItem';
4-
import{pageSet,setRoute}from'../../actions';
4+
import{pageSet,routeSet}from'../../actions';
55

66
@connect(null,(dispatch)=>{
77
return{
8-
routeTo:(route:string)=>dispatch(setRoute(route)),
8+
routeTo:(route:string)=>dispatch(routeSet(route)),
99
};
1010
})
1111
exportclassMenuLinkextendsReact.Component<{

‎src/components/Common/RouteButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import*asReactfrom'react';
22
import{connect}from'react-redux';
3-
import{setRoute}from'../../actions';
3+
import{routeSet}from'../../actions';
44
importFlatButtonfrom'material-ui/FlatButton';
55

66
@connect(null,(dispatch)=>{
77
return{
8-
routeTo:(route:string)=>dispatch(setRoute(route)),
8+
routeTo:(route:string)=>dispatch(routeSet(route)),
99
};
1010
})
1111
exportclassRouteButtonextendsReact.Component<{

‎src/components/FinalPage/index.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,32 @@ import Divider from 'material-ui/Divider';
55
import{Card,CardTitle,CardText,CardActions}from'material-ui/Card';
66
importFlatButtonfrom'material-ui/FlatButton';
77

8+
conststyles={
9+
margin:'5px',
10+
padding:'10px',
11+
};
12+
813
exportconstFinalPage:React.StatelessComponent<{}>=()=>(
9-
<Paper>
10-
<Card>
14+
<Cardstyle={styles}>
1115
<CardTitle
1216
title='Congratulations!'
1317
subtitle='Tutorial Complete!'
1418
/>
1519
<CardText>
1620
What's next?
17-
</CardText>
18-
<CardActions>
21+
<br/><br/>
1922
<ahref='https://coderoad.github.io/#tutorials'>
2023
<FlatButton
2124
label='See More Tutorials'
2225
disabled={true}
2326
/>
2427
</a>
28+
<span> (coming soon)</span>
29+
<br/><br/>
2530
<ahref='https://coderoad.github.io/build'>
2631
<FlatButtonlabel='Learn how to Create a Tutorial'/>
2732
</a>
28-
</CardActions>
33+
</CardText>
34+
2935
</Card>
30-
</Paper>
3136
);

‎src/components/Page/PageToolbar/Continue.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import*asReactfrom'react';
22
import{connect}from'react-redux';
33
importFlatButtonfrom'material-ui/FlatButton';
4-
import{pageNext}from'../../../actions';
4+
import{pageNext,testsLoad}from'../../../actions';
55

66
@connect(null,(dispatch,state)=>{
77
return{
8-
callNextPage:()=>dispatch(pageNext()),
8+
callNextPage:()=>{
9+
dispatch(pageNext());
10+
dispatch(testsLoad());
11+
}
912
};
1013
})
1114
exportclassContinueextendsReact.Component<{

‎src/components/Page/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ render() {
2929
const{page, taskPosition, hintPosition, tasks, testRun}=this.props;
3030
consttask=taskPosition<=tasks.length ?tasks[taskPosition] :null;
3131
constallComplete=taskPosition>=tasks.length;
32-
console.log('page',page);
3332
return(
3433
<sectionclassName='cr-page'>
3534
<PageContent{...this.props}/>

‎src/components/Progress/ProgressPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import*asReactfrom'react';
22
import{connect}from'react-redux';
3-
import{pageSet,setRoute,testsLoad}from'../../actions';
3+
import{pageSet,routeSet,testsLoad}from'../../actions';
44
import*asclassnamesfrom'classnames';
55
import{ListItem}from'material-ui/List';
66
import{progressIcon}from'./progressIcon';
@@ -11,7 +11,7 @@ import {grey400} from 'material-ui/styles/colors';
1111
selectPage:(position:CR.Position)=>{
1212
dispatch(pageSet(position));
1313
dispatch(testsLoad());
14-
dispatch(setRoute('page'));
14+
dispatch(routeSet('page'));
1515
}
1616
};
1717
})

‎src/components/Tutorials/SelectTutorial.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import{connect}from'react-redux';
33
importFlatButtonfrom'material-ui/FlatButton';
44
import{
5-
positionSet,tutorialSet,progressLoad,setRoute
5+
positionSet,tutorialSet,progressLoad,routeSet
66
}from'../../actions';
77

88
functiondisplayName(name:string):string{
@@ -20,12 +20,12 @@ function displayName(name: string): string {
2020
dispatch(tutorialSet(name));
2121
dispatch(positionSet({chapter:0,page:0}));
2222
dispatch(progressLoad());
23-
dispatch(setRoute('progress'));
23+
dispatch(routeSet('progress'));
2424
},
2525
};
2626
})
2727
exportclassSelectTutorialextendsReact.Component<{
28-
tutorial:Tutorial.Info,selectTutorial?:any
28+
tutorial:CR.Tutorial,selectTutorial?:any
2929
},{}>{
3030
render(){
3131
const{tutorial, selectTutorial}=this.props;

‎src/components/app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ window.onresize = function() {
1313
})
1414
exportclassAppextendsReact.Component<{store?:CR.State},{}>{
1515
render():React.ReactElement<{}>{
16+
console.log(this.props.store);
1617
return(
1718
<section
1819
className='cr'

‎src/reducers/route/route.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ describe('route', () => {
66

77
describe('ROUTE_SET',()=>{
88
it('changes the store path',()=>{
9-
constaction:Action=Action.setRoute('page');
9+
constaction:Action=Action.routeSet('page');
1010
expect(reducer({},action).route).to.equal('page');
1111
});
1212

1313
it('updates an existing store path',()=>{
1414
conststate={route:'page'};
15-
constaction:Action=Action.setRoute('progress');
15+
constaction:Action=Action.routeSet('progress');
1616
expect(reducer(state,action).route).to.equal('progress');
1717
});
1818
});

‎src/reducers/test-run/test-result.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import {store} from '../../store';
22
import{testResult,completePage,testComplete}from'../../actions';
33

44
exportfunctionhandleResult(result:Test.Result):void{
5-
6-
console.log('handleRes',result);
7-
85
store.dispatch(testComplete());
96

107
if(result.completed){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp