0
Fork 0
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:
Djordje Vlaisavljevic 2022-07-05 16:51:29 +02:00
parent d952c38a7f
commit 4243959ac9

View file

@ -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'>