Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
finnian0826 committed Dec 30, 2024
1 parent 08d5cfe commit 8df26f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 40 deletions.
4 changes: 2 additions & 2 deletions src/components/GasFeeWarning.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
})
38 changes: 0 additions & 38 deletions src/earn/EarnEnterAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 &&
Expand Down Expand Up @@ -506,39 +501,6 @@ function EarnEnterAmount({ route }: Props) {
}}
testIdPrefix={'EarnEnterAmount'}
/>

{showNotEnoughBalanceForGasWarning && (
<InLineNotification
variant={NotificationVariant.Warning}
title={t('earnFlow.enterAmount.notEnoughBalanceForGasWarning.title', {
feeTokenSymbol: prepareTransactionsResult.feeCurrencies[0].symbol,
})}
description={t('earnFlow.enterAmount.notEnoughBalanceForGasWarning.description', {
feeTokenSymbol: prepareTransactionsResult.feeCurrencies[0].symbol,
network: NETWORK_NAMES[prepareTransactionsResult.feeCurrencies[0].networkId],
})}
ctaLabel={t('earnFlow.enterAmount.notEnoughBalanceForGasWarning.noGasCta', {
feeTokenSymbol: feeCurrencies[0].symbol,
network: NETWORK_NAMES[prepareTransactionsResult.feeCurrencies[0].networkId],
})}
onPressCta={() => {
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 && (
<InLineNotification
variant={NotificationVariant.Warning}
Expand Down

0 comments on commit 8df26f8

Please sign in to comment.