From 4a53000047c08adef169e194ba2ebf4ffe9b6e20 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Thu, 7 Apr 2022 01:19:29 -0500 Subject: [PATCH] Prototyping the one click bet widget (incomplete) --- web/components/contract-overview.tsx | 84 +++++++++++++++++++++++----- 1 file changed, 71 insertions(+), 13 deletions(-) diff --git a/web/components/contract-overview.tsx b/web/components/contract-overview.tsx index a7c9e641..a40e327b 100644 --- a/web/components/contract-overview.tsx +++ b/web/components/contract-overview.tsx @@ -1,4 +1,8 @@ -import { Contract, tradingAllowed } from '../lib/firebase/contracts' +import { + Contract, + getBinaryProbPercent, + tradingAllowed, +} from '../lib/firebase/contracts' import { Col } from './layout/col' import { Spacer } from './layout/spacer' import { ContractProbGraph } from './contract-prob-graph' @@ -35,27 +39,30 @@ export const ContractOverview = (props: { return ( - - -
- -
+ + + +
+ +
- {(isBinary || resolution) && ( + {/* {(isBinary || resolution) && ( - )} -
+ )} */} +
- - + + + +
- {isBinary && allowTrade && ( + {/* {isBinary && allowTrade && ( {(isBinary || resolution) && ( @@ -64,7 +71,7 @@ export const ContractOverview = (props: { )} - )} + )} */} {isBinary ? ( @@ -110,3 +117,54 @@ export const ContractOverview = (props: { ) } + +function Triangle(props: { + direction: 'up' | 'down' + width: number + color: string + className?: string +}) { + const { direction, width, color, className } = props + + return ( +
+ {/* {direction === 'up' && ( +
+ M$ +
+ )} + {direction === 'down' && ( +
+ M$ +
+ )} */} +
+ ) +} + +function QuickBetWidget(props: { contract: Contract }) { + const { contract } = props + return ( + +
+ Click to trade +
+ +
+ {getBinaryProbPercent(contract)} +
+ + + ) +}