Commit cbc2ff66 authored by Ian Lapham's avatar Ian Lapham Committed by GitHub

disable swap button if trade not populated (#3542)

parent a73f59b4
......@@ -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 => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment