From 4fb2bb305a45de7be12bd84a645981a9f254171f Mon Sep 17 00:00:00 2001 From: Atris Date: Sat, 9 Nov 2024 22:57:36 +0100 Subject: [PATCH] fix: address pr feedback --- src/pages/trade/ui/route-book.tsx | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/pages/trade/ui/route-book.tsx b/src/pages/trade/ui/route-book.tsx index b85cdb7..c856cfc 100644 --- a/src/pages/trade/ui/route-book.tsx +++ b/src/pages/trade/ui/route-book.tsx @@ -10,10 +10,18 @@ import { Tabs } from '@penumbra-zone/ui/Tabs'; const SELL_BG_COLOR = 'rgba(175, 38, 38, 0.24)'; const BUY_BG_COLOR = 'rgba(28, 121, 63, 0.24)'; +const BORDER_LIGHT = 'rgba(250,250,250,0.15)'; +const BG_HOVER = 'rgba(250,250,250,0.05)'; +const BORDER_DARK = '#262626'; +const TEXT_SELL = '#F17878'; +const TEXT_BUY = '#55D383'; +const TEXT_WARNING = '#F49C43'; +const TEXT_GRAY = 'text-gray-400'; +const TEXT_RED = 'text-red-500'; const HopCount = ({ count }: { count: number }) => { return ( - + {count === 2 ? 'Direct' : `${count} Hops`} ); @@ -46,8 +54,8 @@ const TradeRow = ({ return ( setShowRoute(prev => !prev)} style={{ backgroundImage: `linear-gradient(to right, ${bgColor} ${relativeSize}%, transparent ${relativeSize}%)`, @@ -61,7 +69,9 @@ const TradeRow = ({ <> {trace.price} @@ -90,8 +100,8 @@ const RouteBookData = observer(({ bookData: { multiHops } }: { bookData: RouteBo const buyRelativeSizes = calculateRelativeSizes(multiHops.buy); return ( -
-
+
+
{ const { data: bookData, isLoading: bookIsLoading, error: bookErr } = useBook(); if (bookIsLoading || !bookData) { - return
Loading...
; + return
Loading...
; } if (bookErr) { - return
Error loading route book: {String(bookErr)}
; + return
Error loading route book: {String(bookErr)}
; } return ; @@ -193,9 +203,9 @@ const SpreadRow = ({ sellOrders, buyOrders }: { sellOrders: Trace[]; buyOrders: return ( - +
- {spreadInfo.midPrice} + {spreadInfo.midPrice} Spread: {spreadInfo.amount} {pair.quoteSymbol}