From f3092892d8d14fc6aa4317ad4f26a9dbf4742ad5 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Sat, 21 May 2022 19:52:50 -0700 Subject: [PATCH] Show "M$20" on hover, hide arrows when closed --- web/components/contract/contract-card.tsx | 103 +++++++++++++--------- 1 file changed, 62 insertions(+), 41 deletions(-) diff --git a/web/components/contract/contract-card.tsx b/web/components/contract/contract-card.tsx index 42dbfa18..80757c1c 100644 --- a/web/components/contract/contract-card.tsx +++ b/web/components/contract/contract-card.tsx @@ -1,7 +1,11 @@ import clsx from 'clsx' import Link from 'next/link' import { Row } from '../layout/row' -import { formatLargeNumber, formatPercent } from 'common/util/format' +import { + formatLargeNumber, + formatMoney, + formatPercent, +} from 'common/util/format' import { Contract, contractPath, @@ -87,17 +91,18 @@ export function ContractCard(props: { const prob = getProb(contract) const color = getColor(contract) + const marketClosed = (contract.closeTime || Infinity) < Date.now() return (
- - + +

- + {/* Note: Extends bg but not click target on closed markets */} + -

+ {!marketClosed && ( +
+
{ + console.log('success') + }} + >
+
+ {formatMoney(20)} +
+ + {contract.createdTime % 3 == 0 ? ( + + ) : ( + + )} +
+ )} {outcomeType === 'BINARY' && ( )} -
-
{ - // console.log('e2', e) - }} - >
- {contract.createdTime % 3 == 2 ? ( - - ) : ( - - )} -
+ {!marketClosed && ( +
+
{ + }} + >
+ {contract.createdTime % 3 == 2 ? ( + + ) : ( + + )} +
+ {formatMoney(20)} +
+
+ )}