Clean up Sell popup UI

This commit is contained in:
Austin Chen 2022-03-01 18:28:59 -08:00
parent 4da8000363
commit 45fe430a5a

View File

@ -538,7 +538,7 @@ function SellButton(props: { contract: Contract; bet: Bet }) {
className: clsx('btn-sm', isSubmitting && 'btn-disabled loading'), className: clsx('btn-sm', isSubmitting && 'btn-disabled loading'),
label: 'Sell', label: 'Sell',
}} }}
submitBtn={{ className: 'btn-primary' }} submitBtn={{ className: 'btn-primary', label: 'Sell' }}
onSubmit={async () => { onSubmit={async () => {
setIsSubmitting(true) setIsSubmitting(true)
await sellBet({ contractId: contract.id, betId: bet.id }) await sellBet({ contractId: contract.id, betId: bet.id })
@ -546,22 +546,19 @@ function SellButton(props: { contract: Contract; bet: Bet }) {
}} }}
> >
<div className="mb-4 text-2xl"> <div className="mb-4 text-2xl">
Sell <OutcomeLabel outcome={bet.outcome} /> Sell {formatWithCommas(shares)} shares of{' '}
</div>
<div>
Do you want to sell {formatWithCommas(shares)} shares of{' '}
<OutcomeLabel outcome={outcome} /> for {formatMoney(saleAmount)}? <OutcomeLabel outcome={outcome} /> for {formatMoney(saleAmount)}?
</div> </div>
{!!loanAmount && ( {!!loanAmount && (
<div className="mt-2"> <div className="mt-2">
You will also pay back {formatMoney(loanAmount)} of your loan for a You will also pay back {formatMoney(loanAmount)} of your loan, for a
net of {formatMoney(saleAmount - loanAmount)}. net of {formatMoney(saleAmount - loanAmount)}.
</div> </div>
)} )}
<div className="mt-2 mb-1 text-sm"> <div className="mt-2 mb-1 text-sm">
(Updated probability: {formatPercent(initialProb)} {' '} Market probability: {formatPercent(initialProb)} {' '}
{formatPercent(outcomeProb)}) {formatPercent(outcomeProb)}
</div> </div>
</ConfirmationButton> </ConfirmationButton>
) )