Make Yes/No buttons flex. Estimated winnings => Max payout (estimated)
This commit is contained in:
parent
36591539d3
commit
81d3c09e60
|
@ -38,14 +38,7 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
|
||||||
|
|
||||||
const amount = parseInt(str)
|
const amount = parseInt(str)
|
||||||
|
|
||||||
if (
|
if (str && isNaN(amount)) return
|
||||||
(str && isNaN(amount)) ||
|
|
||||||
// Don't update to amount that is rendered in exponential notation.
|
|
||||||
// e.g. '1e21'
|
|
||||||
amount.toString().includes('e')
|
|
||||||
) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
setBetAmount(str ? amount : undefined)
|
setBetAmount(str ? amount : undefined)
|
||||||
|
|
||||||
|
@ -68,7 +61,7 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
|
||||||
amount: betAmount,
|
amount: betAmount,
|
||||||
outcome: betChoice,
|
outcome: betChoice,
|
||||||
contractId: contract.id,
|
contractId: contract.id,
|
||||||
}).then(r => r.data as any)
|
}).then((r) => r.data as any)
|
||||||
|
|
||||||
console.log('placed bet. Result:', result)
|
console.log('placed bet. Result:', result)
|
||||||
|
|
||||||
|
@ -111,7 +104,7 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
|
||||||
|
|
||||||
<div className="mt-2 mb-1 text-sm text-gray-400">Outcome</div>
|
<div className="mt-2 mb-1 text-sm text-gray-400">Outcome</div>
|
||||||
<YesNoSelector
|
<YesNoSelector
|
||||||
className="mx-auto my-2"
|
className="my-2"
|
||||||
selected={betChoice}
|
selected={betChoice}
|
||||||
onSelect={(choice) => onBetChoice(choice)}
|
onSelect={(choice) => onBetChoice(choice)}
|
||||||
/>
|
/>
|
||||||
|
@ -149,7 +142,7 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
|
||||||
<div>{formatPercent(resultProb)}</div>
|
<div>{formatPercent(resultProb)}</div>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<div className="mt-2 mb-1 text-sm text-gray-400">Estimated winnings</div>
|
<div className="mt-2 mb-1 text-sm text-gray-400">Max payout (estimated)</div>
|
||||||
<div>
|
<div>
|
||||||
{formatMoney(estimatedWinnings)} (+{estimatedReturnPercent})
|
{formatMoney(estimatedWinnings)} (+{estimatedReturnPercent})
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -79,7 +79,7 @@ function Button(props: {
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'inline-flex items-center px-8 py-3 border border-transparent rounded-md shadow-sm text-sm font-medium text-white',
|
'flex-1 inline-flex justify-center items-center px-8 py-3 border border-transparent rounded-md shadow-sm text-sm font-medium text-white',
|
||||||
color === 'green' && 'btn-primary',
|
color === 'green' && 'btn-primary',
|
||||||
color === 'red' && 'bg-red-400 hover:bg-red-500',
|
color === 'red' && 'bg-red-400 hover:bg-red-500',
|
||||||
color === 'yellow' && 'bg-yellow-400 hover:bg-yellow-500',
|
color === 'yellow' && 'bg-yellow-400 hover:bg-yellow-500',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user