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

Commit512e0d3

Browse files
committed
turn styles into objects, fix action link
1 parent7573f3a commit512e0d3

File tree

7 files changed

+74
-67
lines changed

7 files changed

+74
-67
lines changed

‎lib/components/Page/Task/index.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,23 @@ var taskCheckbox_1 = require('./taskCheckbox');
55
varList_1=require('material-ui/List');
66
varcolors_1=require('material-ui/styles/colors');
77
varstyles={
8-
margin:'5px',
9-
padding:'5px',
10-
position:'relative'
11-
};
12-
varindexStyles={
13-
position:'absolute',
14-
top:'20px',
15-
left:'45px',
16-
};
17-
vardescriptionStyles={
18-
backgroundColor:'inherit',
19-
paddingTop:'-10px',
20-
paddingLeft:'55px',
21-
fontSize:'14px',
22-
lineHeight:'1.6',
8+
task:{
9+
margin:'5px',
10+
padding:'5px',
11+
position:'relative'
12+
},
13+
index:{
14+
position:'absolute',
15+
top:'20px',
16+
left:'45px',
17+
},
18+
description:{
19+
backgroundColor:'inherit',
20+
paddingTop:'-10px',
21+
paddingLeft:'55px',
22+
fontSize:'14px',
23+
lineHeight:'1.6',
24+
},
2325
};
2426
functiongetStatus(index,taskPosition,testRun){
2527
returnindex<taskPosition ?colors_1.lightGreen200 :'inherit';
@@ -28,7 +30,7 @@ var Task = function (_a) {
2830
vartask=_a.task,taskPosition=_a.taskPosition,index=_a.index,testRun=_a.testRun;
2931
varbackgroundColor=getStatus(index,taskPosition,testRun);
3032
varisCurrentTask=taskPosition===index;
31-
return(React.createElement(List_1.ListItem,{key:index,style:Object.assign({},styles,{backgroundColor:backgroundColor})},taskCheckbox_1.default(isCurrentTask,testRun),React.createElement("span",{style:indexStyles},index+1,"."),React.createElement("div",{style:descriptionStyles},React.createElement(index_1.Markdown,null,task.description))));
33+
return(React.createElement(List_1.ListItem,{key:index,style:Object.assign({},styles.task,{backgroundColor:backgroundColor})},taskCheckbox_1.default(isCurrentTask,testRun),React.createElement("span",{style:styles.index},index+1,"."),React.createElement("div",{style:styles.description},React.createElement(index_1.Markdown,null,task.description))));
3234
};
3335
Object.defineProperty(exports,"__esModule",{value:true});
3436
exports.default=Task;

‎lib/components/Page/TasksComplete/index.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@ var Card_1 = require('material-ui/Card');
44
varindex_1=require('../../index');
55
varcolors_1=require('material-ui/styles/colors');
66
varstyles={
7-
backgroundColor:colors_1.cyan500,
8-
margin:'10px 5px',
9-
};
10-
vartextStyles={
11-
color:colors_1.grey100,
12-
fontSize:'1.1em'
7+
card:{
8+
backgroundColor:colors_1.cyan500,
9+
margin:'10px 5px',
10+
},
11+
text:{
12+
color:colors_1.grey100,
13+
fontSize:'1.1em'
14+
},
1315
};
1416
varTasksComplete=function(_a){
1517
varpage=_a.page,completed=_a.completed;
1618
if(!completed||!page.onPageComplete){
1719
returnnull;
1820
}
19-
return(React.createElement(Card_1.Card,{style:styles},React.createElement(Card_1.CardText,null,React.createElement(index_1.Markdown,{style:textStyles},page.onPageComplete))));
21+
return(React.createElement(Card_1.Card,{style:styles.card},React.createElement(Card_1.CardText,null,React.createElement(index_1.Markdown,{style:styles.text},page.onPageComplete))));
2022
};
2123
Object.defineProperty(exports,"__esModule",{value:true});
2224
exports.default=TasksComplete;

‎lib/components/Progress/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ var List_1 = require('material-ui/List');
2020
varSubheader_1=require('material-ui/Subheader');
2121
varProgressPage_1=require('./ProgressPage');
2222
varactions_1=require('../../modules/progress/actions');
23-
varpageStyle={
24-
width:'100%',
25-
};
26-
varlistStyle={
27-
margin:'5px',
23+
varstyles={
24+
page:{
25+
width:'100%',
26+
},
27+
list:{
28+
margin:'5px',
29+
},
2830
};
2931
varProgress=(function(_super){
3032
__extends(Progress,_super);
@@ -36,7 +38,7 @@ var Progress = (function (_super) {
3638
};
3739
Progress.prototype.render=function(){
3840
var_a=this.props,progress=_a.progress,pagePosition=_a.pagePosition,info=_a.info,tutorial=_a.tutorial;
39-
return(React.createElement(Paper_1.default,{style:pageStyle},React.createElement(List_1.List,{style:listStyle},React.createElement(Subheader_1.default,null,info.name),tutorial.pages.map(function(page,index){return(React.createElement(ProgressPage_1.default,{key:index,index:index,page:page,pagePosition:pagePosition,progress:progress}));}))));
41+
return(React.createElement(Paper_1.default,{style:styles.page},React.createElement(List_1.List,{style:styles.list},React.createElement(Subheader_1.default,null,info.name),tutorial.pages.map(function(page,index){return(React.createElement(ProgressPage_1.default,{key:index,index:index,page:page,pagePosition:pagePosition,progress:progress}));}))));
4042
};
4143
Progress=__decorate([
4244
react_redux_1.connect(null,function(dispatch){

‎src/actions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export {setupVerify, setupPackage} from './modules/setup/actions';
66
export{tutorialSet}from'./modules/tutorial';
77
export{tutorialsFind,tutorialUpdate}from'./modules/tutorials';
88

9-
109
export{alertOpen,alertClose,alertReplay}from'core-coderoad/lib/alert';
1110
export{editorDevToolsToggle,editorOpen,editorInsert,
1211
editorSave,editorSet}from'core-coderoad/lib/editor';

‎src/components/Page/Task/index.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ import {ListItem} from 'material-ui/List';
55
import{lightGreen200,orange200}from'material-ui/styles/colors';
66

77
conststyles={
8-
margin:'5px',
9-
padding:'5px',
10-
position:'relative'
11-
};
12-
13-
constindexStyles={
14-
position:'absolute',
15-
top:'20px',
16-
left:'45px',
17-
};
18-
19-
constdescriptionStyles={
20-
backgroundColor:'inherit',
21-
paddingTop:'-10px',
22-
paddingLeft:'55px',
23-
fontSize:'14px',
24-
lineHeight:'1.6',
8+
task:{
9+
margin:'5px',
10+
padding:'5px',
11+
position:'relative'
12+
},
13+
index:{
14+
position:'absolute',
15+
top:'20px',
16+
left:'45px',
17+
},
18+
description:{
19+
backgroundColor:'inherit',
20+
paddingTop:'-10px',
21+
paddingLeft:'55px',
22+
fontSize:'14px',
23+
lineHeight:'1.6',
24+
},
2525
};
2626

2727
functiongetStatus(
@@ -38,11 +38,11 @@ const Task: React.StatelessComponent<{
3838
return(
3939
<ListItem
4040
key={index}
41-
style={Object.assign({},styles,{backgroundColor})}
41+
style={Object.assign({},styles.task,{backgroundColor})}
4242
>
4343
{taskCheckbox(isCurrentTask,testRun)}
44-
<spanstyle={indexStyles}>{index+1}.</span>
45-
<divstyle={descriptionStyles}>
44+
<spanstyle={styles.index}>{index+1}.</span>
45+
<divstyle={styles.description}>
4646
<Markdown>{task.description}</Markdown>
4747
</div>
4848
</ListItem>

‎src/components/Page/TasksComplete/index.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@ import {Markdown} from '../../index';
44
import{cyan500,grey100}from'material-ui/styles/colors';
55

66
conststyles={
7-
backgroundColor:cyan500,
8-
margin:'10px 5px',
9-
};
10-
11-
consttextStyles={
12-
color:grey100,
13-
fontSize:'1.1em'
7+
card:{
8+
backgroundColor:cyan500,
9+
margin:'10px 5px',
10+
},
11+
text:{
12+
color:grey100,
13+
fontSize:'1.1em'
14+
},
1415
};
1516

1617
constTasksComplete:React.StatelessComponent<{
1718
page:CR.Page,completed:boolean
1819
}>=({page, completed})=>{
1920
if(!completed||!page.onPageComplete){returnnull;}
2021
return(
21-
<Cardstyle={styles}>
22+
<Cardstyle={styles.card}>
2223
<CardText>
23-
<Markdownstyle={textStyles}>{page.onPageComplete}</Markdown>
24+
<Markdownstyle={styles.text}>{page.onPageComplete}</Markdown>
2425
</CardText>
2526
</Card>
2627
);

‎src/components/Progress/index.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import Subheader from 'material-ui/Subheader';
66
importProgressPagefrom'./ProgressPage';
77
import{progressLoad}from'../../modules/progress/actions';
88

9-
constpageStyle={
10-
width:'100%',
11-
};
12-
13-
constlistStyle={
14-
margin:'5px',
9+
conststyles={
10+
page:{
11+
width:'100%',
12+
},
13+
list:{
14+
margin:'5px',
15+
},
1516
};
1617

1718
@connect(null,dispatch=>{
@@ -29,8 +30,8 @@ export default class Progress extends React.Component<{
2930
render(){
3031
const{progress, pagePosition, info, tutorial}=this.props;
3132
return(
32-
<Paperstyle={pageStyle}>
33-
<Liststyle={listStyle}>
33+
<Paperstyle={styles.page}>
34+
<Liststyle={styles.list}>
3435
<Subheader>{info.name}</Subheader>
3536
{tutorial.pages.map((page:CR.Page,index:number)=>(
3637
<ProgressPage

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp