docs(website): Add a "clearAll" button to site showcase (#9233)

This commit is contained in:
Biplav Kumar Mazumdar 2023-08-16 23:21:51 +05:30 committed by GitHub
parent a59aead1e2
commit 9da986e626
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,8 +44,16 @@ export default function ShowcaseFilterToggle(): JSX.Element {
});
}, [operator, location, history]);
const ClearTag = () => {
history.push({
...location,
search: '',
state: prepareUserState(),
});
};
return (
<div>
<div className="row" style={{alignItems: 'center'}}>
<input
type="checkbox"
id={id}
@ -65,6 +73,13 @@ export default function ShowcaseFilterToggle(): JSX.Element {
<span className={styles.checkboxLabelAnd}>AND</span>
{/* eslint-enable @docusaurus/no-untranslated-text */}
</label>
<button
className="button button--outline button--primary"
type="button"
onClick={() => ClearTag()}>
Clear All
</button>
</div>
);
}