linting
This commit is contained in:
parent
ff6ce54b4b
commit
4bf7af07e1
|
@ -2,11 +2,7 @@ import { useState } from 'react'
|
|||
import clsx from 'clsx'
|
||||
|
||||
import { BuyPanel, SimpleBetPanel } from './bet-panel'
|
||||
import {
|
||||
BinaryContract,
|
||||
CPMMBinaryContract,
|
||||
PseudoNumericContract,
|
||||
} from 'common/contract'
|
||||
import { CPMMBinaryContract, PseudoNumericContract } from 'common/contract'
|
||||
import { Modal } from './layout/modal'
|
||||
import { useUser } from 'web/hooks/use-user'
|
||||
import { useUserContractBets } from 'web/hooks/use-user-bets'
|
||||
|
@ -15,7 +11,6 @@ import { Col } from './layout/col'
|
|||
import { Button } from 'web/components/button'
|
||||
import { BetSignUpPrompt } from './sign-up-prompt'
|
||||
import { PRESENT_BET } from 'common/user'
|
||||
import { Contract } from 'web/lib/firebase/contracts'
|
||||
import { User } from 'web/lib/firebase/users'
|
||||
import { SellRow } from './sell-row'
|
||||
import { useUnfilledBets } from 'web/hooks/use-bets'
|
||||
|
|
|
@ -3,11 +3,7 @@ import React, { useState } from 'react'
|
|||
import { clamp, partition, sumBy } from 'lodash'
|
||||
|
||||
import { useUser } from 'web/hooks/use-user'
|
||||
import {
|
||||
Contract,
|
||||
CPMMBinaryContract,
|
||||
PseudoNumericContract,
|
||||
} from 'common/contract'
|
||||
import { CPMMBinaryContract, PseudoNumericContract } from 'common/contract'
|
||||
import { Col } from './layout/col'
|
||||
import { Row } from './layout/row'
|
||||
import { Spacer } from './layout/spacer'
|
||||
|
@ -114,11 +110,10 @@ export function BetPanel(props: {
|
|||
export function SimpleBetPanel(props: {
|
||||
contract: CPMMBinaryContract | PseudoNumericContract
|
||||
className?: string
|
||||
selected?: 'YES' | 'NO'
|
||||
hasShares?: boolean
|
||||
onBetSuccess?: () => void
|
||||
}) {
|
||||
const { contract, className, selected, hasShares, onBetSuccess } = props
|
||||
const { contract, className, hasShares, onBetSuccess } = props
|
||||
|
||||
const user = useUser()
|
||||
const [isLimitOrder, setIsLimitOrder] = useState(false)
|
||||
|
@ -196,13 +191,11 @@ export function BuyPanel(props: {
|
|||
const [betAmount, setBetAmount] = useState<number | undefined>(10)
|
||||
const [error, setError] = useState<string | undefined>()
|
||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||
const [wasSubmitted, setWasSubmitted] = useState(false)
|
||||
|
||||
const [inputRef, focusAmountInput] = useFocus()
|
||||
|
||||
function onBetChoice(choice: 'YES' | 'NO') {
|
||||
setOutcome(choice)
|
||||
setWasSubmitted(false)
|
||||
|
||||
if (!isIOS() && !isAndroid()) {
|
||||
focusAmountInput()
|
||||
|
@ -215,15 +208,12 @@ export function BuyPanel(props: {
|
|||
} else {
|
||||
setOutcome(choice)
|
||||
}
|
||||
setWasSubmitted(false)
|
||||
|
||||
if (!isIOS() && !isAndroid()) {
|
||||
focusAmountInput()
|
||||
}
|
||||
}
|
||||
|
||||
function onBetChange(newAmount: number | undefined) {
|
||||
setWasSubmitted(false)
|
||||
setBetAmount(newAmount)
|
||||
if (!outcome) {
|
||||
setOutcome('YES')
|
||||
|
@ -244,7 +234,6 @@ export function BuyPanel(props: {
|
|||
.then((r) => {
|
||||
console.log('placed bet. Result:', r)
|
||||
setIsSubmitting(false)
|
||||
setWasSubmitted(true)
|
||||
setBetAmount(undefined)
|
||||
if (onBuySuccess) onBuySuccess()
|
||||
else {
|
||||
|
@ -439,8 +428,6 @@ export function BuyPanel(props: {
|
|||
)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* {wasSubmitted && <div className="mt-4">Trade submitted!</div>} */}
|
||||
<button
|
||||
className="text-greyscale-6 mx-auto select-none text-sm underline xl:hidden"
|
||||
onClick={() => setSeeLimit(true)}
|
||||
|
|
|
@ -17,7 +17,6 @@ import BetButton, { BinaryMobileBetting } from '../bet-button'
|
|||
import { AnswersGraph } from '../answers/answers-graph'
|
||||
import {
|
||||
Contract,
|
||||
BinaryContract,
|
||||
CPMMContract,
|
||||
FreeResponseContract,
|
||||
MultipleChoiceContract,
|
||||
|
|
Loading…
Reference in New Issue
Block a user