From d19dd5fd75d836e51558bd05cfef89c78c810889 Mon Sep 17 00:00:00 2001 From: cabad11 Date: Wed, 27 Nov 2024 15:03:11 +0400 Subject: [PATCH] fix: remove currencyFrom filter --- .../components/ExchangeFormMain/ExchangeFormMain.jsx | 11 +---------- src/apps/simpleswap/components/Field/index.jsx | 5 +---- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/apps/simpleswap/components/ExchangeFormMain/ExchangeFormMain.jsx b/src/apps/simpleswap/components/ExchangeFormMain/ExchangeFormMain.jsx index 62ba92a4..b2a0ba1f 100644 --- a/src/apps/simpleswap/components/ExchangeFormMain/ExchangeFormMain.jsx +++ b/src/apps/simpleswap/components/ExchangeFormMain/ExchangeFormMain.jsx @@ -26,9 +26,6 @@ import { Tooltip, TooltipExtras } from '../Tooltip'; import Fields from '../Field'; import CloseIcon from '../icons/CloseIcon'; import PropTypes from 'prop-types'; -import { getNetworkByChainId } from '../../constants/networkData'; -import { getCurrencyInternalName } from '../../helpers/formatCurrency'; -import useAssets from '../../../../hooks/useAssets'; const ExchangeFormMain = (props) => { const { secondStep, isDesktopHorizontal, onExchangeClick } = props; @@ -50,7 +47,6 @@ const ExchangeFormMain = (props) => { const [isAnimateSwap, setIsAnimateSwap] = useState(false); const [animateTimer, setAnimateTimer] = useState(null); - const assets = useAssets(); const { t } = useTranslation(); @@ -88,13 +84,9 @@ const ExchangeFormMain = (props) => { !`${currencyFromValue}`.length || !`${currencyToValue}`.length; - const walletCurrencies = Object.entries(assets).reduce((acc, [chainId, tokens])=> { - return [...acc, ...tokens.map(token=>`${token.symbol.toLowerCase() === 'matic'? 'pol': token.symbol.toLowerCase() }:${getNetworkByChainId(chainId)?.shortName}`)] - },[]) - return (
- + { }} /> diff --git a/src/apps/simpleswap/components/Field/index.jsx b/src/apps/simpleswap/components/Field/index.jsx index c8e27be0..176e8c09 100644 --- a/src/apps/simpleswap/components/Field/index.jsx +++ b/src/apps/simpleswap/components/Field/index.jsx @@ -24,7 +24,7 @@ import { ExchangeContext } from '../../contexts/ExchangeContext'; import {getCurrencyInternalName} from '../../helpers/formatCurrency'; import PropTypes from 'prop-types'; -export default function Fields({ type, walletCurrencies }){ +export default function Fields({ type }){ const { t } = useTranslation(); const { @@ -87,7 +87,6 @@ export default function Fields({ type, walletCurrencies }){ const resultData = currenciesList.filter( (currency) => Object.keys(pairsList).includes(getCurrencyInternalName(currency)) && - walletCurrencies.includes(getCurrencyInternalName(currency)) && getCurrencyInternalName(currencyTo) !== getCurrencyInternalName(currency), ); @@ -108,7 +107,6 @@ export default function Fields({ type, walletCurrencies }){ fixedPairs, search, currencyFrom, - walletCurrencies ]); const [list] = useCurrenciesList({ @@ -246,5 +244,4 @@ export default function Fields({ type, walletCurrencies }){ Fields.propTypes = { type: PropTypes.string, - walletCurrencies: PropTypes.array, } \ No newline at end of file