1
- import React , { Dispatch , SetStateAction , useCallback , useMemo } from 'react'
1
+ import React , { Dispatch , SetStateAction , useCallback } from 'react'
2
2
import { useTranslation } from 'react-i18next'
3
3
import { useSelector } from 'react-redux'
4
4
import { DeprecatedButton } from 'ui/src'
@@ -8,7 +8,6 @@ import { selectHasDismissedLowNetworkTokenWarning } from 'uniswap/src/features/b
8
8
import { WalletEventName } from 'uniswap/src/features/telemetry/constants'
9
9
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
10
10
import { NativeCurrency } from 'uniswap/src/features/tokens/NativeCurrency'
11
- import { ValueType , getCurrencyAmount } from 'uniswap/src/features/tokens/getCurrencyAmount'
12
11
import { useTransactionModalContext } from 'uniswap/src/features/transactions/TransactionModal/TransactionModalContext'
13
12
import { useIsBlocked } from 'uniswap/src/features/trm/hooks'
14
13
import { TestID } from 'uniswap/src/test/fixtures/testIDs'
@@ -35,29 +34,9 @@ export function SendFormButton({
35
34
recipient,
36
35
isMax,
37
36
derivedSendInfo : { chainId, currencyInInfo } ,
38
- exactAmountToken,
39
- exactAmountFiat,
40
37
} = useSendContext ( )
41
38
const { walletNeedsRestore } = useTransactionModalContext ( )
42
39
43
- const hasValueGreaterThanZero = useMemo ( ( ) => {
44
- if ( exactAmountToken ) {
45
- return getCurrencyAmount ( {
46
- value : exactAmountToken ,
47
- valueType : ValueType . Exact ,
48
- currency : currencyInInfo ?. currency ,
49
- } ) ?. greaterThan ( 0 )
50
- }
51
- if ( exactAmountFiat ) {
52
- return getCurrencyAmount ( {
53
- value : exactAmountFiat ,
54
- valueType : ValueType . Exact ,
55
- currency : currencyInInfo ?. currency ,
56
- } ) ?. greaterThan ( 0 )
57
- }
58
- return false
59
- } , [ exactAmountToken , exactAmountFiat , currencyInInfo ?. currency ] )
60
-
61
40
const isViewOnlyWallet = account . type === AccountType . Readonly
62
41
63
42
const { isBlocked : isActiveBlocked , isBlockedLoading : isActiveBlockedLoading } = useIsBlockedActiveAddress ( )
@@ -67,8 +46,7 @@ export function SendFormButton({
67
46
68
47
const insufficientGasFunds = warnings . warnings . some ( ( warning ) => warning . type === WarningLabel . InsufficientGasFunds )
69
48
70
- const actionButtonDisabled =
71
- ! ! warnings . blockingWarning || isBlocked || isBlockedLoading || walletNeedsRestore || ! hasValueGreaterThanZero
49
+ const actionButtonDisabled = ! ! warnings . blockingWarning || isBlocked || isBlockedLoading || walletNeedsRestore
72
50
73
51
const onPressReview = useCallback ( ( ) => {
74
52
if ( isViewOnlyWallet ) {
0 commit comments