From 7e08a6879949bc512b6114ac5c2cf322026a1fab Mon Sep 17 00:00:00 2001 From: jahooma Date: Mon, 13 Dec 2021 17:59:05 -0600 Subject: [PATCH] Clear bet input on submit --- web/components/bet-panel.tsx | 5 +++-- web/components/contract-overview.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/web/components/bet-panel.tsx b/web/components/bet-panel.tsx index 24f07ad4..e8dab680 100644 --- a/web/components/bet-panel.tsx +++ b/web/components/bet-panel.tsx @@ -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} > diff --git a/web/components/contract-overview.tsx b/web/components/contract-overview.tsx index 542774ca..ae34c36f 100644 --- a/web/components/contract-overview.tsx +++ b/web/components/contract-overview.tsx @@ -51,7 +51,7 @@ export const ContractOverview = (props: { -
{contract.description}
+
{contract.description}
) }