From 1805a30dd165a39e2e22591cf6d73eff9bc2c1fb Mon Sep 17 00:00:00 2001 From: Lulox Date: Fri, 12 Jan 2024 13:23:24 -0300 Subject: [PATCH] Fix Hydration error and frontend changes --- packages/hardhat/contracts/TicTacToe.sol | 4 + packages/nextjs/components/Header.tsx | 7 +- .../components/tictactoe/TicTacToeBoard.tsx | 157 +++++++++++------- .../nextjs/contracts/deployedContracts.ts | 21 ++- packages/nextjs/pages/index.tsx | 56 ++----- packages/nextjs/types/TicTacToeTypes.ts | 2 - 6 files changed, 134 insertions(+), 113 deletions(-) diff --git a/packages/hardhat/contracts/TicTacToe.sol b/packages/hardhat/contracts/TicTacToe.sol index 56f4e2a..34b99b8 100644 --- a/packages/hardhat/contracts/TicTacToe.sol +++ b/packages/hardhat/contracts/TicTacToe.sol @@ -307,6 +307,10 @@ contract TicTacToe { return games[_gameId].moves % 2 == 0 ? 1 : 2; } + function getNumberOfMoves(uint256 _gameId) public view returns (uint8) { + return games[_gameId].moves; + } + function getBoard(uint256 _gameId) external view returns (uint8[9] memory) { return games[_gameId].board; } diff --git a/packages/nextjs/components/Header.tsx b/packages/nextjs/components/Header.tsx index 11d9754..1bfe22c 100644 --- a/packages/nextjs/components/Header.tsx +++ b/packages/nextjs/components/Header.tsx @@ -92,12 +92,7 @@ export const Header = () => {
TicTacToe - - Made with{" "} - - Scaffold-ETH 2 - - + Made with Scaffold-ETH 2