From bb6e8ac744f3b204efda49ff4fa2c2da0a56e8d3 Mon Sep 17 00:00:00 2001 From: aqilusman45 Date: Tue, 9 Jul 2024 01:42:43 +0500 Subject: [PATCH] feat: highlight work todos --- index.html | 1 + js/todoItem.jsx | 11 ++++++++++- styles.css | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 styles.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/styles.css b/styles.css new file mode 100644 index 0000000..4d359f2 --- /dev/null +++ b/styles.css @@ -0,0 +1,3 @@ +.workItem { + border-left: 3px solid blue; +}