Skip to content

Commit

Permalink
docs(website): Add a "clearAll" button to site showcase (#9233)
Browse files Browse the repository at this point in the history
  • Loading branch information
biplavmz committed Aug 16, 2023
1 parent a59aead commit 9da986e
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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>
);
}

0 comments on commit 9da986e

Please sign in to comment.