feat : useScreenSize for board size

This commit is contained in:
GuillaumeSD
2024-02-26 01:20:17 +01:00
parent ebdfc9ae33
commit 5bcaf12a5d
15 changed files with 106 additions and 74 deletions

View File

@@ -6,14 +6,19 @@ import { Chess } from "chess.js";
interface Props {
setGame?: (game: Chess) => void;
label?: string;
size?: "small" | "medium" | "large";
}
export default function LoadGameButton({ setGame, label }: Props) {
export default function LoadGameButton({ setGame, label, size }: Props) {
const [openDialog, setOpenDialog] = useState(false);
return (
<>
<Button variant="contained" onClick={() => setOpenDialog(true)}>
<Button
variant="contained"
onClick={() => setOpenDialog(true)}
size={size}
>
{label || "Add game"}
</Button>