Skip to content

Commit

Permalink
Still can't solve the betAmount issue on createChallengeBox
Browse files Browse the repository at this point in the history
  • Loading branch information
luloxi committed Jan 7, 2024
1 parent 0339ad2 commit 1e85518
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const CreateChallengeBox = ({}) => {
contractName: "TicTacToe",
functionName: "createGame",
args: [player2Address],
// value: betAmount ? betAmount.toString() : undefined,
// value: betAmount ? betAmount : undefined,
});

console.log("Bet amount: ", betAmount);
Expand Down
19 changes: 11 additions & 8 deletions packages/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,19 @@ const Home: NextPage = () => {
<CardBody>
<Heading size="xl">⭕ See your active challenges! ❌</Heading>
<Flex direction="column" alignItems="center" justifyContent="center">
{gameCards?.map(({ gameId, player1, player2 /* , bet */ }) => (
{gameCards?.map(({ gameId, player1, player2, bet }) => (
<>
<p>GameId: {gameId}</p>
<p>
Player 1: <Address address={player1} />
</p>
<p>
Player 2: <Address address={player2} />
</p>
{/* <p>Bet: {ethers.utils.formatEther(bet.toString())} ETH</p> */}
<Flex direction="row" gap={6}>
<p>
Player 1: <Address address={player1} />
</p>
<p>
Player 2: <Address address={player2} />
</p>
<p>Bet: {bet.toString()} ETH</p>
</Flex>
<span>------------------------</span>
</>
))}
</Flex>
Expand Down

0 comments on commit 1e85518

Please sign in to comment.