From 9d9f3d6cf82cbae6f44c8e3c2ee74b2e2eae4ed9 Mon Sep 17 00:00:00 2001 From: Andrei Sevostianov Date: Tue, 10 Sep 2019 16:05:28 -0700 Subject: [PATCH] feat: style todos with prefix 'work' --- index.html | 1 + js/todoItem.jsx | 11 ++++++++++- style.css | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 style.css diff --git a/index.html b/index.html index 90c0676..79b63d8 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ React • TodoMVC +
diff --git a/js/todoItem.jsx b/js/todoItem.jsx index a14493f..bcb07be 100644 --- a/js/todoItem.jsx +++ b/js/todoItem.jsx @@ -76,9 +76,18 @@ var app = app || {}; }, render: function () { + var prefix = this.props.todo.title.split(':'); + var check = function (prefix) { + if (prefix.length > 1 && prefix[0] === 'work') { + return true + } else { + return false + } + } return (
  • diff --git a/style.css b/style.css new file mode 100644 index 0000000..1133406 --- /dev/null +++ b/style.css @@ -0,0 +1,3 @@ +.workItem { + border-left: 3px solid blue; +} \ No newline at end of file