diff --git a/web/components/bet-button.tsx b/web/components/bet-button.tsx index 808b450f..95039412 100644 --- a/web/components/bet-button.tsx +++ b/web/components/bet-button.tsx @@ -79,11 +79,21 @@ export default function BetButton(props: { ) } -export function BinaryMobileBetting(props: { contract: BinaryContract }) { - const { contract } = props +export function BinaryMobileBetting(props: { + contract: BinaryContract + hideSellRow?: boolean +}) { + const { contract, hideSellRow } = props const user = useUser() + if (user) { - return + return ( + + ) } else { return } @@ -92,8 +102,9 @@ export function BinaryMobileBetting(props: { contract: BinaryContract }) { export function SignedInBinaryMobileBetting(props: { contract: BinaryContract user: User + hideSellRow?: boolean }) { - const { contract, user } = props + const { contract, user, hideSellRow } = props const unfilledBets = useUnfilledBets(contract.id) ?? [] return ( @@ -108,13 +119,16 @@ export function SignedInBinaryMobileBetting(props: { mobileView={true} /> - + + {!hideSellRow && ( + + )} ) diff --git a/web/pages/embed/[username]/[contractSlug].tsx b/web/pages/embed/[username]/[contractSlug].tsx index e925a1f6..f32ee325 100644 --- a/web/pages/embed/[username]/[contractSlug].tsx +++ b/web/pages/embed/[username]/[contractSlug].tsx @@ -1,9 +1,6 @@ import { Bet } from 'common/bet' import { Contract } from 'common/contract' import { DOMAIN } from 'common/envs/constants' -import { useState } from 'react' -import { BetInline } from 'web/components/bet-inline' -import { Button } from 'web/components/button' import { BinaryResolutionOrChance, FreeResponseResolutionOrChance, @@ -27,6 +24,7 @@ import { tradingAllowed, } from 'web/lib/firebase/contracts' import Custom404 from '../../404' +import { BinaryMobileBetting } from 'web/components/bet-button' export const getStaticProps = fromPropz(getStaticPropz) export async function getStaticPropz(props: { @@ -81,19 +79,13 @@ export function ContractEmbed(props: { contract: Contract; bets: Bet[] }) { const { setElem, height: graphHeight } = useMeasureSize() - const [betPanelOpen, setBetPanelOpen] = useState(false) - - const [probAfter, setProbAfter] = useState() - return ( - +
{question}
- {isBinary && ( - - )} + {isBinary && } {isPseudoNumeric && ( @@ -107,33 +99,21 @@ export function ContractEmbed(props: { contract: Contract; bets: Bet[] }) { )}
- - - {(isBinary || isPseudoNumeric) && - tradingAllowed(contract) && - !betPanelOpen && ( - - )} - {(isBinary || isPseudoNumeric) && betPanelOpen && ( - setBetPanelOpen(false)} - className="self-center" - /> - )} -
+ + + {isBinary && tradingAllowed(contract) && ( + + )} + ) }