diff options
author | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-06 13:27:41 -0400 |
---|---|---|
committer | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-06 13:27:41 -0400 |
commit | df83cc894889ff2c8a121d4cb621776930e220a6 (patch) | |
tree | 5654811642d0a3d3a7ec441a40c1bbcd05b2a43b /src | |
parent | 4f9e2f9394ba42c7b1a72e3550f7fbf1cce686c3 (diff) | |
download | donetick-frontend-df83cc894889ff2c8a121d4cb621776930e220a6.tar.gz donetick-frontend-df83cc894889ff2c8a121d4cb621776930e220a6.tar.bz2 donetick-frontend-df83cc894889ff2c8a121d4cb621776930e220a6.zip |
only show search cancel when there is somethign to cancel
Diffstat (limited to '')
-rw-r--r-- | src/views/Chores/MyChores.jsx | 14 |
1 files changed, 8 insertions, 6 deletions
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> |