mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 02:08:55 +02:00
docs(website): Add a "clearAll" button to site showcase (#9233)
This commit is contained in:
parent
a59aead1e2
commit
9da986e626
1 changed files with 16 additions and 1 deletions
|
@ -44,8 +44,16 @@ export default function ShowcaseFilterToggle(): JSX.Element {
|
||||||
});
|
});
|
||||||
}, [operator, location, history]);
|
}, [operator, location, history]);
|
||||||
|
|
||||||
|
const ClearTag = () => {
|
||||||
|
history.push({
|
||||||
|
...location,
|
||||||
|
search: '',
|
||||||
|
state: prepareUserState(),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="row" style={{alignItems: 'center'}}>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
id={id}
|
id={id}
|
||||||
|
@ -65,6 +73,13 @@ export default function ShowcaseFilterToggle(): JSX.Element {
|
||||||
<span className={styles.checkboxLabelAnd}>AND</span>
|
<span className={styles.checkboxLabelAnd}>AND</span>
|
||||||
{/* eslint-enable @docusaurus/no-untranslated-text */}
|
{/* eslint-enable @docusaurus/no-untranslated-text */}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<button
|
||||||
|
className="button button--outline button--primary"
|
||||||
|
type="button"
|
||||||
|
onClick={() => ClearTag()}>
|
||||||
|
Clear All
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue