style : enhance load game UI

This commit is contained in:
GuillaumeSD
2025-06-16 05:01:52 +02:00
parent 5e2d944513
commit f906c81c67
10 changed files with 52 additions and 72 deletions

View File

@@ -85,7 +85,7 @@ export default function ChessComInput({ onSelect }: Props) {
return (
<>
<FormControl sx={{ m: 1, width: 300 }}>
<FormControl sx={{ my: 1, width: 300 }}>
<Autocomplete
freeSolo
options={storedValues}
@@ -147,7 +147,7 @@ export default function ChessComInput({ onSelect }: Props) {
No games found. Please check your username.
</span>
) : (
<List sx={{ width: "100%", maxWidth: 800 }}>
<List sx={{ width: "100%" }}>
{games.map((game) => {
const perspectiveUserColor =
game.white.name.toLowerCase() ===
@@ -161,11 +161,11 @@ export default function ChessComInput({ onSelect }: Props) {
game={game}
perspectiveUserColor={perspectiveUserColor}
onClick={() => {
updateHistory(debouncedUsername);
const boardOrientation =
debouncedUsername.toLowerCase() !==
game.black?.name?.toLowerCase();
onSelect(game.pgn, boardOrientation);
updateHistory(debouncedUsername);
}}
/>
);