From 9cc3d1395b297d5c707539272180aee289110d11 Mon Sep 17 00:00:00 2001 From: Philipp Hoenisch Date: Thu, 14 Oct 2021 16:15:50 +1100 Subject: [PATCH] Add soft boundaries to taker ui --- frontend/src/TakerApp.tsx | 2 ++ frontend/src/components/CurrencyInputField.tsx | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/frontend/src/TakerApp.tsx b/frontend/src/TakerApp.tsx index e5ae509..9223f29 100644 --- a/frontend/src/TakerApp.tsx +++ b/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} /> Margin in BTC: diff --git a/frontend/src/components/CurrencyInputField.tsx b/frontend/src/components/CurrencyInputField.tsx index 47df0a3..4b12313 100644 --- a/frontend/src/components/CurrencyInputField.tsx +++ b/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 (