From 38a59245ff1bfe3661d0a4c713de500d497b6a7e Mon Sep 17 00:00:00 2001 From: Sinclair Chen Date: Wed, 17 Aug 2022 14:03:08 -0700 Subject: [PATCH] Move bet row above graph, in "mini modal" --- web/components/bet-inline.tsx | 7 +---- web/components/yes-no-selector.tsx | 4 +-- web/pages/embed/[username]/[contractSlug].tsx | 28 +++++++++++-------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/web/components/bet-inline.tsx b/web/components/bet-inline.tsx index a9752c64..7b12a297 100644 --- a/web/components/bet-inline.tsx +++ b/web/components/bet-inline.tsx @@ -44,12 +44,7 @@ export function BetInline(props: { const betDisabled = submitBet.isLoading || submitBet.isError || !amount return ( - +
Bet
onSelect('YES')} @@ -55,7 +55,7 @@ export function YesNoSelector(props: { 'border-red-400 hover:border-red-500 hover:bg-red-500 hover:text-white', selected == 'NO' ? 'bg-red-400 text-white' - : 'bg-transparent text-red-400', + : 'bg-white text-red-400', btnClassName )} onClick={() => onSelect('NO')} diff --git a/web/pages/embed/[username]/[contractSlug].tsx b/web/pages/embed/[username]/[contractSlug].tsx index 9b4a2b59..ca588b4a 100644 --- a/web/pages/embed/[username]/[contractSlug].tsx +++ b/web/pages/embed/[username]/[contractSlug].tsx @@ -1,3 +1,4 @@ +import { XIcon } from '@heroicons/react/solid' import { Bet } from 'common/bet' import { Contract, CPMMBinaryContract } from 'common/contract' import { DOMAIN } from 'common/envs/constants' @@ -110,14 +111,13 @@ export function ContractEmbed(props: { contract: Contract; bets: Bet[] }) { disabled /> - {(isBinary || isPseudoNumeric) && tradingAllowed(contract) && ( - - )} + {(isBinary || isPseudoNumeric) && + tradingAllowed(contract) && + !betPanelOpen && ( + + )} {isBinary && } @@ -140,6 +140,15 @@ export function ContractEmbed(props: { contract: Contract; bets: Bet[] }) { + {(isBinary || isPseudoNumeric) && betPanelOpen && ( + + + + + )} +
{(isBinary || isPseudoNumeric) && ( )}
- {(isBinary || isPseudoNumeric) && betPanelOpen && ( - - )} ) }