Browse Source

Add soft boundaries to taker ui

refactor/no-log-handler
Philipp Hoenisch 3 years ago
parent
commit
9cc3d1395b
No known key found for this signature in database GPG Key ID: E5F8E74C672BC666
  1. 2
      frontend/src/TakerApp.tsx
  2. 9
      frontend/src/components/CurrencyInputField.tsx

2
frontend/src/TakerApp.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>

9
frontend/src/components/CurrencyInputField.tsx

@ -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>

Loading…
Cancel
Save