mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 13:06:58 +02:00
feat(v2): new showcase page with tags and filters (#4515)
* docs: add ToggleTags component for showcase * docs: add filter functionality * docs: remove redundant variables * docs: use react state for selectedTags * docs: add control to tag checkbox * docs: use useMemo for filteredUsers * docs: change names of tags * revert name tag changes * polish the showcase page * cleanup tags on the users list * minor polish * add querystring filtering * typo * Add title/arialabel to emulate tooltip Co-authored-by: Javid <singularity.javid@gmail.com> Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
792f4ac6fb
commit
458af077ae
10 changed files with 800 additions and 245 deletions
36
website/src/components/showcase/ShowcaseCheckbox/index.js
Normal file
36
website/src/components/showcase/ShowcaseCheckbox/index.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
|
||||
function ShowcaseCheckbox({
|
||||
className,
|
||||
name,
|
||||
label,
|
||||
onChange,
|
||||
checked,
|
||||
...props
|
||||
}) {
|
||||
const id = `showcase_checkbox_id_${name};`;
|
||||
return (
|
||||
<div className={clsx(props.className, styles.checkboxContainer)} {...props}>
|
||||
<input
|
||||
type="checkbox"
|
||||
id={id}
|
||||
name={name}
|
||||
onChange={onChange}
|
||||
checked={checked}
|
||||
/>
|
||||
<label htmlFor={id}>{label}</label>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ShowcaseCheckbox;
|
Loading…
Add table
Add a link
Reference in a new issue