mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Updated clear button
This commit is contained in:
parent
d952c38a7f
commit
4243959ac9
1 changed files with 18 additions and 8 deletions
|
@ -138,18 +138,28 @@ function SearchBox() {
|
||||||
className='grow text-[1.65rem] focus-visible:outline-none placeholder:text-gray-300'
|
className='grow text-[1.65rem] focus-visible:outline-none placeholder:text-gray-300'
|
||||||
placeholder='Search posts, tags, authors..'
|
placeholder='Search posts, tags, authors..'
|
||||||
/>
|
/>
|
||||||
<ClearIcon
|
<ClearButton />
|
||||||
className='ml-3 fill-neutral-400 cursor-pointer' alt='Clear'
|
|
||||||
onClick={() => {
|
|
||||||
dispatch('update', {
|
|
||||||
searchValue: ''
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ClearButton() {
|
||||||
|
const {searchValue = '', dispatch} = useContext(AppContext);
|
||||||
|
if (!searchValue) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<ClearIcon
|
||||||
|
className='ml-3 fill-neutral-400 cursor-pointer' alt='Clear'
|
||||||
|
onClick={() => {
|
||||||
|
dispatch('update', {
|
||||||
|
searchValue: ''
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function TagListItem({title}) {
|
function TagListItem({title}) {
|
||||||
return (
|
return (
|
||||||
<div className='flex items-center py-3 -mx-7 px-7 hover:bg-gray-100 cursor-pointer'>
|
<div className='flex items-center py-3 -mx-7 px-7 hover:bg-gray-100 cursor-pointer'>
|
||||||
|
|
Loading…
Add table
Reference in a new issue