Ditch now-unnecessary SellAmountInput
This commit is contained in:
parent
e0bb921240
commit
b8a9bc65c7
|
@ -17,7 +17,6 @@ export function AmountInput(props: {
|
|||
inputClassName?: string
|
||||
// Needed to focus the amount input
|
||||
inputRef?: React.MutableRefObject<any>
|
||||
children?: any
|
||||
}) {
|
||||
const {
|
||||
amount,
|
||||
|
@ -28,7 +27,6 @@ export function AmountInput(props: {
|
|||
className,
|
||||
inputClassName,
|
||||
inputRef,
|
||||
children,
|
||||
} = props
|
||||
|
||||
const onAmountChange = (str: string) => {
|
||||
|
@ -75,8 +73,6 @@ export function AmountInput(props: {
|
|||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{children}
|
||||
</Col>
|
||||
)
|
||||
}
|
||||
|
@ -135,38 +131,3 @@ export function BuyAmountInput(props: {
|
|||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export function SellAmountInput(props: {
|
||||
contract: FullContract<CPMM, Binary>
|
||||
amount: number | undefined
|
||||
onChange: (newAmount: number | undefined) => void
|
||||
error: string | undefined
|
||||
disabled?: boolean
|
||||
className?: string
|
||||
inputClassName?: string
|
||||
// Needed to focus the amount input
|
||||
inputRef?: React.MutableRefObject<any>
|
||||
}) {
|
||||
const {
|
||||
amount,
|
||||
onChange,
|
||||
error,
|
||||
disabled,
|
||||
className,
|
||||
inputClassName,
|
||||
inputRef,
|
||||
} = props
|
||||
|
||||
return (
|
||||
<AmountInput
|
||||
amount={amount}
|
||||
onChange={onChange}
|
||||
label="Qty"
|
||||
error={error}
|
||||
disabled={disabled}
|
||||
className={className}
|
||||
inputClassName={inputClassName}
|
||||
inputRef={inputRef}
|
||||
></AmountInput>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ import { Title } from './title'
|
|||
import { firebaseLogin, User } from 'web/lib/firebase/users'
|
||||
import { Bet } from 'common/bet'
|
||||
import { placeBet, sellShares } from 'web/lib/firebase/api-call'
|
||||
import { BuyAmountInput, SellAmountInput } from './amount-input'
|
||||
import { AmountInput, BuyAmountInput } from './amount-input'
|
||||
import { InfoTooltip } from './info-tooltip'
|
||||
import { BinaryOutcomeLabel } from './outcome-label'
|
||||
import {
|
||||
|
@ -474,9 +474,7 @@ export function SellPanel(props: {
|
|||
|
||||
return (
|
||||
<>
|
||||
<SellAmountInput
|
||||
inputClassName="w-full"
|
||||
contract={contract}
|
||||
<AmountInput
|
||||
amount={
|
||||
amount
|
||||
? Math.round(amount) === 0
|
||||
|
@ -485,8 +483,10 @@ export function SellPanel(props: {
|
|||
: undefined
|
||||
}
|
||||
onChange={onAmountChange}
|
||||
label="Qty"
|
||||
error={error}
|
||||
disabled={isSubmitting}
|
||||
inputClassName="w-full"
|
||||
/>
|
||||
|
||||
<Col className="gap-3 text-sm">
|
||||
|
|
Loading…
Reference in New Issue
Block a user