Skip to content

Commit

Permalink
Display the action buttons that are actionable only
Browse files Browse the repository at this point in the history
  • Loading branch information
predatorray committed Nov 23, 2024
1 parent d26b2d0 commit 63794a6
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,19 @@ function ActionButtons(props: {
callAmount === 0 ? 'CHECK' : <>CALL<br/>${callAmount}</>
}
</ActionButton>
<ActionButton className="action-raise" onClick={raiseUpToHalfPot}>RAISE<br/>1/2 pot</ActionButton>
<ActionButton className="action-raise" onClick={raiseUpToPot}>RAISE<br/>1 pot</ActionButton>
<ActionButton className="action-raise" onClick={raiseUpToTwicePot}>RAISE<br/>2 pot</ActionButton>
{
callAmount <= Math.ceil(potAmount / 2) && <ActionButton className="action-raise" onClick={raiseUpToHalfPot}>RAISE<br/>1/2 pot</ActionButton>
}
{
callAmount <= potAmount && <ActionButton className="action-raise" onClick={raiseUpToPot}>RAISE<br/>1 pot</ActionButton>
}
{
callAmount <= (potAmount * 2) && <ActionButton className="action-raise" onClick={raiseUpToTwicePot}>RAISE<br/>2 pot</ActionButton>
}
<ActionButton className="action-all-in" onClick={allIn}>ALL-IN</ActionButton>
<ActionButton className="action-fold" onClick={fold}>FOLD</ActionButton>
{
callAmount > 0 && <ActionButton className="action-fold" onClick={fold}>FOLD</ActionButton>
}
</div>
);
}
Expand Down

0 comments on commit 63794a6

Please sign in to comment.