Browse Source
Add soft boundaries to taker ui
refactor/no-log-handler
Philipp Hoenisch
3 years ago
No known key found for this signature in database
GPG Key ID: E5F8E74C672BC666
2 changed files with
11 additions and
0 deletions
-
frontend/src/TakerApp.tsx
-
frontend/src/components/CurrencyInputField.tsx
|
|
@ -148,6 +148,8 @@ export default function App() { |
|
|
|
calculateMargin(payload); |
|
|
|
}} |
|
|
|
value={format(quantity)} |
|
|
|
min={order?.min_quantity} |
|
|
|
max={order?.max_quantity} |
|
|
|
/> |
|
|
|
|
|
|
|
<Text>Margin in BTC:</Text> |
|
|
|
|
|
@ -11,18 +11,27 @@ import React from "react"; |
|
|
|
interface CurrencyInputFieldProps { |
|
|
|
onChange: any; |
|
|
|
value: StringOrNumber | undefined; |
|
|
|
min?: number; |
|
|
|
max?: number; |
|
|
|
} |
|
|
|
|
|
|
|
export default function CurrencyInputField( |
|
|
|
{ |
|
|
|
onChange, |
|
|
|
value, |
|
|
|
min, |
|
|
|
max, |
|
|
|
}: CurrencyInputFieldProps, |
|
|
|
) { |
|
|
|
let minAmount = min || 0; |
|
|
|
let maxAmount = max || Number.MAX_SAFE_INTEGER; |
|
|
|
return ( |
|
|
|
<NumberInput |
|
|
|
onChange={onChange} |
|
|
|
value={value} |
|
|
|
defaultValue={minAmount} |
|
|
|
min={minAmount} |
|
|
|
max={maxAmount} |
|
|
|
> |
|
|
|
<NumberInputField /> |
|
|
|
<NumberInputStepper> |
|
|
|