From 0390e851fcf03057bb8a1ab12231162c80be1395 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 16 Mar 2022 18:08:33 -0500 Subject: [PATCH] Show loan summary above bets table. Remove parenthetical loan amount per bet. --- web/components/bets-list.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index 4b367621..388e3ad4 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -437,6 +437,8 @@ export function ContractBetsTable(props: { -0.5 * _.sumBy(redemptions, (b) => b.shares) ) + const amountLoaned = _.sumBy(bets, (bet) => bet.loanAmount ?? 0) + const { isResolved, mechanism } = contract const isCPMM = mechanism === 'cpmm-1' @@ -452,6 +454,15 @@ export function ContractBetsTable(props: { )} + {!isResolved && amountLoaned > 0 && ( + <> +
+ You currently have a loan of {formatMoney(amountLoaned)}. +
+ + + )} + @@ -529,10 +540,7 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) { - + {!isCPMM && } {!isCPMM && !isResolved && }
- {formatMoney(amount)} - {loanAmount ? ` (${formatMoney(loanAmount ?? 0)} loan)` : ''} - {formatMoney(amount)}{saleDisplay}{payoutIfChosenDisplay}{formatWithCommas(shares)}