diff --git a/src/App.tsx b/src/App.tsx index b3e4365..7d09888 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,7 +5,7 @@ import { useNakama } from "./providers/NakamaProvider"; import Player from "./Player"; import TicTacToeGame from "./games/tictactoe/TicTacToeGame"; import { TicTacToeGameProps } from "./games/tictactoe/props"; -import BattleShipGame from "./games/battleship/BattleShipGame"; +import BattleshipGame from "./games/battleship/BattleshipGame" import { BattleshipGameProps } from "./games/battleship/props"; import { GameState } from "./interfaces/states"; @@ -33,6 +33,14 @@ export default function App() { players: game.players, myUserId: session?.user_id ?? null, }; + const ticTacToeProps: TicTacToeGameProps = { + ...commonProps, + onCellClick: handleCellClick, + }; + const battleshipProps: BattleshipGameProps = { + ...commonProps, + metadata: game.metadata, + }; // --------------------------------------------------- // RENDER GAME BOARD @@ -44,16 +52,14 @@ export default function App() { case "tictactoe": return ( ); case "battleship": return ( - ); diff --git a/src/games/battleship/BattleShipGame.tsx b/src/games/battleship/BattleshipGame.tsx similarity index 97% rename from src/games/battleship/BattleShipGame.tsx rename to src/games/battleship/BattleshipGame.tsx index a280031..dcdc7d2 100644 --- a/src/games/battleship/BattleShipGame.tsx +++ b/src/games/battleship/BattleshipGame.tsx @@ -1,7 +1,7 @@ import React, { useMemo } from "react"; import { motion } from "framer-motion"; import { useNakama } from "../../providers/NakamaProvider"; -import { PlayerModel } from "../../models/player"; +import { PlayerModel } from "../../interfaces/models"; import PlacementGrid from "./placement/PlacementGrid"; import ShotGrid from "./battle/ShotGrid"; @@ -25,7 +25,7 @@ const Fleet: Record = { }; const FLEET_ORDER = ["carrier", "battleship", "cruiser", "submarine", "destroyer"]; -export default function BattleShipGame({ +export default function BattleshipGame({ boards, players, myUserId, diff --git a/src/games/tictactoe/TicTacToeGame.tsx b/src/games/tictactoe/TicTacToeGame.tsx index 4f69085..52b4ebf 100644 --- a/src/games/tictactoe/TicTacToeGame.tsx +++ b/src/games/tictactoe/TicTacToeGame.tsx @@ -2,7 +2,7 @@ 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 "../../models/player"; +import { PlayerModel } from "../../interfaces/models"; interface BoardProps { boards: Record;