diff --git a/src/components/boards/BoardGame.tsx b/src/components/boards/BoardGame.tsx index a327c643..60388ad7 100644 --- a/src/components/boards/BoardGame.tsx +++ b/src/components/boards/BoardGame.tsx @@ -542,12 +542,12 @@ function BoardGame() { const whiteName = players.white.type === "human" ? players.white.name - : players.white.engine?.name ?? "?"; + : (players.white.engine?.name ?? "?"); const blackName = players.black.type === "human" ? players.black.name - : players.black.engine?.name ?? "?"; + : (players.black.engine?.name ?? "?"); return tab.value === activeTab ? { @@ -593,10 +593,10 @@ function BoardGame() { canTakeBack={onePlayerIsEngine} movable={movable} whiteTime={ - gameState === "playing" ? whiteTime ?? undefined : undefined + gameState === "playing" ? (whiteTime ?? undefined) : undefined } blackTime={ - gameState === "playing" ? blackTime ?? undefined : undefined + gameState === "playing" ? (blackTime ?? undefined) : undefined } whiteTc={players.white.timeControl} blackTc={players.black.timeControl} diff --git a/src/components/common/AccountCards.tsx b/src/components/common/AccountCards.tsx index 20e9ac5d..731a69ed 100644 --- a/src/components/common/AccountCards.tsx +++ b/src/components/common/AccountCards.tsx @@ -154,8 +154,9 @@ function PlayerSession({ - {sessions.map((session) => ( + {sessions.map((session, i) => ( ( - <> + - + )) : []; diff --git a/src/components/panels/analysis/AnalysisPanel.tsx b/src/components/panels/analysis/AnalysisPanel.tsx index 5db94bf3..6b4abe5f 100644 --- a/src/components/panels/analysis/AnalysisPanel.tsx +++ b/src/components/panels/analysis/AnalysisPanel.tsx @@ -110,163 +110,156 @@ function AnalysisPanel() { flexDirection: "column", }} > - <> - - document.dispatchEvent(new Event("analysis-panel-scroll")) - } - > - {pos && - (getPiecesCount(pos) <= 7 || - (getPiecesCount(pos) === 8 && hasCaptures(pos))) && ( - <> - - - - )} - {loadedEngines.length > 1 && ( - - - - - {t("Board.Analysis.Summary")} - - - - - {loadedEngines.map((engine, i) => ( - - ))} - - - + + document.dispatchEvent(new Event("analysis-panel-scroll")) + } + > + {pos && + (getPiecesCount(pos) <= 7 || + (getPiecesCount(pos) === 8 && hasCaptures(pos))) && ( + <> + + + )} - - e.name)} - value={expanded} - onChange={(v) => setExpanded(v)} - styles={{ - label: { - paddingTop: 0, - paddingBottom: 0, - }, - content: { - padding: "0.3rem", - }, - }} - > - - destination?.index !== undefined && - setEngines(async (prev) => { - const result = Array.from(await prev); - const prevLoaded = result.filter((e) => e.loaded); - const [removed] = prevLoaded.splice(source.index, 1); - prevLoaded.splice(destination.index, 0, removed); + {loadedEngines.length > 1 && ( + + + + + {t("Board.Analysis.Summary")} + + + + + {loadedEngines.map((engine, i) => ( + + ))} + + + + )} + + e.name)} + value={expanded} + onChange={(v) => setExpanded(v)} + styles={{ + label: { + paddingTop: 0, + paddingBottom: 0, + }, + content: { + padding: "0.3rem", + }, + }} + > + + destination?.index !== undefined && + setEngines(async (prev) => { + const result = Array.from(await prev); + const prevLoaded = result.filter((e) => e.loaded); + const [removed] = prevLoaded.splice(source.index, 1); + prevLoaded.splice(destination.index, 0, removed); - result.forEach((e, i) => { - if (e.loaded) { - result[i] = prevLoaded.shift()!; - } - }); - return result; - }) - } - > - - {(provided) => ( -
- - {loadedEngines.map((engine, i) => ( - - {(provided) => ( -
- - - -
- )} -
- ))} -
+ result.forEach((e, i) => { + if (e.loaded) { + result[i] = prevLoaded.shift()!; + } + }); + return result; + }) + } + > + + {(provided) => ( +
+ + {loadedEngines.map((engine, i) => ( + + {(provided) => ( +
+ + + +
+ )} +
+ ))} +
- {provided.placeholder} -
- )} -
- - - - - - - - - - + {provided.placeholder} +
+ )} +
+
+
+ + + + + + + + - - - - - -
-
- + + + + + + +