From d6ea65f0f720c38fce006fffa168b39680a1695a Mon Sep 17 00:00:00 2001 From: averel10 Date: Sat, 22 Nov 2025 09:50:04 +0100 Subject: [PATCH] Display ETH winnings based on game outcome in Reveal component --- crypto_clash_frontend/app/clash/Reveal.tsx | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crypto_clash_frontend/app/clash/Reveal.tsx b/crypto_clash_frontend/app/clash/Reveal.tsx index da70971..bfe247d 100644 --- a/crypto_clash_frontend/app/clash/Reveal.tsx +++ b/crypto_clash_frontend/app/clash/Reveal.tsx @@ -319,6 +319,30 @@ export default function Reveal({ {outcomeData.name} + {/* Display ETH winnings */} + {gameDetails && ( +
+

+ {outcome === 1 ? "You Won" : outcome === 3 ? "Draw" : "You Lost"} +

+

+ {outcome === 1 ? ( + <> + +{web3?.utils.fromWei(String(BigInt(gameDetails.initialBet) * BigInt(2)), "ether")} ETH + + ) : outcome === 3 ? ( + <> + +{web3?.utils.fromWei(gameDetails.initialBet, "ether")} ETH + + ) : ( + <> + -{web3?.utils.fromWei(gameDetails.initialBet, "ether")} ETH + + )} +

+
+ )} + {/* Show Claim Coins button only on win or draw and if game is active */} {(outcome === 1 || outcome === 3) && gameDetails?.isActive && (