From 891e48c6003b5c51cfa7f28f3578bc6d4d0535bd Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 21 Nov 2023 13:10:12 -0700 Subject: [PATCH] Removing unused withAction property. --- app/src/DashboardPage.js | 2 -- app/src/components/Common.js | 18 +++++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/src/DashboardPage.js b/app/src/DashboardPage.js index 2474ebf7..02fc542c 100644 --- a/app/src/DashboardPage.js +++ b/app/src/DashboardPage.js @@ -194,7 +194,6 @@ export function DashboardPage() { onSubmit={setSearchStr} size='large' placeholder='Search everywhere...' - actionIcon='search' onClear={() => navigate('/')} style={{marginBottom: '2em'}} results={suggestions} @@ -218,7 +217,6 @@ export function DashboardPage() { onSubmit={setSearchStr} size='big' placeholder='Search everywhere...' - actionIcon='search' onClear={() => navigate('/')} style={{marginBottom: '2em'}} results={suggestions} diff --git a/app/src/components/Common.js b/app/src/components/Common.js index 5e50e327..f9d1df96 100644 --- a/app/src/components/Common.js +++ b/app/src/components/Common.js @@ -401,7 +401,7 @@ export function scrollToTopOfElement(element, smooth = true) { }); } -const useClearableInput = (searchStr, onChange, onClear, onSubmit, size = 'small', placeholder = 'Search...', icon = 'search', withAction = true) => { +const useClearableInput = (searchStr, onChange, onClear, onSubmit, size = 'small', placeholder = 'Search...', icon = 'search') => { const [value, setValue] = useState(searchStr || ''); const [submitted, setSubmitted] = useState(false); @@ -454,11 +454,8 @@ const useClearableInput = (searchStr, onChange, onClear, onSubmit, size = 'small className='search-clear' />; - let action; - if (withAction) { - // Can only clear after submitting. - action = submitted ? clearButton :