diff --git a/components/trade/OpenOrders.tsx b/components/trade/OpenOrders.tsx index 176e3302..31e51a80 100644 --- a/components/trade/OpenOrders.tsx +++ b/components/trade/OpenOrders.tsx @@ -65,40 +65,44 @@ const OpenOrders = () => { return connected ? ( Object.values(openOrders).flat().length ? ( - - - - - - - - - - - - - {Object.entries(openOrders) - .map(([marketPk, orders]) => { - return orders.map((o) => { - const group = mangoStore.getState().group - const serumMarket = group?.getSerum3MarketByPk( - new PublicKey(marketPk) - ) - const quoteTokenBank = group?.getFirstBankByTokenIndex( - serumMarket!.quoteTokenIndex - ) - return ( - - - -
{t('market')}{t('trade:side')}{t('trade:size')}{t('price')}{t('value')}
-
- - {serumMarket?.name} -
-
- - + showTableView ? ( + + + + + + + + + + + + + {Object.entries(openOrders) + .map(([marketPk, orders]) => { + return orders.map((o) => { + const group = mangoStore.getState().group + const serumMarket = group?.getSerum3MarketByPk( + new PublicKey(marketPk) + ) + const quoteSymbol = group?.getFirstBankByTokenIndex( + serumMarket!.quoteTokenIndex + ).name + return ( + + + + - - - - ) + + + + ) + }) }) .flat()} @@ -144,35 +149,23 @@ const OpenOrders = () => { {Object.entries(openOrders).map(([marketPk, orders]) => { return orders.map((o) => { const group = mangoStore.getState().group - const market = group?.getSerum3MarketByPk(new PublicKey(marketPk)) - let baseLogoURI = '' - let quoteLogoURI = '' - const baseSymbol = group?.getFirstBankByTokenIndex( - market!.baseTokenIndex - ).name + const serumMarket = group?.getSerum3MarketByPk( + new PublicKey(marketPk) + ) const quoteSymbol = group?.getFirstBankByTokenIndex( - market!.quoteTokenIndex + serumMarket!.quoteTokenIndex ).name - if (jupiterTokens.length) { - baseLogoURI = jupiterTokens.find( - (t) => t.symbol === baseSymbol - )!.logoURI - quoteLogoURI = jupiterTokens.find( - (t) => t.symbol === quoteSymbol - )!.logoURI - } return (
- +
-

{market?.name}

+

+ {serumMarket?.name} +

{t('market')}{t('trade:side')}{t('trade:size')}{t('price')}{t('value')}
+
+ + {serumMarket?.name} +
+
+ + {o.size.toLocaleString(undefined, { maximumFractionDigits: getDecimalCount(o.size), })} @@ -113,28 +117,29 @@ const OpenOrders = () => { - {formatFixedDecimals(o.size * o.price, true)} - -
- - handleCancelOrder(o)} - size="small" - > - {cancelId === o.orderId.toString() ? ( - - ) : ( - - )} - - -
-
+ {formatFixedDecimals(o.size * o.price, true)} + +
+ + handleCancelOrder(o)} + size="small" + > + {cancelId === o.orderId.toString() ? ( + + ) : ( + + )} + + +
+