diff --git a/src/components/Board/GameBoard.tsx b/src/components/Board/GameBoard.tsx index ea235b6d..4ad73b4c 100644 --- a/src/components/Board/GameBoard.tsx +++ b/src/components/Board/GameBoard.tsx @@ -142,7 +142,7 @@ export const GameBoard: React.FC = ({ fen, lastMove, check: currentNode.check - ? (currentNode.turn === 'w' ? 'white' : 'black') + ? ((currentNode.turn === 'w' ? 'white' : 'black') as 'white' | 'black') : false, orientation: orientation as 'white' | 'black', } diff --git a/src/components/Board/GameClock.tsx b/src/components/Board/GameClock.tsx index 6b5d5594..c9e198a7 100644 --- a/src/components/Board/GameClock.tsx +++ b/src/components/Board/GameClock.tsx @@ -59,9 +59,7 @@ export const GameClock: React.FC = ( const showTenths = minutes < 1 && seconds <= 20 return ( -
+
= (
{minutes}:{('00' + seconds).slice(-2)} diff --git a/src/components/Common/MaterialBalance.tsx b/src/components/Common/MaterialBalance.tsx index 006eec6c..63248075 100644 --- a/src/components/Common/MaterialBalance.tsx +++ b/src/components/Common/MaterialBalance.tsx @@ -2,6 +2,18 @@ import { useMemo } from 'react' import type { Color } from 'src/types' import { Chess } from 'chess.ts' +declare module 'react' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace JSX { + interface IntrinsicElements { + piece: React.DetailedHTMLProps< + React.HTMLAttributes, + HTMLElement + > + } + } +} + type PieceType = 'p' | 'n' | 'b' | 'r' | 'q' | 'k' type MaterialCount = Record @@ -170,8 +182,7 @@ export const MaterialBalance = ({ const capturedPieceColor = color === 'white' ? 'black' : 'white' const capturedPieceFilter = - pieceFilter ?? - capturedPieceColor === 'black' + (pieceFilter ?? capturedPieceColor === 'black') ? 'drop-shadow(0 0 0.8px rgba(255,255,255,0.82)) drop-shadow(0 0 1.5px rgba(255,255,255,0.28))' : 'drop-shadow(0 0 0.8px rgba(0,0,0,0.82)) drop-shadow(0 0 1.5px rgba(0,0,0,0.22))'