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

Commit88de366

Browse files
committed
page component style improvements
1 parent6fa66c0 commit88de366

File tree

7 files changed

+43
-53
lines changed

7 files changed

+43
-53
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ exports.Hints = function (_a) {
1111
returnnull;
1212
}
1313
varhint=hints[hintPosition];
14-
return(React.createElement(Card_1.Card,{className:'cr-task-hints'},React.createElement(Card_1.CardHeader,{title:'Hints',avatar:React.createElement(help_1.default,null),actAsExpander:true,showExpandableButton:true}),React.createElement(Card_1.CardText,{className:'cr-task-hint',expandable:true},React.createElement(index_1.Markdown,null,hint)),React.createElement(Card_1.CardActions,{expandable:true,className:'cr-task-hints-actions'},React.createElement(HintButton_1.HintButton,{type:'prev',label:'Previous',hintPosition:hintPosition,hintsLength:hints.length}),React.createElement(HintButton_1.HintButton,{type:'next',label:'Next',hintPosition:hintPosition,hintsLength:hints.length}))));
14+
return(React.createElement(Card_1.Card,{className:'cr-task-hints'},React.createElement(Card_1.CardHeader,{title:'Hints',avatar:React.createElement(help_1.default,null),actAsExpander:true,showExpandableButton:true}),React.createElement(Card_1.CardText,{className:'cr-task-hint',expandable:true},React.createElement(index_1.Markdown,null,hint)),hints.length>1
15+
?React.createElement(Card_1.CardActions,{expandable:true,className:'cr-task-hints-actions'},React.createElement(HintButton_1.HintButton,{type:'prev',label:'Previous',hintPosition:hintPosition,hintsLength:hints.length}),React.createElement(HintButton_1.HintButton,{type:'next',label:'Next',hintPosition:hintPosition,hintsLength:hints.length}))
16+
:null));
1517
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function getStatus(index, taskPosition, testRun) {
88
caseindex<taskPosition:
99
returncolors_1.lightGreen200;
1010
casetestRun:
11-
returncolors_1.orange500;
11+
returncolors_1.orange200;
1212
default:
1313
return'inherit';
1414
}

‎lib/components/Progress/ProgressPage.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1616
varReact=require('react');
1717
varreact_redux_1=require('react-redux');
1818
varactions_1=require('../../actions');
19-
varclassnames=require('classnames');
2019
varList_1=require('material-ui/List');
2120
varprogressIcon_1=require('./progressIcon');
21+
varcolors_1=require('material-ui/styles/colors');
2222
varProgressPage=(function(_super){
2323
__extends(ProgressPage,_super);
2424
functionProgressPage(){
@@ -29,26 +29,19 @@ var ProgressPage = (function (_super) {
2929
varearlierChapter=chapterIndex<position.chapter;
3030
varcurrentChapter=chapterIndex===position.chapter;
3131
varearlierOrCurrentPage=pageIndex<=position.page;
32-
if(isActive||earlierChapter||
33-
(currentChapter&&earlierOrCurrentPage)){
34-
returntrue;
35-
}
36-
else{
37-
returnnull;
38-
}
32+
returnisActive||earlierChapter||
33+
(currentChapter&&earlierOrCurrentPage);
3934
};
4035
ProgressPage.prototype.render=function(){
4136
var_a=this.props,page=_a.page,position=_a.position,chapterIndex=_a.chapterIndex,pageIndex=_a.pageIndex,selectPage=_a.selectPage;
4237
varisActive=chapterIndex===position.chapter&&pageIndex===position.page;
43-
return(React.createElement(List_1.ListItem,{className:classnames({
44-
'page':true,
45-
'page-isDisabled':!this.canActivate(isActive)
46-
}),primaryText:(pageIndex+1)+". "+page.title,secondaryText:page.description,leftIcon:progressIcon_1.progressIcon(page.completed,isActive),onClick:this.canActivate(isActive)
38+
varcanActivate=this.canActivate(isActive);
39+
return(React.createElement(List_1.ListItem,{className:'page',style:!canActivate ?{color:colors_1.grey400} :{},primaryText:(pageIndex+1)+". "+page.title,secondaryText:canActivate ?page.description :'',leftIcon:progressIcon_1.progressIcon(page.completed,isActive),onClick:canActivate
4740
?selectPage.bind(this,{
4841
chapter:chapterIndex,
4942
page:pageIndex
5043
})
51-
:null}));
44+
:function(){return;}}));
5245
};
5346
;
5447
ProgressPage=__decorate([

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

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,26 @@ export const Hints: React.StatelessComponent<{
2626
>
2727
<Markdown>{hint}</Markdown>
2828
</CardText>
29-
<CardActions
30-
expandable={true}
31-
className='cr-task-hints-actions'
32-
>
33-
<HintButton
34-
type='prev'
35-
label='Previous'
36-
hintPosition={hintPosition}
37-
hintsLength={hints.length}
38-
/>
39-
<HintButton
40-
type='next'
41-
label='Next'
42-
hintPosition={hintPosition}
43-
hintsLength={hints.length}
44-
/>
45-
</CardActions>
29+
{hints.length>1
30+
?<CardActions
31+
expandable={true}
32+
className='cr-task-hints-actions'
33+
>
34+
<HintButton
35+
type='prev'
36+
label='Previous'
37+
hintPosition={hintPosition}
38+
hintsLength={hints.length}
39+
/>
40+
<HintButton
41+
type='next'
42+
label='Next'
43+
hintPosition={hintPosition}
44+
hintsLength={hints.length}
45+
/>
46+
</CardActions>
47+
:null
48+
}
4649
</Card>
4750
);
4851
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import{Markdown}from'../../index';
33
// import {TaskCheckbox} from './TaskCheckbox';
44
import{ListItem}from'material-ui/List';
5-
import{lightGreen200,orange500}from'material-ui/styles/colors';
5+
import{lightGreen200,orange200}from'material-ui/styles/colors';
66

77
functiongetStatus(
88
index:number,taskPosition:number,testRun:boolean
@@ -11,7 +11,7 @@ function getStatus(
1111
caseindex<taskPosition:
1212
returnlightGreen200;
1313
casetestRun:
14-
returnorange500;
14+
returnorange200;
1515
default:
1616
return'inherit';
1717
}

‎src/components/Progress/ProgressPage.tsx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {pageSet, setRoute, testsLoad} from '../../actions';
44
import*asclassnamesfrom'classnames';
55
import{ListItem}from'material-ui/List';
66
import{progressIcon}from'./progressIcon';
7+
import{grey400}from'material-ui/styles/colors';
78

89
@connect(null,(dispatch)=>{
910
return{
@@ -22,32 +23,27 @@ export class ProgressPage extends React.Component<{
2223
constearlierChapter=chapterIndex<position.chapter;
2324
constcurrentChapter=chapterIndex===position.chapter;
2425
constearlierOrCurrentPage=pageIndex<=position.page;
25-
if(isActive||earlierChapter||
26-
(currentChapter&&earlierOrCurrentPage)){
27-
returntrue;
28-
}else{
29-
returnnull;
30-
}
26+
returnisActive||earlierChapter||
27+
(currentChapter&&earlierOrCurrentPage);
3128
}
3229
render(){
3330
const{page, position, chapterIndex, pageIndex, selectPage}=this.props;
3431
constisActive=chapterIndex===position.chapter&&pageIndex===position.page;
32+
constcanActivate=this.canActivate(isActive);
3533
return(
3634
<ListItem
37-
className={classnames({
38-
'page':true,
39-
'page-isDisabled':!this.canActivate(isActive)
40-
})}
35+
className='page'
36+
style={!canActivate ?{color:grey400} :{}}
4137
primaryText={`${pageIndex+1}.${page.title}`}
42-
secondaryText={page.description}
38+
secondaryText={canActivate ?page.description :''}
4339
leftIcon={progressIcon(page.completed,isActive)}
4440
onClick={
45-
this.canActivate(isActive)
41+
canActivate
4642
?selectPage.bind(this,{
4743
chapter:chapterIndex,
4844
page:pageIndex
4945
})
50-
:null
46+
:function(){return;}
5147
}
5248
/>
5349
);

‎src/components/progress/_progress.less

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@
1313
padding-left:15px;
1414
margin-top:0;
1515
}
16-
.page.page-isDisabled {
17-
color:rgba(0,0,0,0.5);
18-
background:white;
19-
&:hover {
20-
background:white;
21-
}
16+
.page.page-isDisabled {
17+
color:#E0E0E0!important;
2218
}
2319
}
2420
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp