From f782b55b5a467765e203ba7c343ad4b912493e8d Mon Sep 17 00:00:00 2001 From: GuillaumeSD Date: Mon, 2 Jun 2025 01:11:38 +0200 Subject: [PATCH] style : analysis card UI rework for desktop --- src/hooks/useScreenSize.ts | 2 +- src/pages/index.tsx | 141 ++++++++++-------- .../analysis/panelBody/analysisTab/index.tsx | 30 +--- .../panelBody/analysisTab/lineEvaluation.tsx | 11 +- .../panelBody/analysisTab/moveInfo.tsx | 19 ++- .../panelBody/classificationTab/index.tsx | 2 +- .../movesClassificationsRecap/index.tsx | 5 +- .../classificationTab/movesPanel/index.tsx | 4 +- .../analysis/panelBody/graphTab/index.tsx | 6 +- src/sections/layout/NavBar.tsx | 4 +- src/sections/layout/index.tsx | 2 +- 11 files changed, 117 insertions(+), 109 deletions(-) diff --git a/src/hooks/useScreenSize.ts b/src/hooks/useScreenSize.ts index 40db713..a392927 100644 --- a/src/hooks/useScreenSize.ts +++ b/src/hooks/useScreenSize.ts @@ -24,7 +24,7 @@ export const useScreenSize = () => { const handleResize = () => { setScreenSize((prev) => ({ ...prev, - height: window.innerHeight - 120, + height: window.innerHeight - 100, })); }; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 0fdb308..f728e12 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -81,10 +81,13 @@ export default function GameAnalysis() { maxWidth: "1200px", }} rowGap={2} - maxHeight={{ lg: "calc(95vh - 80px)", xs: "900px" }} + maxHeight={{ lg: "calc(95vh - 60px)", xs: "900px" }} display="grid" - gridTemplateRows="repeat(3, auto) fit-content(100%)" - marginTop={isLgOrGreater && window.innerHeight > 780 ? 4 : 0} + gridTemplateRows={ + gameEval + ? "repeat(2, auto) max-content fit-content(100%) fit-content(100%) auto" + : "repeat(3, auto) fit-content(100%)" + } size={{ xs: 12, lg: "grow", @@ -96,77 +99,91 @@ export default function GameAnalysis() { )} + {isLgOrGreater && } + {!isLgOrGreater && !gameEval && } {!isLgOrGreater && !gameEval && ( )} - - setTab(newValue)} - aria-label="basic tabs example" - variant="fullWidth" - sx={{ minHeight: 0 }} + {!isLgOrGreater && ( + - } - iconPosition="start" - sx={{ - textTransform: "none", - minHeight: 15, - padding: "5px 0em 12px", - }} - disableFocusRipple - /> + setTab(newValue)} + aria-label="basic tabs example" + variant="fullWidth" + sx={{ minHeight: 0 }} + > + } + iconPosition="start" + sx={{ + textTransform: "none", + minHeight: 15, + padding: "5px 0em 12px", + }} + disableFocusRipple + /> - } - iconPosition="start" - sx={{ - textTransform: "none", - minHeight: 15, - display: isGameLoaded ? undefined : "none", - padding: "5px 0em 12px", - }} - disableFocusRipple - /> + } + iconPosition="start" + sx={{ + textTransform: "none", + minHeight: 15, + display: isGameLoaded ? undefined : "none", + padding: "5px 0em 12px", + }} + disableFocusRipple + /> - } - iconPosition="start" - sx={{ - textTransform: "none", - minHeight: 15, - display: gameEval ? undefined : "none", - padding: "5px 0em 12px", - }} - disableFocusRipple - /> - - + } + iconPosition="start" + sx={{ + textTransform: "none", + minHeight: 15, + display: gameEval ? undefined : "none", + padding: "5px 0em 12px", + }} + disableFocusRipple + /> + + + )} -