From c9dfebb6a75432841697f2c7334e7727152c010e Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Tue, 5 Jul 2022 10:48:28 +0100 Subject: [PATCH] chore: Run prettier --- package.json | 1 + src/components/Board.tsx | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bebfe9d..53f9574 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "dev": "vite", "build": "tsc && vite build", "preview": "vite preview", + "format": "prettier --write .", "format:check": "prettier --check ." }, "dependencies": { diff --git a/src/components/Board.tsx b/src/components/Board.tsx index 7a9fc1c..e5539ec 100644 --- a/src/components/Board.tsx +++ b/src/components/Board.tsx @@ -113,7 +113,7 @@ const Board: FC = (props) => { const gameResult = useMemo(() => { if (validMoves.length === 0) { - const checked = isChecked(currentState) + const checked = isChecked(currentState); return checked[sideToMove] ? 'checkmate' : 'stalemate'; } return false; @@ -188,10 +188,19 @@ const Board: FC = (props) => { - {gameResult &&
- {gameResult === 'checkmate' &&

Checkmate! Winner: {otherSide(sideToMove)}!

} - {gameResult === 'stalemate' &&

Stalemate! There are no legal moves {sideToMove} can make :/

} -
} + {gameResult && ( +
+ {gameResult === 'checkmate' && ( +

Checkmate! Winner: {otherSide(sideToMove)}!

+ )} + {gameResult === 'stalemate' && ( +

+ Stalemate! There are no legal moves {sideToMove} can + make :/ +

+ )} +
+ )} {promotionMove && (