Add a loading spinner on submission
This commit is contained in:
parent
1da3cc7725
commit
b6c5ad730a
|
@ -124,11 +124,12 @@ export function BetPanel(props: { contract: Contract; className?: string }) {
|
||||||
? 'btn-disabled'
|
? 'btn-disabled'
|
||||||
: betChoice === 'YES'
|
: betChoice === 'YES'
|
||||||
? 'btn-primary'
|
? 'btn-primary'
|
||||||
: 'bg-red-400 hover:bg-red-500 border-none'
|
: 'bg-red-400 hover:bg-red-500 border-none',
|
||||||
|
isSubmitting ? 'loading' : ''
|
||||||
)}
|
)}
|
||||||
onClick={betDisabled ? undefined : submitBet}
|
onClick={betDisabled ? undefined : submitBet}
|
||||||
>
|
>
|
||||||
Place bet
|
{isSubmitting ? 'Submitting...' : 'Place bet'}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{wasSubmitted && <div className="mt-4">Bet submitted!</div>}
|
{wasSubmitted && <div className="mt-4">Bet submitted!</div>}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user