From e2d174f2621b2623320c51476ee083ee5612af20 Mon Sep 17 00:00:00 2001 From: bonomat Date: Mon, 22 Nov 2021 09:59:44 +1100 Subject: [PATCH] Add warnings if input quantity is not valid --- taker-frontend/src/App.tsx | 9 ----- taker-frontend/src/components/Trade.tsx | 50 ++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/taker-frontend/src/App.tsx b/taker-frontend/src/App.tsx index 3ec3bfb..8c24547 100644 --- a/taker-frontend/src/App.tsx +++ b/taker-frontend/src/App.tsx @@ -130,14 +130,6 @@ export const App = () => { const format = (val: any) => `$` + val; const parse = (val: any) => val.replace(/^\$/, ""); - const balanceTooLow = walletInfo && walletInfo.balance < parse(margin); - const quantityTooHigh = order && order.max_quantity < parse(effectiveQuantity); - const quantityTooLow = order && order.min_quantity > parse(effectiveQuantity); - const quantityGreaterZero = parse(effectiveQuantity) > 0; - - const canSubmit = order != null && !isCreatingNewOrderRequest && walletInfo != null && !balanceTooLow - && !quantityTooHigh && !quantityTooLow && quantityGreaterZero; - return ( <>