Implemented the API, split the teams page up into multiple components
This commit is contained in:
1 parent
e2942224ab
commit
7a31cb0f6a
14 files changed
+741
-159
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import {useEffect, useState} from "react";
|
||||
|
||||
export default function Dropdown(props) {
|
||||
|
||||
const [ open, setOpen ] = useState(false);
|
||||
|
||||
useEffect( () => {
|
||||
document.addEventListener('keyup', (e) => {
|
||||
if (e.key === "Escape") {
|
||||
setOpen(false);
|
||||
}
|
||||
});
|
||||
}, [open]);
|
||||
|
||||
return (<div onClick={() => setOpen(!open)} {...props}>
|
||||
{props.children[0]}
|
||||
{open && props.children[1]}
|
||||
</div>);
|
||||
}
|
||||
Reference in new issue
Block a user