From 081449b12e4dc9623729eff7fbcb2df495631ec3 Mon Sep 17 00:00:00 2001 From: Nathaniel Tampus Date: Sun, 8 Jan 2023 21:05:08 +0800 Subject: [PATCH] update type annotations --- client/src/components/Board/Board.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/components/Board/Board.tsx b/client/src/components/Board/Board.tsx index 1b5c29e..6a6f96e 100644 --- a/client/src/components/Board/Board.tsx +++ b/client/src/components/Board/Board.tsx @@ -1,6 +1,6 @@ import { useContext, useState, useEffect, useReducer } from "react"; -import { Chess, Move } from "chess.js"; -import { Chessboard, Square, Pieces } from "react-chessboard"; +import { Chess, Move, Square } from "chess.js"; +import { Chessboard } from "react-chessboard"; import { SocketContext } from "../../context/socket"; import { SessionContext } from "../../context/session"; import type { Game } from "@types"; @@ -92,7 +92,7 @@ const Board = () => { return result; } - function isDraggablePiece({ piece }: { piece: Pieces }) { + function isDraggablePiece({ piece }: { piece: string }) { if (side === "s") return true; return piece.startsWith(side); } @@ -139,7 +139,7 @@ const Board = () => { setOptionSquares(newSquares); } - function onPieceDragBegin(_piece: Pieces, sourceSquare: Square) { + function onPieceDragBegin(_piece: string, sourceSquare: Square) { if (side !== game.turn()) return; getMoveOptions(sourceSquare);