From 9ee71733055bbf7ade9b340f98709fc6cd6151aa Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Sat, 10 Sep 2022 17:48:35 -0600 Subject: [PATCH] Put sale value above quick bet button --- web/components/bet-button.tsx | 17 +------ web/components/contract/contract-overview.tsx | 2 +- web/components/contract/quick-bet-button.tsx | 48 ++++++++++++++----- 3 files changed, 39 insertions(+), 28 deletions(-) diff --git a/web/components/bet-button.tsx b/web/components/bet-button.tsx index 2aadbc78..75d12211 100644 --- a/web/components/bet-button.tsx +++ b/web/components/bet-button.tsx @@ -23,26 +23,11 @@ export default function BetButton(props: { const user = useUser() const userBets = useUserContractBets(user?.id, contract.id) - const { yesShares, noShares, hasYesShares, hasNoShares } = - useSaveBinaryShares(contract, userBets) - - const { outcomeType } = contract - const isPseudoNumeric = outcomeType === 'PSEUDO_NUMERIC' + const { hasYesShares, hasNoShares } = useSaveBinaryShares(contract, userBets) return ( <> - {user && ( -
- {hasYesShares - ? `(${Math.floor(yesShares)} ${ - isPseudoNumeric ? 'HIGHER' : 'YES' - })` - : hasNoShares - ? `(${Math.floor(noShares)} ${isPseudoNumeric ? 'LOWER' : 'NO'})` - : ''} -
- )} {user ? ( + + {user && ( +
+ {saleValueOfShares > 0.1 && + hasYesShares && + side === 'YES' && + `${formatMoney(saleValueOfShares)}`} + {saleValueOfShares > 0.1 && + hasNoShares && + side === 'NO' && + `${formatMoney(saleValueOfShares)}`} +
+ )} + + ) }