mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
Updated clear button
This commit is contained in:
parent
d952c38a7f
commit
4243959ac9
@ -138,18 +138,28 @@ function SearchBox() {
|
||||
className='grow text-[1.65rem] focus-visible:outline-none placeholder:text-gray-300'
|
||||
placeholder='Search posts, tags, authors..'
|
||||
/>
|
||||
<ClearIcon
|
||||
className='ml-3 fill-neutral-400 cursor-pointer' alt='Clear'
|
||||
onClick={() => {
|
||||
dispatch('update', {
|
||||
searchValue: ''
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<ClearButton />
|
||||
</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}) {
|
||||
return (
|
||||
<div className='flex items-center py-3 -mx-7 px-7 hover:bg-gray-100 cursor-pointer'>
|
||||
|
Loading…
Reference in New Issue
Block a user