Skip to content

Commit 709291a

Browse files
author
“spb-superstruct”
committed
feat: highlight work todos
1 parent c25ecec commit 709291a

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

index.html

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<title>React • TodoMVC</title>
66
<link rel="stylesheet" href="base.css">
77
<link rel="stylesheet" href="index.css">
8+
<link rel="stylesheet" href="style.css">
89
</head>
910
<body>
1011
<section class="todoapp"></section>

js/todoItem.jsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,18 @@ var app = app || {};
7676
},
7777

7878
render: function () {
79+
var prefix = this.props.todo.title.split(':')
80+
var check = function (prefix) {
81+
if (prefix.length > 1 && prefix[0] === 'work') {
82+
return true
83+
} else {
84+
return false
85+
}
86+
}
7987
return (
80-
8188
<li className={classNames({
82-
completed: this.props.todo.completed,
89+
workItem: check(prefix),
90+
ompleted: this.props.todo.completed,
8391
editing: this.props.editing
8492
})}
8593
>

style.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.workItem {
2+
border-left: 3px solid blue;
3+
}

0 commit comments

Comments
 (0)