From 090214fd4998b7d5b82a3f5911a3f6f86c04a9b8 Mon Sep 17 00:00:00 2001 From: bonomat Date: Mon, 22 Nov 2021 14:49:00 +1100 Subject: [PATCH] Move wallet info out of navbar into main screen resolves #519 resolves #536 --- taker-frontend/src/App.tsx | 114 ++++++++++++----------- taker-frontend/src/components/NavBar.tsx | 3 - taker-frontend/src/components/Wallet.tsx | 20 +++- 3 files changed, 76 insertions(+), 61 deletions(-) diff --git a/taker-frontend/src/App.tsx b/taker-frontend/src/App.tsx index 7857393..c7d3a25 100644 --- a/taker-frontend/src/App.tsx +++ b/taker-frontend/src/App.tsx @@ -5,6 +5,7 @@ import { AccordionItem, AccordionPanel, Box, + Center, StackDivider, useToast, VStack, @@ -33,7 +34,7 @@ import { StateGroupKey, WalletInfo, } from "./components/Types"; -import { Wallet } from "./components/Wallet"; +import { Wallet, WalletInfoBar } from "./components/Wallet"; import useLatestEvent from "./Hooks"; async function getMargin(payload: MarginRequestPayload): Promise { @@ -138,58 +139,65 @@ export const App = () => { } /> } spacing={4}> - { - setUserHasEdited(true); - setQuantity(parse(valueString)); - if (!order) { - return; - } - let quantity = valueString ? Number.parseFloat(valueString) : 0; - let payload: MarginRequestPayload = { - leverage: order.leverage, - price: order.price, - quantity, - }; - calculateMargin(payload); - }} - onLongSubmit={makeNewOrderRequest} - isSubmitting={isCreatingNewOrderRequest} - /> - cfd.state.getGroup() !== StateGroupKey.CLOSED)} - title={"Open Positions"} - /> - - - -

- - - - Show Closed Positions - - - -

- - cfd.state.getGroup() === StateGroupKey.CLOSED)} - /> - -
-
- } + element={<> +
+ +
+ } spacing={4}> + { + setUserHasEdited(true); + setQuantity(parse(valueString)); + if (!order) { + return; + } + let quantity = valueString ? Number.parseFloat(valueString) : 0; + let payload: MarginRequestPayload = { + leverage: order.leverage, + price: order.price, + quantity, + }; + calculateMargin(payload); + }} + onLongSubmit={makeNewOrderRequest} + isSubmitting={isCreatingNewOrderRequest} + /> + cfd.state.getGroup() !== StateGroupKey.CLOSED)} + title={"Open Positions"} + /> + + + +

+ + + + Show Closed Positions + + + +

+ + + cfd.state.getGroup() === StateGroupKey.CLOSED + )} + /> + +
+
+
+ } /> diff --git a/taker-frontend/src/components/NavBar.tsx b/taker-frontend/src/components/NavBar.tsx index 3dc0395..ab793c3 100644 --- a/taker-frontend/src/components/NavBar.tsx +++ b/taker-frontend/src/components/NavBar.tsx @@ -17,7 +17,6 @@ import { useNavigate } from "react-router-dom"; import logoBlack from "../images/logo_nav_bar_black.svg"; import logoWhite from "../images/logo_nav_bar_white.svg"; import { WalletInfo } from "./Types"; -import { WalletNavBar } from "./Wallet"; interface NavProps { walletInfo: WalletInfo | null; @@ -57,8 +56,6 @@ export default function Nav({ walletInfo }: NavProps) { - -