Remove focus
This commit is contained in:
parent
899244bd3f
commit
6c28771539
|
@ -1,6 +1,12 @@
|
|||
import * as _ from 'lodash'
|
||||
import { Bet } from './bet'
|
||||
import { Binary, DPM, FreeResponse, FullContract } from './contract'
|
||||
import {
|
||||
Binary,
|
||||
DPM,
|
||||
FreeResponse,
|
||||
FullContract,
|
||||
NumericContract,
|
||||
} from './contract'
|
||||
import { DPM_FEES } from './fees'
|
||||
|
||||
export function getDpmProbability(totalShares: { [outcome: string]: number }) {
|
||||
|
@ -26,6 +32,17 @@ export function getDpmOutcomeProbabilities(totalShares: {
|
|||
return _.mapValues(totalShares, (shares) => shares ** 2 / squareSum)
|
||||
}
|
||||
|
||||
export function getNumericBets(
|
||||
contract: NumericContract,
|
||||
bucket: string,
|
||||
betAmount: number
|
||||
) {
|
||||
const { totalShares, bucketCount } = contract
|
||||
|
||||
const bucketNum = +bucket
|
||||
// const bucketRange =
|
||||
}
|
||||
|
||||
export function getDpmOutcomeProbabilityAfterBet(
|
||||
totalShares: {
|
||||
[outcome: string]: number
|
||||
|
|
|
@ -9,7 +9,6 @@ import {
|
|||
} from '../../common/calculate'
|
||||
import { NumericContract } from '../../common/contract'
|
||||
import { formatPercent, formatMoney } from '../../common/util/format'
|
||||
import { useFocus } from '../hooks/use-focus'
|
||||
import { useUser } from '../hooks/use-user'
|
||||
import { placeBet } from '../lib/firebase/api-call'
|
||||
import { firebaseLogin, User } from '../lib/firebase/users'
|
||||
|
@ -59,12 +58,6 @@ function NumericBuyPanel(props: {
|
|||
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||
const [wasSubmitted, setWasSubmitted] = useState(false)
|
||||
|
||||
const [inputRef, focusAmountInput] = useFocus()
|
||||
|
||||
useEffect(() => {
|
||||
focusAmountInput()
|
||||
}, [focusAmountInput])
|
||||
|
||||
function onBucketChange(newBucket: string | undefined) {
|
||||
setWasSubmitted(false)
|
||||
setBucketChoice(newBucket)
|
||||
|
@ -139,7 +132,6 @@ function NumericBuyPanel(props: {
|
|||
error={error}
|
||||
setError={setError}
|
||||
disabled={isSubmitting}
|
||||
inputRef={inputRef}
|
||||
/>
|
||||
|
||||
<div className="my-3 text-left text-sm text-gray-500">Amount</div>
|
||||
|
@ -150,7 +142,6 @@ function NumericBuyPanel(props: {
|
|||
error={error}
|
||||
setError={setError}
|
||||
disabled={isSubmitting}
|
||||
inputRef={inputRef}
|
||||
/>
|
||||
|
||||
<Col className="mt-3 w-full gap-3">
|
||||
|
|
Loading…
Reference in New Issue
Block a user