Show loan summary above bets table. Remove parenthetical loan amount per bet.
This commit is contained in:
parent
4847939e8c
commit
0390e851fc
|
@ -437,6 +437,8 @@ export function ContractBetsTable(props: {
|
||||||
-0.5 * _.sumBy(redemptions, (b) => b.shares)
|
-0.5 * _.sumBy(redemptions, (b) => b.shares)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const amountLoaned = _.sumBy(bets, (bet) => bet.loanAmount ?? 0)
|
||||||
|
|
||||||
const { isResolved, mechanism } = contract
|
const { isResolved, mechanism } = contract
|
||||||
const isCPMM = mechanism === 'cpmm-1'
|
const isCPMM = mechanism === 'cpmm-1'
|
||||||
|
|
||||||
|
@ -452,6 +454,15 @@ export function ContractBetsTable(props: {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{!isResolved && amountLoaned > 0 && (
|
||||||
|
<>
|
||||||
|
<div className="text-gray-500 text-sm pl-2">
|
||||||
|
You currently have a loan of {formatMoney(amountLoaned)}.
|
||||||
|
</div>
|
||||||
|
<Spacer h={4} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
<table className="table-zebra table-compact table w-full text-gray-500">
|
<table className="table-zebra table-compact table w-full text-gray-500">
|
||||||
<thead>
|
<thead>
|
||||||
<tr className="p-2">
|
<tr className="p-2">
|
||||||
|
@ -529,10 +540,7 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) {
|
||||||
<td>
|
<td>
|
||||||
<OutcomeLabel outcome={outcome} />
|
<OutcomeLabel outcome={outcome} />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>{formatMoney(amount)}</td>
|
||||||
{formatMoney(amount)}
|
|
||||||
{loanAmount ? ` (${formatMoney(loanAmount ?? 0)} loan)` : ''}
|
|
||||||
</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(shares)}</td>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user