From 42d9525ee3299f162a4883e5d185c5c849d0eef5 Mon Sep 17 00:00:00 2001 From: quangdz1704 Date: Thu, 26 Sep 2024 18:00:45 +0700 Subject: [PATCH] fix: select --- .../components/BannerNoticePool/index.tsx | 17 +++++++++++++++++ .../Swap/components/SelectToken/SelectToken.tsx | 9 ++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/pages/Pool-V3/components/BannerNoticePool/index.tsx b/src/pages/Pool-V3/components/BannerNoticePool/index.tsx index 95ab0b2ef..48e3498b2 100644 --- a/src/pages/Pool-V3/components/BannerNoticePool/index.tsx +++ b/src/pages/Pool-V3/components/BannerNoticePool/index.tsx @@ -87,6 +87,23 @@ const BannerNoticePool = () => { Add LP Now! 🚀 + + {/* +
+ + + + + + + +
*/}
setOpen(false)}> diff --git a/src/pages/UniversalSwap/Swap/components/SelectToken/SelectToken.tsx b/src/pages/UniversalSwap/Swap/components/SelectToken/SelectToken.tsx index 2c5734daf..7505451e4 100644 --- a/src/pages/UniversalSwap/Swap/components/SelectToken/SelectToken.tsx +++ b/src/pages/UniversalSwap/Swap/components/SelectToken/SelectToken.tsx @@ -1,4 +1,4 @@ -import { CustomChainInfo, TokenItemType, truncDecimals } from '@oraichain/oraidex-common'; +import { CustomChainInfo, TokenItemType, truncDecimals, HMSTR_ORAICHAIN_DENOM } from '@oraichain/oraidex-common'; import { ReactComponent as IconoirCancel } from 'assets/icons/iconoir_cancel.svg'; import { ReactComponent as NoResultDark } from 'assets/images/no-result-dark.svg'; import { ReactComponent as NoResultLight } from 'assets/images/no-result.svg'; @@ -152,6 +152,13 @@ export default function SelectToken({ const balanceDelta = Number(b.usd) - Number(a.usd); if (!balanceDelta) { + if (a.denom === HMSTR_ORAICHAIN_DENOM && b.denom !== HMSTR_ORAICHAIN_DENOM) { + return -1; // Push PepePoolKey elements to the top + } + if (a.denom !== HMSTR_ORAICHAIN_DENOM && b.denom === HMSTR_ORAICHAIN_DENOM) { + return 1; // Keep non-'a' elements below 'a' + } + return (tokenRank[b.coinGeckoId] || 0) - (tokenRank[a.coinGeckoId] || 0); } return balanceDelta;