From 19adabd692226643a1993939ba697aa83664fe12 Mon Sep 17 00:00:00 2001 From: zielvna Date: Mon, 29 Jul 2024 19:16:30 +0200 Subject: [PATCH 01/10] remove disable from swap inputs --- src/components/Swap/Swap.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/Swap/Swap.tsx b/src/components/Swap/Swap.tsx index 609ffc1e..dcd3e557 100644 --- a/src/components/Swap/Swap.tsx +++ b/src/components/Swap/Swap.tsx @@ -440,6 +440,11 @@ export const Swap: React.FC = ({ useEffect(() => { setRefresherTime(REFRESHER_INTERVAL) + + if (tokenFromIndex === tokenToIndex) { + setAmountFrom('') + setAmountTo('') + } }, [tokenFromIndex, tokenToIndex]) return ( @@ -517,9 +522,7 @@ export const Swap: React.FC = ({ tokens={tokens} current={tokenFromIndex !== null ? tokens[tokenFromIndex] : null} onSelect={setTokenFromIndex} - disabled={ - tokenFromIndex === null || tokenToIndex === null || tokenFromIndex === tokenToIndex - } + disabled={tokenFromIndex === tokenToIndex || tokenFromIndex !== null} hideBalances={walletStatus !== Status.Initialized} handleAddToken={handleAddToken} commonTokens={commonTokens} @@ -603,9 +606,7 @@ export const Swap: React.FC = ({ tokens={tokens} current={tokenToIndex !== null ? tokens[tokenToIndex] : null} onSelect={setTokenToIndex} - disabled={ - tokenFromIndex === null || tokenToIndex === null || tokenFromIndex === tokenToIndex - } + disabled={tokenFromIndex === tokenToIndex || tokenToIndex === null} hideBalances={walletStatus !== Status.Initialized} handleAddToken={handleAddToken} commonTokens={commonTokens} From ddac61ed40ffdfcab6b831d8763207a8b7256294 Mon Sep 17 00:00:00 2001 From: zielvna Date: Tue, 30 Jul 2024 11:50:50 +0200 Subject: [PATCH 02/10] fix disabled in swap inputs --- src/components/Swap/Swap.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Swap/Swap.tsx b/src/components/Swap/Swap.tsx index dcd3e557..e7e883e7 100644 --- a/src/components/Swap/Swap.tsx +++ b/src/components/Swap/Swap.tsx @@ -522,7 +522,7 @@ export const Swap: React.FC = ({ tokens={tokens} current={tokenFromIndex !== null ? tokens[tokenFromIndex] : null} onSelect={setTokenFromIndex} - disabled={tokenFromIndex === tokenToIndex || tokenFromIndex !== null} + disabled={tokenFromIndex === tokenToIndex || tokenFromIndex === null} hideBalances={walletStatus !== Status.Initialized} handleAddToken={handleAddToken} commonTokens={commonTokens} From a32d7086ca0514e5082c3bee370a0fca9721bcc4 Mon Sep 17 00:00:00 2001 From: Piotr Matlak Date: Tue, 30 Jul 2024 16:52:29 +0200 Subject: [PATCH 03/10] clean console logs --- src/components/Modals/Slippage/Slippage.tsx | 2 +- src/components/NewPosition/RangeSelector/RangeSelector.tsx | 2 +- src/store/sagas/pools.ts | 2 -- src/store/sagas/positions.ts | 2 -- src/store/selectors/positions.ts | 2 -- 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/Modals/Slippage/Slippage.tsx b/src/components/Modals/Slippage/Slippage.tsx index 0fb71ef8..d2740da6 100644 --- a/src/components/Modals/Slippage/Slippage.tsx +++ b/src/components/Modals/Slippage/Slippage.tsx @@ -118,7 +118,7 @@ const Slippage: React.FC = ({ {headerText ?? 'Exchange Transaction Settings'} -