From 8dc41fca2c79837b9790d9ce5b971bce75314dab Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Thu, 4 Dec 2025 19:24:14 +0530 Subject: [PATCH] using correct props instead of internal props for TicTacToeGame.tsx and BattleshipGame.tsx --- src/games/battleship/BattleshipGame.tsx | 14 ++------------ src/games/tictactoe/TicTacToeGame.tsx | 13 ++----------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/games/battleship/BattleshipGame.tsx b/src/games/battleship/BattleshipGame.tsx index dcdc7d2..78d151c 100644 --- a/src/games/battleship/BattleshipGame.tsx +++ b/src/games/battleship/BattleshipGame.tsx @@ -1,20 +1,10 @@ import React, { useMemo } from "react"; import { motion } from "framer-motion"; import { useNakama } from "../../providers/NakamaProvider"; -import { PlayerModel } from "../../interfaces/models"; import PlacementGrid from "./placement/PlacementGrid"; import ShotGrid from "./battle/ShotGrid"; - -interface BattleBoardProps { - boards: Record; - players: PlayerModel[]; - myUserId: string | null; - turn: number; - winner: string | null; - gameOver: boolean | null; - metadata: Record; -} +import { BattleshipGameProps } from "./props"; const Fleet: Record = { carrier: 5, @@ -33,7 +23,7 @@ export default function BattleshipGame({ winner, gameOver, metadata, -}: BattleBoardProps) { +}: BattleshipGameProps) { const { sendMatchData, matchId } = useNakama(); const myIndex = players.findIndex((p) => p.user_id === myUserId); diff --git a/src/games/tictactoe/TicTacToeGame.tsx b/src/games/tictactoe/TicTacToeGame.tsx index 52b4ebf..0caab84 100644 --- a/src/games/tictactoe/TicTacToeGame.tsx +++ b/src/games/tictactoe/TicTacToeGame.tsx @@ -2,17 +2,8 @@ import React, { useEffect, useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { useNakama } from "../../providers/NakamaProvider"; import getHaiku from "../../utils/haikus"; -import { PlayerModel } from "../../interfaces/models"; -interface BoardProps { - boards: Record; - turn: number; - winner: string | null; - gameOver: boolean | null; - players: PlayerModel[]; - myUserId: string | null; - onCellClick: (row: number, col: number) => void; -} +import { TicTacToeGameProps } from "./props"; export default function TicTacToeGame({ boards, @@ -22,7 +13,7 @@ export default function TicTacToeGame({ players, myUserId, onCellClick, -}: BoardProps) { +}: TicTacToeGameProps) { const myIndex = players.findIndex(p => p.user_id === myUserId); const gameReady = players.length === 2; const {