Skip to content

Commit 70eb38b

Browse files
committed
fix task background color
1 parent c10c913 commit 70eb38b

File tree

4 files changed

+4
-34
lines changed

4 files changed

+4
-34
lines changed

lib/components/page/task.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,8 @@ var TaskContent = function (_a) {
3434
};
3535
exports.Task = function (_a) {
3636
var task = _a.task, taskPosition = _a.taskPosition, index = _a.index, runTests = _a.runTests;
37-
var taskClass = 'cr-task';
38-
if (index < taskPosition) {
39-
taskClass += ' isCompletedTask';
40-
}
41-
else if (index === taskPosition) {
42-
taskClass += 'isCurrentTask';
43-
}
44-
return (React.createElement(material_ui_1.ListItem, {key: index, className: taskClass}, React.createElement(TaskCheckbox, {index: index, taskPosition: taskPosition, runTests: runTests}), React.createElement(TaskIndex, {index: index}), React.createElement(TaskContent, {task: task})));
37+
var isCompleted = index < taskPosition;
38+
return (React.createElement(material_ui_1.ListItem, {key: index, className: 'cr-task', style: { backgroundColor: isCompleted ? '#c8e6c9' : 'inherit' }}, React.createElement(TaskCheckbox, {index: index, taskPosition: taskPosition, runTests: runTests}), React.createElement(TaskIndex, {index: index}), React.createElement(TaskContent, {task: task})));
4539
};
4640
exports.Tasks = function (_a) {
4741
var tasks = _a.tasks, taskPosition = _a.taskPosition, runTests = _a.runTests;

src/components/page/_page.less

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
.cr-page {
22
position: relative;
33
width: 400px;
4-
.isCompletedTask {
5-
background-color: #c8e6c9;
6-
}
7-
.isCompleteTask:hover {
8-
background-color: #c8e6c9;
9-
}
10-
.isCurrentTask {}
11-
.isDisabledTask {
12-
color: grey;
13-
}
144
&-toolbar {
155
position: fixed;
166
bottom: 0;

src/components/page/task.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,9 @@ const TaskContent = ({task}) => (
3535
);
3636

3737
export const Task = ({task, taskPosition, index, runTests}) => {
38-
let taskClass = 'cr-task';
39-
if (index < taskPosition) {
40-
taskClass += ' isCompletedTask';
41-
} else if (index === taskPosition) {
42-
taskClass += 'isCurrentTask';
43-
}
38+
const isCompleted = index < taskPosition;
4439
return (
45-
<ListItem key={index} className={taskClass} >
40+
<ListItem key={index} className='cr-task' style={{backgroundColor: isCompleted ? '#c8e6c9' : 'inherit'}}>
4641
<TaskCheckbox index={index} taskPosition={taskPosition} runTests={runTests}/>
4742
<TaskIndex index={index} />
4843
<TaskContent task={task} />

styles/styles.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ atom-panel-container > atom-panel > #crv {
4747
position: relative;
4848
width: 400px;
4949
}
50-
.cr-page .isCompletedTask {
51-
background-color: #c8e6c9;
52-
}
53-
.cr-page .isCompleteTask:hover {
54-
background-color: #c8e6c9;
55-
}
56-
.cr-page .isDisabledTask {
57-
color: grey;
58-
}
5950
.cr-page-toolbar {
6051
position: fixed;
6152
bottom: 0;

0 commit comments

Comments
 (0)