0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:18:42 -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,6 +138,17 @@ function SearchBox() {
className='grow text-[1.65rem] focus-visible:outline-none placeholder:text-gray-300'
placeholder='Search posts, tags, authors..'
/>
<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={() => {
@ -146,7 +157,6 @@ function SearchBox() {
});
}}
/>
</div>
);
}