From df83cc894889ff2c8a121d4cb621776930e220a6 Mon Sep 17 00:00:00 2001
From: Mo Tarbin <mhed.t91@gmail.com>
Date: Sat, 6 Jul 2024 13:27:41 -0400
Subject: only show search cancel when there is somethign to cancel

---
 src/views/Chores/MyChores.jsx | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

(limited to 'src/views/Chores/MyChores.jsx')

diff --git a/src/views/Chores/MyChores.jsx b/src/views/Chores/MyChores.jsx
index da74918..cd90942 100644
--- a/src/views/Chores/MyChores.jsx
+++ b/src/views/Chores/MyChores.jsx
@@ -298,12 +298,14 @@ const MyChores = () => {
           }}
           onChange={handleSearchChange}
           endDecorator={
-            <CancelRounded
-              onClick={() => {
-                setSearchTerm('')
-                setFilteredChores(chores)
-              }}
-            />
+            searchTerm && (
+              <CancelRounded
+                onClick={() => {
+                  setSearchTerm('')
+                  setFilteredChores(chores)
+                }}
+              />
+            )
           }
         />
       </Box>
-- 
cgit 

