Add a loading spinner on submission

This commit is contained in:
Austin Chen 2021-12-14 01:07:11 -08:00
parent 1da3cc7725
commit b6c5ad730a

View File

@ -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>}