style : inverse info panel for mobile

This commit is contained in:
GuillaumeSD
2024-02-26 01:40:24 +01:00
parent 5bcaf12a5d
commit f0f6a65c1c

View File

@@ -9,17 +9,21 @@ import {
gameAtom, gameAtom,
gameEvalAtom, gameEvalAtom,
} from "@/sections/analysis/states"; } from "@/sections/analysis/states";
import { Divider, Grid } from "@mui/material"; import { Divider, Grid, useMediaQuery, useTheme } from "@mui/material";
import { Chess } from "chess.js"; import { Chess } from "chess.js";
import { useSetAtom } from "jotai"; import { useSetAtom } from "jotai";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { useEffect } from "react"; import { useEffect } from "react";
export default function GameReport() { export default function GameReport() {
const theme = useTheme();
const isMdOrGreater = useMediaQuery(theme.breakpoints.up("md"));
const { reset: resetBoard } = useChessActions(boardAtom); const { reset: resetBoard } = useChessActions(boardAtom);
const { setPgn: setGamePgn } = useChessActions(gameAtom); const { setPgn: setGamePgn } = useChessActions(gameAtom);
const setEval = useSetAtom(gameEvalAtom); const setEval = useSetAtom(gameEvalAtom);
const setBoardOrientation = useSetAtom(boardOrientationAtom); const setBoardOrientation = useSetAtom(boardOrientationAtom);
const router = useRouter(); const router = useRouter();
const { gameId } = router.query; const { gameId } = router.query;
@@ -77,7 +81,7 @@ export default function GameReport() {
padding={3} padding={3}
gap={3} gap={3}
> >
<ReviewPanelHeader /> {isMdOrGreater ? <ReviewPanelHeader /> : <ReviewPanelToolBar />}
<Divider sx={{ width: "90%" }} /> <Divider sx={{ width: "90%" }} />
@@ -85,7 +89,7 @@ export default function GameReport() {
<Divider sx={{ width: "90%" }} /> <Divider sx={{ width: "90%" }} />
<ReviewPanelToolBar /> {isMdOrGreater ? <ReviewPanelToolBar /> : <ReviewPanelHeader />}
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>