From a09af526a0e3fa8664fd984cd77fda2930967653 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 13 Apr 2022 17:57:46 -0500 Subject: [PATCH] Switch summary stat from payout at current % to profit --- web/components/bets-list.tsx | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index e32fc3f3..362b4ea5 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -317,7 +317,7 @@ export function MyBetsSummary(props: { const noWinnings = _.sumBy(excludeSales, (bet) => calculatePayout(contract, bet, 'NO') ) - const { invested, profitPercent, payout } = getContractBetMetrics( + const { invested, profitPercent, payout, profit } = getContractBetMetrics( contract, bets ) @@ -343,7 +343,7 @@ export function MyBetsSummary(props: { ) : ( <> - {isBinary && ( + {isBinary ? ( <>
@@ -362,24 +362,22 @@ export function MyBetsSummary(props: {
+ ) : ( + +
+ Current value +
+
{formatMoney(payout)}
+ )} - -
- {isBinary ? ( - <> - Payout at{' '} - - {formatPercent(getProbability(contract))} - - - ) : ( - <>Current payout - )} -
-
{formatMoney(payout)}
- )} + +
Profit
+
+ {formatMoney(profit)} +
+ )