From 121dda58b89d1043268c2e62ea45822ee3a74fde Mon Sep 17 00:00:00 2001 From: Mariusz Klochowicz Date: Fri, 12 Nov 2021 13:00:34 +1030 Subject: [PATCH] Disable taker's "go long" button under the same conditions as older UI Disable the button when there's no order or there's an in-flight order request already. --- taker-frontend/src/App.tsx | 1 + taker-frontend/src/components/Trade.tsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/taker-frontend/src/App.tsx b/taker-frontend/src/App.tsx index 72789a3..466864c 100644 --- a/taker-frontend/src/App.tsx +++ b/taker-frontend/src/App.tsx @@ -167,6 +167,7 @@ export const App = () => { }; calculateMargin(payload); }} + canSubmit={order != null && !isCreatingNewOrderRequest} onLongSubmit={makeNewOrderRequest} isSubmitting={isCreatingNewOrderRequest} /> diff --git a/taker-frontend/src/components/Trade.tsx b/taker-frontend/src/components/Trade.tsx index 9293d56..fe87939 100644 --- a/taker-frontend/src/components/Trade.tsx +++ b/taker-frontend/src/components/Trade.tsx @@ -55,6 +55,7 @@ interface TradeProps { leverage?: number; quantity: string; liquidationPrice?: number; + canSubmit: boolean; isSubmitting: boolean; onQuantityChange: any; onLongSubmit: (payload: CfdOrderRequestPayload) => void; @@ -71,6 +72,7 @@ const Trade = ( margin: marginAsNumber, leverage, liquidationPrice: liquidationPriceAsNumber, + canSubmit, onLongSubmit, order_id, }: TradeProps, @@ -148,14 +150,18 @@ const Trade = (
- + -