This commit is contained in:
ingawei 2022-09-20 22:51:58 -07:00
parent c0124a558f
commit aed48dfb22
2 changed files with 5 additions and 16 deletions

View File

@ -80,9 +80,8 @@ export default function BetButton(props: {
export function BinaryMobileBetting(props: { export function BinaryMobileBetting(props: {
contract: CPMMBinaryContract | Contract contract: CPMMBinaryContract | Contract
className?: string
}) { }) {
const { contract, className } = props const { contract } = props
const user = useUser() const user = useUser()
if (user) { if (user) {
return ( return (
@ -104,7 +103,7 @@ export function SignedInBinaryMobileBetting(props: {
user: User user: User
}) { }) {
const { contract, user } = props const { contract, user } = props
const [betChoice, setBetChoice] = useState<'YES' | 'NO' | undefined>( const [betChoice, _setBetChoice] = useState<'YES' | 'NO' | undefined>(
undefined undefined
) )
const unfilledBets = useUnfilledBets(contract.id) ?? [] const unfilledBets = useUnfilledBets(contract.id) ?? []

View File

@ -1,6 +1,6 @@
import clsx from 'clsx' import clsx from 'clsx'
import React, { useState } from 'react' import React, { useState } from 'react'
import { clamp, floor, partition, sumBy } from 'lodash' import { clamp, partition, sumBy } from 'lodash'
import { useUser } from 'web/hooks/use-user' import { useUser } from 'web/hooks/use-user'
import { CPMMBinaryContract, PseudoNumericContract } from 'common/contract' import { CPMMBinaryContract, PseudoNumericContract } from 'common/contract'
@ -174,21 +174,11 @@ export function BuyPanel(props: {
user: User | null | undefined user: User | null | undefined
unfilledBets: Bet[] unfilledBets: Bet[]
hidden: boolean hidden: boolean
selected?: 'YES' | 'NO'
onBuySuccess?: () => void onBuySuccess?: () => void
onAdvanced?: () => void
mobileView?: boolean mobileView?: boolean
}) { }) {
const { const { contract, user, unfilledBets, hidden, onBuySuccess, mobileView } =
contract, props
user,
unfilledBets,
hidden,
selected,
onBuySuccess,
onAdvanced,
mobileView,
} = props
const initialProb = getProbability(contract) const initialProb = getProbability(contract)
const isPseudoNumeric = contract.outcomeType === 'PSEUDO_NUMERIC' const isPseudoNumeric = contract.outcomeType === 'PSEUDO_NUMERIC'