disable swap button if trade not populated (#3542)
This commit is contained in:
parent
a73f59b4ff
commit
cbc2ff668e
@ -94,13 +94,24 @@ export default memo(function SwapButton({ disabled }: SwapButtonProps) {
|
||||
const disableSwap = useMemo(
|
||||
() =>
|
||||
disabled ||
|
||||
!optimizedTrade ||
|
||||
!chainId ||
|
||||
wrapLoading ||
|
||||
(wrapType !== WrapType.NOT_APPLICABLE && wrapError) ||
|
||||
approvalState === ApproveOrPermitState.PENDING_SIGNATURE ||
|
||||
!(inputTradeCurrencyAmount && inputCurrencyBalance) ||
|
||||
inputCurrencyBalance.lessThan(inputTradeCurrencyAmount),
|
||||
[disabled, chainId, wrapLoading, wrapType, wrapError, approvalState, inputTradeCurrencyAmount, inputCurrencyBalance]
|
||||
[
|
||||
disabled,
|
||||
optimizedTrade,
|
||||
chainId,
|
||||
wrapLoading,
|
||||
wrapType,
|
||||
wrapError,
|
||||
approvalState,
|
||||
inputTradeCurrencyAmount,
|
||||
inputCurrencyBalance,
|
||||
]
|
||||
)
|
||||
|
||||
const actionProps = useMemo((): Partial<ActionButtonProps> | undefined => {
|
||||
|
Loading…
Reference in New Issue
Block a user