From cd3335e20f8ef9451e9ae93b71d78f86803fc18c Mon Sep 17 00:00:00 2001 From: Mariusz Klochowicz Date: Tue, 23 Nov 2021 17:56:10 +1030 Subject: [PATCH] Display maker status in the NavBar and an alert if maker is offline Warn the users that some functionality might be unavailable if there is no maker online. Co-authored-by: rishflab --- taker-frontend/src/App.tsx | 5 ++- taker-frontend/src/components/NavBar.tsx | 6 ++-- taker-frontend/src/components/Trade.tsx | 39 ++++++++++++++++-------- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/taker-frontend/src/App.tsx b/taker-frontend/src/App.tsx index f295a66..bb52453 100644 --- a/taker-frontend/src/App.tsx +++ b/taker-frontend/src/App.tsx @@ -93,6 +93,8 @@ export const App = () => { const cfdsOrUndefined = useLatestEvent(source, "cfds", intoCfd); let cfds = cfdsOrUndefined ? cfdsOrUndefined! : []; cfds.sort((a, b) => a.order_id.localeCompare(b.order_id)); + const connectedToMakerOrUndefined = useLatestEvent(source, "maker_status"); + const connectedToMaker = connectedToMakerOrUndefined ? connectedToMakerOrUndefined! : false; let [quantity, setQuantity] = useState("0"); let [margin, setMargin] = useState("0"); @@ -145,7 +147,7 @@ export const App = () => { return ( <> -