Add column to bets table with payout if chosen. Rearrange columns. Tweak sell dialog wording.
This commit is contained in:
parent
a9b887a4f4
commit
4bc2833e11
|
@ -422,9 +422,10 @@ export function ContractBetsTable(props: {
|
||||||
<thead>
|
<thead>
|
||||||
<tr className="p-2">
|
<tr className="p-2">
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>{isResolved ? <>Payout</> : <>Sale price</>}</th>
|
|
||||||
<th>Outcome</th>
|
<th>Outcome</th>
|
||||||
<th>Amount</th>
|
<th>Amount</th>
|
||||||
|
<th>{isResolved ? <>Payout</> : <>Sale price</>}</th>
|
||||||
|
<th>Payout if chosen</th>
|
||||||
<th>Probability</th>
|
<th>Probability</th>
|
||||||
<th>Shares</th>
|
<th>Shares</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
|
@ -475,6 +476,8 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const payoutIfChosen = calculatePayout(contract, bet, bet.outcome)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr>
|
<tr>
|
||||||
<td className="text-neutral">
|
<td className="text-neutral">
|
||||||
|
@ -482,11 +485,12 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) {
|
||||||
<SellButton contract={contract} bet={bet} />
|
<SellButton contract={contract} bet={bet} />
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
<td>{saleDisplay}</td>
|
|
||||||
<td>
|
<td>
|
||||||
<OutcomeLabel outcome={outcome} />
|
<OutcomeLabel outcome={outcome} />
|
||||||
</td>
|
</td>
|
||||||
<td>{formatMoney(amount)}</td>
|
<td>{formatMoney(amount)}</td>
|
||||||
|
<td>{saleDisplay}</td>
|
||||||
|
<td>{formatMoney(payoutIfChosen)}</td>
|
||||||
<td>
|
<td>
|
||||||
{formatPercent(probBefore)} → {formatPercent(probAfter)}
|
{formatPercent(probBefore)} → {formatPercent(probAfter)}
|
||||||
</td>
|
</td>
|
||||||
|
@ -503,6 +507,7 @@ function SellButton(props: { contract: Contract; bet: Bet }) {
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const { contract, bet } = props
|
const { contract, bet } = props
|
||||||
|
const isBinary = contract.outcomeType === 'BINARY'
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||||
|
|
||||||
const initialProb = getOutcomeProbability(
|
const initialProb = getOutcomeProbability(
|
||||||
|
@ -541,8 +546,9 @@ function SellButton(props: { contract: Contract; bet: Bet }) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-2 mb-1 text-sm text-gray-500">
|
<div className="mt-2 mb-1 text-sm text-gray-500">
|
||||||
Implied probability: {formatPercent(initialProb)} →{' '}
|
({isBinary ? 'Updated' : <OutcomeLabel outcome={bet.outcome} />}{' '}
|
||||||
{formatPercent(outcomeProb)}
|
probability: {formatPercent(initialProb)} → {formatPercent(outcomeProb)}
|
||||||
|
)
|
||||||
</div>
|
</div>
|
||||||
</ConfirmationButton>
|
</ConfirmationButton>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user