update game logic and UI components for move selection and reveal phases; remove Lobby component

This commit is contained in:
averel10
2025-11-21 18:18:59 +01:00
parent 2d7dd6ccdb
commit 06176e74f2
8 changed files with 391 additions and 416 deletions

View File

@@ -15,6 +15,8 @@ export default function Clash() {
// Inputs for contract functions
const [phase, setPhase] = useState<"games" | "commit" | "reveal">("games");
const [selectedMove, setSelectedMove] = useState<string | null>(null);
const [secret, setSecret] = useState<string>("");
const handlePlayClick = (gameId: number) => {
setPhase("commit");
@@ -138,6 +140,10 @@ export default function Clash() {
config={config}
web3={web3}
setStatus={setStatus}
selectedMove={selectedMove}
setSelectedMove={setSelectedMove}
secret={secret}
setSecret={setSecret}
/>
)}
{phase === "reveal" && (
@@ -147,6 +153,8 @@ export default function Clash() {
config={config}
web3={web3}
setStatus={setStatus}
selectedMove={selectedMove}
secret={secret}
/>
)}
</div>