From 0f066d7e8eba5e90dcebb5fc75a7b1f946df5ac3 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 16 Feb 2022 00:08:05 -0600 Subject: [PATCH] Tweaks for trades page --- web/components/bets-list.tsx | 41 ++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index 2fd8cca0..7fccc2c0 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -177,10 +177,13 @@ export function BetsList(props: { user: User }) { function MyContractBets(props: { contract: Contract; bets: Bet[] }) { const { bets, contract } = props - const { resolution } = contract + const { resolution, outcomeType } = contract const [collapsed, setCollapsed] = useState(true) + + const isBinary = outcomeType === 'BINARY' const probPercent = getBinaryProbPercent(contract) + return (
- {resolution ? ( -
- Resolved -
- ) : ( -
{probPercent}
+ {isBinary && ( + <> + {resolution ? ( +
+ Resolved +
+ ) : ( +
{probPercent}
+ )} +
+ )} -
!b.isSold && !b.sale) const betsTotal = _.sumBy(excludeSales, (bet) => bet.amount) @@ -345,10 +352,16 @@ export function MyBetsSummary(props: {
- Payout at{' '} - - {formatPercent(getProbability(contract.totalShares))} - + {isBinary ? ( + <> + Payout at{' '} + + {formatPercent(getProbability(contract.totalShares))} + + + ) : ( + <>Current payout + )}
{formatMoney(marketWinnings)}