Clear bet input on submit

This commit is contained in:
jahooma 2021-12-13 17:59:05 -06:00
parent c6b860c0c8
commit 7e08a68799
2 changed files with 4 additions and 3 deletions

View File

@ -48,9 +48,10 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
setIsSubmitting(false)
setWasSubmitted(true)
setBetAmount(undefined)
}
const betDisabled = isSubmitting || wasSubmitted
const betDisabled = isSubmitting || !betAmount
const initialProb = getProbability(contract.pot, betChoice)
const resultProb = getProbability(contract.pot, betChoice, betAmount)
@ -123,7 +124,7 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
? 'btn-disabled'
: betChoice === 'YES'
? 'btn-primary'
: 'bg-red-400 hover:bg-red-500 focus:ring-red-400 border-none'
: 'bg-red-400 hover:bg-red-500 border-none'
)}
onClick={betDisabled ? undefined : submitBet}
>

View File

@ -51,7 +51,7 @@ export const ContractOverview = (props: {
<Spacer h={12} />
<div className="text-gray-600">{contract.description}</div>
<div className="text-gray-600 whitespace-pre-line">{contract.description}</div>
</Col>
)
}