diff --git a/components/swap/SwapHistoryTable.tsx b/components/swap/SwapHistoryTable.tsx index 8e8357cd..b7854530 100644 --- a/components/swap/SwapHistoryTable.tsx +++ b/components/swap/SwapHistoryTable.tsx @@ -78,7 +78,8 @@ const SwapHistoryTable = () => { {t('date')} - {t('swap')} + {t('swap:paid')} + {t('swap:received')} {t('value')} {t('borrow')} {t('borrow-fee')} @@ -119,14 +120,14 @@ const SwapHistoryTable = () => { if (mangoTokens.length) { baseLogoURI = mangoTokens.find( - (t) => t.symbol === inSymbol + (t) => t.symbol.toUpperCase() === inSymbol.toUpperCase() )?.logoURI quoteLogoURI = mangoTokens.find( - (t) => t.symbol === outSymbol + (t) => t.symbol.toUpperCase() === outSymbol.toUpperCase() )?.logoURI } - const inDecimals = countLeadingZeros(swap_in_amount) + const inDecimals = countLeadingZeros(swap_in_amount) + 2 const outDecimals = countLeadingZeros(swap_out_amount) + 2 return ( @@ -138,54 +139,53 @@ const SwapHistoryTable = () => { {dayjs(block_datetime).format('h:mma')}

- -
-
-
- -
-
-

- {`${formatDecimal(swap_in_amount, inDecimals)}`} - - {inSymbol} - -

-

- - {t('price')}: - {' '} - {formatFixedDecimals(swap_in_price_usd, true)} -

-
+ +
+
+
- -
-
- -
-
-

- {`${formatDecimal(swap_out_amount, outDecimals)}`} - - {outSymbol} - -

-

- {t('price')}:{' '} - {formatFixedDecimals(swap_out_price_usd, true)} -

-
+
+

+ {`${formatDecimal(swap_in_amount, inDecimals)}`} + + {inSymbol} + +

+

+ + {t('price')}: + {' '} + {formatFixedDecimals(swap_in_price_usd, true)} +

+
+
+ + +
+
+ +
+
+

+ {`${formatDecimal(swap_out_amount, outDecimals)}`} + + {outSymbol} + +

+

+ {t('price')}:{' '} + {formatFixedDecimals(swap_out_price_usd, true)} +

@@ -284,13 +284,16 @@ const SwapHistoryTable = () => { if (mangoTokens.length) { baseLogoURI = mangoTokens.find( - (t) => t.symbol === inSymbol + (t) => t.symbol.toUpperCase() === inSymbol.toUpperCase() )?.logoURI quoteLogoURI = mangoTokens.find( - (t) => t.symbol === outSymbol + (t) => t.symbol.toUpperCase() === outSymbol.toUpperCase() )?.logoURI } + const inDecimals = countLeadingZeros(swap_in_amount) + 2 + const outDecimals = countLeadingZeros(swap_out_amount) + 2 + return (
@@ -306,7 +309,7 @@ const SwapHistoryTable = () => {

- {swap_in_amount.toFixed(2)}{' '} + {formatDecimal(swap_in_amount, inDecimals)}{' '} {inSymbol} @@ -331,7 +334,7 @@ const SwapHistoryTable = () => {

- {swap_out_amount.toFixed(2)}{' '} + {formatDecimal(swap_out_amount, outDecimals)}{' '} {outSymbol} @@ -345,7 +348,10 @@ const SwapHistoryTable = () => {

- handleShowSwapDetails(signature)}> + handleShowSwapDetails(signature)} + size="medium" + > t.symbol === market.name.split('-')[0]) || - mangoTokens.find((t) => t.symbol.includes(market.name.split('-')[0])) + mangoTokens.find( + (t) => t.symbol.toUpperCase() === market.name.split('-')[0] + ) || + mangoTokens.find((t) => + t.symbol.toUpperCase()?.includes(market.name.split('-')[0]) + ) } const baseLogoURI = jupiterBaseToken ? jupiterBaseToken.logoURI : '' const quoteLogoURI = jupiterQuoteToken ? jupiterQuoteToken.logoURI : '' diff --git a/hooks/useSelectedMarket.ts b/hooks/useSelectedMarket.ts index 775c9755..8cd268f8 100644 --- a/hooks/useSelectedMarket.ts +++ b/hooks/useSelectedMarket.ts @@ -40,8 +40,8 @@ export default function useSelectedMarket() { const baseLogoURI = useMemo(() => { if (!baseSymbol || !mangoTokens.length) return '' const token = - mangoTokens.find((t) => t.symbol === baseSymbol) || - mangoTokens.find((t) => t.symbol?.includes(baseSymbol)) + mangoTokens.find((t) => t.symbol.toUpperCase() === baseSymbol) || + mangoTokens.find((t) => t.symbol.toUpperCase()?.includes(baseSymbol)) if (token) { return token.logoURI } @@ -64,7 +64,9 @@ export default function useSelectedMarket() { const quoteLogoURI = useMemo(() => { if (!quoteSymbol || !mangoTokens.length) return '' - const token = mangoTokens.find((t) => t.symbol === quoteSymbol) + const token = mangoTokens.find( + (t) => t.symbol.toUpperCase() === quoteSymbol + ) if (token) { return token.logoURI } diff --git a/public/locales/en/swap.json b/public/locales/en/swap.json index 98531531..cc9c0b5f 100644 --- a/public/locales/en/swap.json +++ b/public/locales/en/swap.json @@ -11,11 +11,13 @@ "maximum-cost": "Maximum Cost", "minimum-received": "Minimum Received", "no-history": "No swap history", + "paid": "Paid", "pay": "You Pay", "preset": "Preset", "price-impact": "Price Impact", "rate": "Rate", "receive": "You Receive", + "received": "Received", "review-swap": "Review Swap", "show-fees": "Show Fees", "slippage": "Slippage", diff --git a/public/locales/es/swap.json b/public/locales/es/swap.json index 2649da20..cc9c0b5f 100644 --- a/public/locales/es/swap.json +++ b/public/locales/es/swap.json @@ -11,18 +11,20 @@ "maximum-cost": "Maximum Cost", "minimum-received": "Minimum Received", "no-history": "No swap history", + "paid": "Paid", "pay": "You Pay", "preset": "Preset", "price-impact": "Price Impact", "rate": "Rate", "receive": "You Receive", + "received": "Received", "review-swap": "Review Swap", "show-fees": "Show Fees", "slippage": "Slippage", "swap-history": "Swap History", "swap-route": "Swap Route", - "tooltip-borrow-balance": "You'll use your {{balance}} {{token}} balance and borrow {{borrowAmount}} {{token}} to execute this swap", - "tooltip-borrow-no-balance": "You'll borrow {{borrowAmount}} {{token}} to execute this swap", + "tooltip-borrow-balance": "You'll use your {{balance}} {{token}} balance and borrow {{borrowAmount}} {{token}} to execute this swap. The current {{token}} variable borrow rate is {{rate}}%", + "tooltip-borrow-no-balance": "You'll borrow {{borrowAmount}} {{token}} to execute this swap. The current {{token}} variable borrow rate is {{rate}}%", "tooltip-max-slippage": "If price slips beyond your maximum slippage your swap will not be executed", "use-margin": "Allow Margin" } \ No newline at end of file diff --git a/public/locales/ru/swap.json b/public/locales/ru/swap.json index 2649da20..cc9c0b5f 100644 --- a/public/locales/ru/swap.json +++ b/public/locales/ru/swap.json @@ -11,18 +11,20 @@ "maximum-cost": "Maximum Cost", "minimum-received": "Minimum Received", "no-history": "No swap history", + "paid": "Paid", "pay": "You Pay", "preset": "Preset", "price-impact": "Price Impact", "rate": "Rate", "receive": "You Receive", + "received": "Received", "review-swap": "Review Swap", "show-fees": "Show Fees", "slippage": "Slippage", "swap-history": "Swap History", "swap-route": "Swap Route", - "tooltip-borrow-balance": "You'll use your {{balance}} {{token}} balance and borrow {{borrowAmount}} {{token}} to execute this swap", - "tooltip-borrow-no-balance": "You'll borrow {{borrowAmount}} {{token}} to execute this swap", + "tooltip-borrow-balance": "You'll use your {{balance}} {{token}} balance and borrow {{borrowAmount}} {{token}} to execute this swap. The current {{token}} variable borrow rate is {{rate}}%", + "tooltip-borrow-no-balance": "You'll borrow {{borrowAmount}} {{token}} to execute this swap. The current {{token}} variable borrow rate is {{rate}}%", "tooltip-max-slippage": "If price slips beyond your maximum slippage your swap will not be executed", "use-margin": "Allow Margin" } \ No newline at end of file diff --git a/public/locales/zh/swap.json b/public/locales/zh/swap.json index 2649da20..cc9c0b5f 100644 --- a/public/locales/zh/swap.json +++ b/public/locales/zh/swap.json @@ -11,18 +11,20 @@ "maximum-cost": "Maximum Cost", "minimum-received": "Minimum Received", "no-history": "No swap history", + "paid": "Paid", "pay": "You Pay", "preset": "Preset", "price-impact": "Price Impact", "rate": "Rate", "receive": "You Receive", + "received": "Received", "review-swap": "Review Swap", "show-fees": "Show Fees", "slippage": "Slippage", "swap-history": "Swap History", "swap-route": "Swap Route", - "tooltip-borrow-balance": "You'll use your {{balance}} {{token}} balance and borrow {{borrowAmount}} {{token}} to execute this swap", - "tooltip-borrow-no-balance": "You'll borrow {{borrowAmount}} {{token}} to execute this swap", + "tooltip-borrow-balance": "You'll use your {{balance}} {{token}} balance and borrow {{borrowAmount}} {{token}} to execute this swap. The current {{token}} variable borrow rate is {{rate}}%", + "tooltip-borrow-no-balance": "You'll borrow {{borrowAmount}} {{token}} to execute this swap. The current {{token}} variable borrow rate is {{rate}}%", "tooltip-max-slippage": "If price slips beyond your maximum slippage your swap will not be executed", "use-margin": "Allow Margin" } \ No newline at end of file diff --git a/public/locales/zh_tw/swap.json b/public/locales/zh_tw/swap.json index 2649da20..cc9c0b5f 100644 --- a/public/locales/zh_tw/swap.json +++ b/public/locales/zh_tw/swap.json @@ -11,18 +11,20 @@ "maximum-cost": "Maximum Cost", "minimum-received": "Minimum Received", "no-history": "No swap history", + "paid": "Paid", "pay": "You Pay", "preset": "Preset", "price-impact": "Price Impact", "rate": "Rate", "receive": "You Receive", + "received": "Received", "review-swap": "Review Swap", "show-fees": "Show Fees", "slippage": "Slippage", "swap-history": "Swap History", "swap-route": "Swap Route", - "tooltip-borrow-balance": "You'll use your {{balance}} {{token}} balance and borrow {{borrowAmount}} {{token}} to execute this swap", - "tooltip-borrow-no-balance": "You'll borrow {{borrowAmount}} {{token}} to execute this swap", + "tooltip-borrow-balance": "You'll use your {{balance}} {{token}} balance and borrow {{borrowAmount}} {{token}} to execute this swap. The current {{token}} variable borrow rate is {{rate}}%", + "tooltip-borrow-no-balance": "You'll borrow {{borrowAmount}} {{token}} to execute this swap. The current {{token}} variable borrow rate is {{rate}}%", "tooltip-max-slippage": "If price slips beyond your maximum slippage your swap will not be executed", "use-margin": "Allow Margin" } \ No newline at end of file