Implemented the API, split the teams page up into multiple components

This commit is contained in:
Alex van Andel committed 2021-06-05 22:53:33 +00:00
1 parent e2942224ab
commit 7a31cb0f6a
14 files changed
+741 -159

No files matched your search

+19
View File
@@ -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>);
}