Don't show amount error in probability input
This commit is contained in:
parent
1ac401f082
commit
4596a1ef26
|
@ -416,8 +416,6 @@ function BuyPanel(props: {
|
||||||
inputClassName="w-full max-w-none"
|
inputClassName="w-full max-w-none"
|
||||||
prob={limitProb}
|
prob={limitProb}
|
||||||
onChange={setLimitProb}
|
onChange={setLimitProb}
|
||||||
error={error}
|
|
||||||
setError={setError}
|
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -5,13 +5,11 @@ import { Spacer } from './layout/spacer'
|
||||||
export function ProbabilityInput(props: {
|
export function ProbabilityInput(props: {
|
||||||
prob: number | undefined
|
prob: number | undefined
|
||||||
onChange: (newProb: number | undefined) => void
|
onChange: (newProb: number | undefined) => void
|
||||||
error: string | undefined
|
|
||||||
setError: (error: string | undefined) => void
|
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
className?: string
|
className?: string
|
||||||
inputClassName?: string
|
inputClassName?: string
|
||||||
}) {
|
}) {
|
||||||
const { prob, onChange, error, disabled, className, inputClassName } = props
|
const { prob, onChange, disabled, className, inputClassName } = props
|
||||||
|
|
||||||
const onProbChange = (str: string) => {
|
const onProbChange = (str: string) => {
|
||||||
let prob = parseInt(str.replace(/\D/g, ''))
|
let prob = parseInt(str.replace(/\D/g, ''))
|
||||||
|
@ -30,7 +28,6 @@ export function ProbabilityInput(props: {
|
||||||
<input
|
<input
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'input input-bordered max-w-[200px] text-lg',
|
'input input-bordered max-w-[200px] text-lg',
|
||||||
error && 'input-error',
|
|
||||||
inputClassName
|
inputClassName
|
||||||
)}
|
)}
|
||||||
type="number"
|
type="number"
|
||||||
|
@ -46,14 +43,7 @@ export function ProbabilityInput(props: {
|
||||||
/>
|
/>
|
||||||
<span className="bg-gray-200 text-sm">%</span>
|
<span className="bg-gray-200 text-sm">%</span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<Spacer h={4} />
|
<Spacer h={4} />
|
||||||
|
|
||||||
{error && (
|
|
||||||
<div className="mb-2 mr-auto self-center whitespace-nowrap text-xs font-medium tracking-wide text-red-500">
|
|
||||||
{error}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</Col>
|
</Col>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user