Skip to content

Commit

Permalink
fix() hide button for spec
Browse files Browse the repository at this point in the history
  • Loading branch information
immortal-tofu committed Dec 5, 2023
1 parent 855e8ec commit 6983a3f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/modules/game/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export const Table = ({ contract, account, players }: TableProps) => {
setDealInProgress(false);
};

const inGame = players.some((p) => p.address === account);

return (
<div>
<Title>Cipher Bomb</Title>
Expand All @@ -115,7 +117,7 @@ export const Table = ({ contract, account, players }: TableProps) => {
<br />
Current turn: {currentTurn + 1} ({5 - currentTurn} cards)
</p>
{dealIsNeeded && (
{inGame && dealIsNeeded && (
<div className="Table__deal">
<Button onClick={onDeal} disabled={dealInProgress}>
Deal cards
Expand All @@ -124,14 +126,16 @@ export const Table = ({ contract, account, players }: TableProps) => {
</div>
)}
</div>
<div>
<div className="Table__actions">
<Subtitle>Your role</Subtitle>
<p>
<Button onClick={onRole}>See my role</Button>
</p>
{inGame && (
<div>
<div className="Table__actions">
<Subtitle>Your role</Subtitle>
<p>
<Button onClick={onRole}>See my role</Button>
</p>
</div>
</div>
</div>
)}
</div>
<TablePlayers
dealIsNeeded={dealIsNeeded}
Expand Down

0 comments on commit 6983a3f

Please sign in to comment.