Update bets table to show BUY or SELL
This commit is contained in:
parent
43b404e7ed
commit
ea51633caa
|
@ -340,8 +340,11 @@ function SellPanel(props: {
|
||||||
setError(undefined)
|
setError(undefined)
|
||||||
setIsSubmitting(true)
|
setIsSubmitting(true)
|
||||||
|
|
||||||
|
// Sell all shares if remaining shares would be < 1
|
||||||
|
const sellAmount = amount === Math.floor(shares) ? shares : amount
|
||||||
|
|
||||||
const result = await sellShares({
|
const result = await sellShares({
|
||||||
shares: amount,
|
shares: sellAmount,
|
||||||
outcome: sharesOutcome,
|
outcome: sharesOutcome,
|
||||||
contractId: contract.id,
|
contractId: contract.id,
|
||||||
}).then((r) => r.data)
|
}).then((r) => r.data)
|
||||||
|
|
|
@ -472,6 +472,7 @@ export function ContractBetsTable(props: {
|
||||||
<thead>
|
<thead>
|
||||||
<tr className="p-2">
|
<tr className="p-2">
|
||||||
<th></th>
|
<th></th>
|
||||||
|
{isCPMM && <th>Type</th>}
|
||||||
<th>Outcome</th>
|
<th>Outcome</th>
|
||||||
<th>Amount</th>
|
<th>Amount</th>
|
||||||
{!isCPMM && <th>{isResolved ? <>Payout</> : <>Sale price</>}</th>}
|
{!isCPMM && <th>{isResolved ? <>Payout</> : <>Sale price</>}</th>}
|
||||||
|
@ -541,13 +542,14 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) {
|
||||||
<SellButton contract={contract} bet={bet} />
|
<SellButton contract={contract} bet={bet} />
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
|
{isCPMM && <td>{shares >= 0 ? 'BUY' : 'SELL'}</td>}
|
||||||
<td>
|
<td>
|
||||||
<OutcomeLabel outcome={outcome} />
|
<OutcomeLabel outcome={outcome} />
|
||||||
</td>
|
</td>
|
||||||
<td>{formatMoney(amount)}</td>
|
<td>{formatMoney(Math.abs(amount))}</td>
|
||||||
{!isCPMM && <td>{saleDisplay}</td>}
|
{!isCPMM && <td>{saleDisplay}</td>}
|
||||||
{!isCPMM && !isResolved && <td>{payoutIfChosenDisplay}</td>}
|
{!isCPMM && !isResolved && <td>{payoutIfChosenDisplay}</td>}
|
||||||
<td>{formatWithCommas(shares)}</td>
|
<td>{formatWithCommas(Math.abs(shares))}</td>
|
||||||
<td>
|
<td>
|
||||||
{formatPercent(probBefore)} → {formatPercent(probAfter)}
|
{formatPercent(probBefore)} → {formatPercent(probAfter)}
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user