From 0df9ad6f544363db429296102128a15f7f059360 Mon Sep 17 00:00:00 2001
From: GuillaumeSD <47183782+GuillaumeSD@users.noreply.github.com>
Date: Sat, 10 May 2025 01:22:08 +0200
Subject: [PATCH] style : analysis tabs sizes rework
---
src/pages/index.tsx | 46 ++++++++--------
.../panelBody/analysisTab/lineEvaluation.tsx | 2 +-
.../panelBody/analysisTab/moveInfo.tsx | 15 +++++-
.../panelBody/analysisTab/playersMetric.tsx | 53 +++++++++++--------
.../analysis/panelHeader/analyzeButton.tsx | 7 ++-
src/sections/loadGame/loadGameButton.tsx | 6 ++-
6 files changed, 75 insertions(+), 54 deletions(-)
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 91867b5..699b5b6 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -31,7 +31,6 @@ export default function GameReview() {
const theme = useTheme();
const [tab, setTab] = useState(0);
const isLgOrGreater = useMediaQuery(theme.breakpoints.up("lg"));
- const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
const { reset: resetBoard } = useChessActions(boardAtom);
const { reset: resetGame } = useChessActions(gameAtom);
@@ -77,14 +76,14 @@ export default function GameReview() {
borderWidth: 2,
boxShadow: "0 2px 10px rgba(0, 0, 0, 0.5)",
}}
- padding={2.5}
+ padding={2}
style={{
maxWidth: "1200px",
}}
rowGap={2}
maxHeight={{ lg: "calc(95vh - 130px)", xs: "900px" }}
display="grid"
- gridTemplateRows="repeat(4, auto) fit-content(100%)"
+ gridTemplateRows="repeat(3, auto) fit-content(100%)"
marginTop={isLgOrGreater && window.innerHeight > 780 ? 4 : 0}
size={{
xs: 12,
@@ -114,19 +113,18 @@ export default function GameReview() {
onChange={(_, newValue) => setTab(newValue)}
aria-label="basic tabs example"
variant="fullWidth"
+ sx={{ minHeight: 0 }}
>
- }
+ icon={}
iconPosition="start"
- sx={{ textTransform: "none", minHeight: 20, paddingX: 0 }}
+ sx={{
+ textTransform: "none",
+ minHeight: 15,
+ padding: "5px 0em 12px",
+ }}
disableFocusRipple
/>
@@ -137,15 +135,15 @@ export default function GameReview() {
}
iconPosition="start"
sx={{
textTransform: "none",
- minHeight: 20,
+ minHeight: 15,
display: isGameLoaded ? undefined : "none",
- paddingX: 0,
+ padding: "5px 0em 12px",
}}
disableFocusRipple
/>
@@ -153,19 +151,13 @@ export default function GameReview() {
- }
+ icon={}
iconPosition="start"
sx={{
textTransform: "none",
- minHeight: 20,
+ minHeight: 15,
display: gameEval ? undefined : "none",
- paddingX: 0,
+ padding: "5px 0em 12px",
}}
disableFocusRipple
/>
@@ -182,8 +174,12 @@ export default function GameReview() {
- {isLgOrGreater && }
- {isLgOrGreater && }
+ {isLgOrGreater && (
+
+
+
+
+ )}
{!isLgOrGreater && gameEval && }
{!isLgOrGreater && gameEval && (
diff --git a/src/sections/analysis/panelBody/analysisTab/lineEvaluation.tsx b/src/sections/analysis/panelBody/analysisTab/lineEvaluation.tsx
index d4cbdab..4cf23b8 100644
--- a/src/sections/analysis/panelBody/analysisTab/lineEvaluation.tsx
+++ b/src/sections/analysis/panelBody/analysisTab/lineEvaluation.tsx
@@ -35,7 +35,7 @@ export default function LineEvaluation({ line }: Props) {
}}
borderRadius="5px"
border="1px solid #424242"
- fontWeight="bold"
+ fontWeight="500"
>
{showSkeleton ? (
+
+
{moveLabel && (
{moveClassification && (
diff --git a/src/sections/analysis/panelBody/analysisTab/playersMetric.tsx b/src/sections/analysis/panelBody/analysisTab/playersMetric.tsx
index 8379b5b..207eb10 100644
--- a/src/sections/analysis/panelBody/analysisTab/playersMetric.tsx
+++ b/src/sections/analysis/panelBody/analysisTab/playersMetric.tsx
@@ -19,30 +19,39 @@ export default function PlayersMetric({
columnGap={{ xs: "8vw", md: 10 }}
size={12}
>
-
- {whiteValue}
+
+
+
+ {title}
- {title}
-
- {blackValue}
-
+
);
}
+
+const ValueBlock = ({
+ value,
+ color,
+}: {
+ value: string | number;
+ color: "white" | "black";
+}) => {
+ return (
+
+ {value}
+
+ );
+};
diff --git a/src/sections/analysis/panelHeader/analyzeButton.tsx b/src/sections/analysis/panelHeader/analyzeButton.tsx
index e9aceb9..53988d1 100644
--- a/src/sections/analysis/panelHeader/analyzeButton.tsx
+++ b/src/sections/analysis/panelHeader/analyzeButton.tsx
@@ -17,6 +17,7 @@ import { logAnalyticsEvent } from "@/lib/firebase";
import { SavedEvals } from "@/types/eval";
import { useEffect, useCallback } from "react";
import { usePlayersData } from "@/hooks/usePlayersData";
+import { Typography } from "@mui/material";
export default function AnalyzeButton() {
const engineName = useAtomValue(engineNameAtom);
@@ -107,11 +108,13 @@ export default function AnalyzeButton() {
}
+ startIcon={}
onClick={handleAnalyze}
disabled={!readyToAnalyse}
>
- {gameEval ? "Analyze again" : "Analyze"}
+
+ {gameEval ? "Analyze again" : "Analyze"}
+
);
}
diff --git a/src/sections/loadGame/loadGameButton.tsx b/src/sections/loadGame/loadGameButton.tsx
index a71a0e2..5db4c4c 100644
--- a/src/sections/loadGame/loadGameButton.tsx
+++ b/src/sections/loadGame/loadGameButton.tsx
@@ -1,4 +1,4 @@
-import { Button } from "@mui/material";
+import { Button, Typography } from "@mui/material";
import { useState } from "react";
import NewGameDialog from "./loadGameDialog";
import { Chess } from "chess.js";
@@ -19,7 +19,9 @@ export default function LoadGameButton({ setGame, label, size }: Props) {
onClick={() => setOpenDialog(true)}
size={size}
>
- {label || "Add game"}
+
+ {label || "Add game"}
+