diff --git a/frontend/src/Maker.tsx b/frontend/src/Maker.tsx index 61e3465..788297b 100644 --- a/frontend/src/Maker.tsx +++ b/frontend/src/Maker.tsx @@ -1,25 +1,11 @@ -import { - Box, - Button, - Center, - Divider, - Flex, - HStack, - SimpleGrid, - StackDivider, - Text, - useToast, - VStack, -} from "@chakra-ui/react"; +import { Button, Container, Flex, Grid, GridItem, HStack, Stack, Text, useToast, VStack } from "@chakra-ui/react"; import React, { useState } from "react"; import { useAsync } from "react-async"; -import { Route, Routes } from "react-router-dom"; import { useEventSource } from "react-sse-hooks"; import "./App.css"; import CfdTile from "./components/CfdTile"; import CurrencyInputField from "./components/CurrencyInputField"; import useLatestEvent from "./components/Hooks"; -import NavLink from "./components/NavLink"; import OrderTile from "./components/OrderTile"; import { Cfd, Order, WalletInfo } from "./components/Types"; import Wallet from "./components/Wallet"; @@ -62,128 +48,74 @@ export default function App() { }); return ( -
- - - - - - + + + + + {cfds && cfds.map((cfd, index) => + + )} + + + + + + + Current Price: + {49000} + + + Min Quantity: + setMinQuantity(parse(valueString))} + value={format(minQuantity)} + /> + + + Min Quantity: + setMaxQuantity(parse(valueString))} + value={format(maxQuantity)} + /> + + + Order Price: + + setOrderPrice(parse(valueString))} + value={format(orderPrice)} + /> + Leverage: + + + + + + + + {order && } + - - - - - - } - > - - - {cfds && cfds.map((cfd, index) => - - )} - - - - - - - - - Current Price: - {49000} - - - Min Quantity: - setMinQuantity(parse(valueString))} - value={format(minQuantity)} - /> - - - Min Quantity: - setMaxQuantity(parse(valueString))} - value={format(maxQuantity)} - /> - - - Order Price: - - setOrderPrice(parse(valueString))} - value={format(orderPrice)} - /> - Leverage: - - - - - - -
Maker UI
- - - - - {order - && } - - -
-
-
- } - > -
- - - Wallet - -
} - > - - - - Settings - - } - > - - - - - + + + ); } diff --git a/frontend/src/Taker.tsx b/frontend/src/Taker.tsx index 5070839..b42d920 100644 --- a/frontend/src/Taker.tsx +++ b/frontend/src/Taker.tsx @@ -1,13 +1,11 @@ -import { Box, Button, Center, Flex, HStack, SimpleGrid, StackDivider, Text, useToast, VStack } from "@chakra-ui/react"; +import { Button, Container, Flex, Grid, GridItem, HStack, Stack, Text, useToast, VStack } from "@chakra-ui/react"; import React, { useState } from "react"; import { useAsync } from "react-async"; -import { Route, Routes } from "react-router-dom"; import { useEventSource } from "react-sse-hooks"; import "./App.css"; import CfdTile from "./components/CfdTile"; import CurrencyInputField from "./components/CurrencyInputField"; import useLatestEvent from "./components/Hooks"; -import NavLink from "./components/NavLink"; import { Cfd, Order, WalletInfo } from "./components/Types"; import Wallet from "./components/Wallet"; @@ -96,119 +94,80 @@ export default function App() { }); return ( -
- - - - - - + + + + + {cfds && cfds.map((cfd, index) => + + )} + + + + + + + {/*TODO: Do we need this? does it make sense to only display the price from the order?*/} + Current Price (Kraken): + tbd + + + Order Price: + {order?.price} + + + Quantity: + { + 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); + }} + value={format(quantity)} + /> + + + Margin in BTC: + {margin} + + Leverage: + {/* TODO: consider button group */} + + + + + + {} - - - - - - - } - > - - - {cfds && cfds.map((cfd, index) => - - )} - - - - - - - - - {/*TODO: Do we need this? does it make sense to only display the price from the order?*/} - Current Price (Kraken): - tbd - - - Order Price: - {order?.price} - - - Quantity: - { - 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); - }} - value={format(quantity)} - /> - - - Margin in BTC: - {margin} - - Leverage: - {/* TODO: consider button group */} - - - - - - {} - - - - - -
- - Wallet - -
-
- -
- - Settings - -
-
-
-
-
-
+ + + ); }