Squashed commit of the following:
commit 4810de3b94b0ec0d7e9b8570de58f85792dffa80 Author: GuillaumeSD <gsd.lfny@gmail.com> Date: Sat Apr 6 01:37:42 2024 +0200 fix : lint commit 59e0b571e6089da6c086ab6340ec6a966b2e9739 Author: GuillaumeSD <gsd.lfny@gmail.com> Date: Sat Apr 6 01:36:17 2024 +0200 feat : UI refacto commit 56806a89dca5c7fb2c229b5a57404f9a856fac09 Author: GuillaumeSD <gsd.lfny@gmail.com> Date: Fri Apr 5 03:56:08 2024 +0200 feat : add moves list commit 9e3d2347882074c38ab183e642ecef8153dbfcde Author: GuillaumeSD <gsd.lfny@gmail.com> Date: Thu Apr 4 02:18:52 2024 +0200 feat : init branch, wip
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useChessActions } from "@/hooks/useChessActions";
|
||||
import Board from "@/sections/analysis/board";
|
||||
import MovesClassificationsRecap from "@/sections/analysis/movesClassificationsRecap";
|
||||
import MovesClassificationsRecap from "@/sections/analysis/reviewPanelBody/movesClassificationsRecap";
|
||||
import ReviewPanelBody from "@/sections/analysis/reviewPanelBody";
|
||||
import ReviewPanelHeader from "@/sections/analysis/reviewPanelHeader";
|
||||
import ReviewPanelToolBar from "@/sections/analysis/reviewPanelToolbar";
|
||||
@@ -15,6 +15,7 @@ import { Chess } from "chess.js";
|
||||
import { useSetAtom } from "jotai";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect } from "react";
|
||||
import MovesPanel from "@/sections/analysis/reviewPanelBody/movesPanel";
|
||||
|
||||
export default function GameReport() {
|
||||
const theme = useTheme();
|
||||
@@ -22,7 +23,7 @@ export default function GameReport() {
|
||||
|
||||
const { reset: resetBoard } = useChessActions(boardAtom);
|
||||
const { setPgn: setGamePgn } = useChessActions(gameAtom);
|
||||
const setEval = useSetAtom(gameEvalAtom);
|
||||
const setGameEval = useSetAtom(gameEvalAtom);
|
||||
const setBoardOrientation = useSetAtom(boardOrientationAtom);
|
||||
|
||||
const router = useRouter();
|
||||
@@ -31,20 +32,19 @@ export default function GameReport() {
|
||||
useEffect(() => {
|
||||
if (!gameId) {
|
||||
resetBoard();
|
||||
setEval(undefined);
|
||||
setGameEval(undefined);
|
||||
setBoardOrientation(true);
|
||||
setGamePgn(new Chess().pgn());
|
||||
}
|
||||
}, [gameId, setEval, setBoardOrientation, resetBoard, setGamePgn]);
|
||||
}, [gameId, setGameEval, setBoardOrientation, resetBoard, setGamePgn]);
|
||||
|
||||
return (
|
||||
<Grid container gap={4} justifyContent="space-evenly" alignItems="start">
|
||||
<Grid container gap={4} justifyContent="space-evenly" alignItems="center">
|
||||
<Board />
|
||||
|
||||
<Grid
|
||||
container
|
||||
item
|
||||
marginTop={{ xs: 0, lg: "2.5em" }}
|
||||
justifyContent="center"
|
||||
alignItems="center"
|
||||
borderRadius={2}
|
||||
@@ -61,21 +61,38 @@ export default function GameReport() {
|
||||
padding={3}
|
||||
rowGap={3}
|
||||
style={{
|
||||
maxWidth: "1100px",
|
||||
maxWidth: "1200px",
|
||||
}}
|
||||
maxHeight={{ lg: "calc(100vh - 150px)", xs: "900px" }}
|
||||
display="grid"
|
||||
gridTemplateRows="repeat(4, auto) fit-content(100%)"
|
||||
>
|
||||
{isLgOrGreater ? <ReviewPanelHeader /> : <ReviewPanelToolBar />}
|
||||
|
||||
<Divider sx={{ width: "90%" }} />
|
||||
<Divider sx={{ marginX: "5%" }} />
|
||||
|
||||
<ReviewPanelBody />
|
||||
|
||||
<Divider sx={{ width: "90%" }} />
|
||||
<Divider sx={{ marginX: "5%" }} />
|
||||
|
||||
<Grid
|
||||
container
|
||||
item
|
||||
justifyContent="center"
|
||||
alignItems="start"
|
||||
height="100%"
|
||||
minHeight={{ lg: "50px", xs: undefined }}
|
||||
sx={{ overflow: "hidden" }}
|
||||
>
|
||||
<MovesPanel />
|
||||
|
||||
<MovesClassificationsRecap />
|
||||
</Grid>
|
||||
|
||||
<Divider sx={{ marginX: "5%" }} />
|
||||
|
||||
{isLgOrGreater ? <ReviewPanelToolBar /> : <ReviewPanelHeader />}
|
||||
</Grid>
|
||||
|
||||
<MovesClassificationsRecap />
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user