diff --git a/frontend/src/MakerApp.tsx b/frontend/src/MakerApp.tsx index 37eb215..cc83b94 100644 --- a/frontend/src/MakerApp.tsx +++ b/frontend/src/MakerApp.tsx @@ -1,9 +1,8 @@ import { + Box, Button, Container, - Flex, - Grid, - GridItem, + Divider, HStack, Tab, TabList, @@ -74,67 +73,70 @@ export default function App() { !runningStates.includes(value.state) && !closedStates.includes(value.state) && !openStates.includes(value.state) ); + const labelWidth = 110; + return ( - - + + - + - Current Price: + Current Price: {49000} - Min Quantity: + Min Quantity: setMinQuantity(parse(valueString))} value={format(minQuantity)} /> - Min Quantity: + Min Quantity: setMaxQuantity(parse(valueString))} value={format(maxQuantity)} /> - Order Price: + Order Price: + setOrderPrice(parse(valueString))} + value={format(orderPrice)} + /> + + + Leverage: + + + + + - setOrderPrice(parse(valueString))} - value={format(orderPrice)} - /> - Leverage: - - - - - - - - + + - - - {order && } - - - + + {order && } + + + + Running [{running.length}] Open [{open.length}] diff --git a/frontend/src/TakerApp.tsx b/frontend/src/TakerApp.tsx index 6f2f33a..2dd2580 100644 --- a/frontend/src/TakerApp.tsx +++ b/frontend/src/TakerApp.tsx @@ -1,9 +1,8 @@ import { + Box, Button, Container, - Flex, - Grid, - GridItem, + Divider, HStack, Tab, TabList, @@ -117,89 +116,87 @@ export default function App() { !runningStates.includes(value.state) && !closedStates.includes(value.state) ); + const labelWidth = 120; + return ( - - - - - - - {/*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 */} - + + + + + + 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: + - - {} - - - - - - Running [{running.length}] - Closed [{closed.length}] - Unsorted [{unsorted.length}] (should be empty) - - - - - - - - - - - - - - - + + + + + + + + + + + Running [{running.length}] + Closed [{closed.length}] + Unsorted [{unsorted.length}] (should be empty) + + + + + + + + + + + + + + ); } diff --git a/frontend/src/components/OrderTile.tsx b/frontend/src/components/OrderTile.tsx index 490f475..1490de7 100644 --- a/frontend/src/components/OrderTile.tsx +++ b/frontend/src/components/OrderTile.tsx @@ -1,4 +1,4 @@ -import { Box, SimpleGrid, Text, VStack } from "@chakra-ui/react"; +import { Box, HStack, Text, VStack } from "@chakra-ui/react"; import React from "react"; import { Order } from "./Types"; @@ -11,42 +11,58 @@ function OrderTile( order, }: OrderProps, ) { + const labelWidth = 140; + return ( Current CFD Sell Order - - ID - - {order.id} - - Trading Pair - {order.trading_pair} - Price - {order.price} - Min Quantity - {order.min_quantity} - Max Quantity - {order.max_quantity} - Leverage - {order.leverage} - Liquidation Price - - {order.liquidation_price} - - + + + ID + + {order.id} + + + + Trading Pair + {order.trading_pair} + + + Price + {order.price} + + + Min Quantity + {order.min_quantity} + + + Max Quantity + {order.max_quantity} + + + Leverage + {order.leverage} + + + Liquidation Price + + {order.liquidation_price} + + + );