From 8df26f88c7875bc4315ee867843e56701ebcfde6 Mon Sep 17 00:00:00 2001 From: Finnian Jacobson-Schulte <140328381+finnian0826@users.noreply.github.com> Date: Mon, 30 Dec 2024 14:24:29 -0700 Subject: [PATCH] cleanup --- src/components/GasFeeWarning.test.tsx | 4 +-- src/earn/EarnEnterAmount.tsx | 38 --------------------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/src/components/GasFeeWarning.test.tsx b/src/components/GasFeeWarning.test.tsx index d650d383b5b..cf708527771 100644 --- a/src/components/GasFeeWarning.test.tsx +++ b/src/components/GasFeeWarning.test.tsx @@ -152,10 +152,10 @@ describe('GasFeeWarning', () => { expect(getByText(title)).toBeTruthy() expect(getByText(description)).toBeTruthy() if (ctaLabel) { - expect(getByText(ctaLabel)).toBeTruthy() fireEvent.press(getByText(ctaLabel)) - expect(onPressCta).toHaveBeenCalledTimes(1) } + expect(ctaLabel ? getByText(ctaLabel) : true).toBeTruthy() + expect(onPressCta).toHaveBeenCalledTimes(ctaLabel ? 1 : 0) } ) }) diff --git a/src/earn/EarnEnterAmount.tsx b/src/earn/EarnEnterAmount.tsx index f3ce5e1007b..28f0b6d7b22 100644 --- a/src/earn/EarnEnterAmount.tsx +++ b/src/earn/EarnEnterAmount.tsx @@ -38,7 +38,6 @@ import { useSelector } from 'src/redux/hooks' import { AmountInput } from 'src/send/EnterAmount' import EnterAmountOptions from 'src/send/EnterAmountOptions' import { AmountEnteredIn } from 'src/send/types' -import { NETWORK_NAMES } from 'src/shared/conts' import Colors from 'src/styles/colors' import { typeScale } from 'src/styles/fonts' import { Spacing } from 'src/styles/styles' @@ -285,10 +284,6 @@ function EarnEnterAmount({ route }: Props) { getFeeCurrencyAndAmounts(prepareTransactionsResult) const isAmountLessThanBalance = tokenAmount && tokenAmount.lte(balanceInInputToken) - const showNotEnoughBalanceForGasWarning = - isAmountLessThanBalance && - prepareTransactionsResult && - prepareTransactionsResult.type === 'not-enough-balance-for-gas' const transactionIsPossible = isAmountLessThanBalance && prepareTransactionsResult && @@ -506,39 +501,6 @@ function EarnEnterAmount({ route }: Props) { }} testIdPrefix={'EarnEnterAmount'} /> - - {showNotEnoughBalanceForGasWarning && ( - { - AppAnalytics.track(EarnEvents.earn_deposit_add_gas_press, { - gasTokenId: feeCurrencies[0].tokenId, - depositTokenId: pool.dataProps.depositTokenId, - networkId: pool.networkId, - providerId: pool.appId, - poolId: pool.positionId, - }) - navigate(Screens.FiatExchangeAmount, { - tokenId: prepareTransactionsResult.feeCurrencies[0].tokenId, - flow: CICOFlow.CashIn, - tokenSymbol: prepareTransactionsResult.feeCurrencies[0].symbol, - }) - }} - style={styles.warning} - testID="EarnEnterAmount/NotEnoughForGasWarning" - /> - )} {!isAmountLessThanBalance && (