From 07ed6063be1d523e72e30f1c30491072187d197e Mon Sep 17 00:00:00 2001 From: Lulox Date: Fri, 12 Jan 2024 16:01:31 -0300 Subject: [PATCH] Trying some responsive on list of boards --- .../components/tictactoe/TicTacToeBoard.tsx | 34 +++++++------------ packages/nextjs/pages/index.tsx | 4 +-- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/packages/nextjs/components/tictactoe/TicTacToeBoard.tsx b/packages/nextjs/components/tictactoe/TicTacToeBoard.tsx index 2cdbdd0..06ac6e6 100755 --- a/packages/nextjs/components/tictactoe/TicTacToeBoard.tsx +++ b/packages/nextjs/components/tictactoe/TicTacToeBoard.tsx @@ -15,14 +15,13 @@ const TicTacToeBoard: React.FC = ({ game, isGameAccepted, i args: [BigInt(game.gameId)], }); - const { data: numberOfMoves } = useScaffoldContractRead({ - contractName: "TicTacToe", - functionName: "getNumberOfMoves", - args: [BigInt(game.gameId)], - }); + // const { data: numberOfMoves } = useScaffoldContractRead({ + // contractName: "TicTacToe", + // functionName: "getNumberOfMoves", + // args: [BigInt(game.gameId)], + // }); console.log("boardFromContract: ", boardFromContract); - console.log("numberOfMoves: ", numberOfMoves); useEffect(() => { // Update the local board based on the latest data from the contract @@ -60,13 +59,9 @@ const TicTacToeBoard: React.FC = ({ game, isGameAccepted, i {game.gameId} - - - Player 1:
- - - Player 2:
- + +
{isGameAccepted ? "is playing against" : "has challenged"}{" "} +
{isGameAccepted ? ( "" @@ -75,18 +70,18 @@ const TicTacToeBoard: React.FC = ({ game, isGameAccepted, i direction="row" alignItems={"center"} textAlign={"center"} - justifyContent={"space-around"} + justifyContent={"center"} gap={6} paddingBottom={3} > + + Each player bets:
{parseFloat(ethers.formatEther(game.bet.toString())).toFixed(4)} ETH +
- - Each player bets:
{parseFloat(ethers.formatEther(game.bet.toString())).toFixed(4)} ETH -
)} {isGameAccepted ? ( @@ -101,10 +96,7 @@ const TicTacToeBoard: React.FC = ({ game, isGameAccepted, i Each player betted:
{parseFloat(ethers.formatEther(game.bet.toString())).toFixed(4)} ETH
- - # of moves made:
- {numberOfMoves} -
+ Game state:
{isGameFinished ? "Finished" : "Not finished"} diff --git a/packages/nextjs/pages/index.tsx b/packages/nextjs/pages/index.tsx index 72a2887..02587ea 100644 --- a/packages/nextjs/pages/index.tsx +++ b/packages/nextjs/pages/index.tsx @@ -158,14 +158,14 @@ const Home: NextPage = () => { filter: "brightness(0.3)", }} /> - +