mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-23 15:19:01 +01:00
feat: add button to clear collection search
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
parent
6b668aaebe
commit
97871c25cf
@ -5,7 +5,8 @@ import {
|
|||||||
IconFolders,
|
IconFolders,
|
||||||
IconArrowsSort,
|
IconArrowsSort,
|
||||||
IconSortAscendingLetters,
|
IconSortAscendingLetters,
|
||||||
IconSortDescendingLetters
|
IconSortDescendingLetters,
|
||||||
|
IconX
|
||||||
} from '@tabler/icons';
|
} from '@tabler/icons';
|
||||||
import Collection from '../Collections/Collection';
|
import Collection from '../Collections/Collection';
|
||||||
import CreateCollection from '../CreateCollection';
|
import CreateCollection from '../CreateCollection';
|
||||||
@ -97,8 +98,20 @@ const Collections = () => {
|
|||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
className="block w-full pl-7 py-1 sm:text-sm"
|
className="block w-full pl-7 py-1 sm:text-sm"
|
||||||
placeholder="search"
|
placeholder="search"
|
||||||
|
value={searchText}
|
||||||
onChange={(e) => setSearchText(e.target.value.toLowerCase())}
|
onChange={(e) => setSearchText(e.target.value.toLowerCase())}
|
||||||
/>
|
/>
|
||||||
|
{searchText !== '' && (
|
||||||
|
<div className="absolute inset-y-0 right-0 pr-4 flex items-center">
|
||||||
|
<span
|
||||||
|
onClick={() => {
|
||||||
|
setSearchText('');
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<IconX size={16} strokeWidth={1.5} />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-4 flex flex-col overflow-y-auto absolute top-32 bottom-10 left-0 right-0">
|
<div className="mt-4 flex flex-col overflow-y-auto absolute top-32 bottom-10 left-0 right-0">
|
||||||
|
Loading…
Reference in New Issue
Block a user