Skip to content

Commit

Permalink
fix: approve button show
Browse files Browse the repository at this point in the history
  • Loading branch information
Lz020316 authored May 6, 2024
1 parent e66edb6 commit 12e9ddc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/Swap/SwapActionButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { usePermit2 as usePermit2Enabled } from 'hooks/useSyncFlags'
import { useMemo } from 'react'
import { Field } from 'state/swap'

import ApproveButton from './ApproveButton'
import ConnectWalletButton from './ConnectWalletButton'
import SwapButton from './SwapButton'
import SwitchChainButton from './SwitchChainButton'
Expand Down Expand Up @@ -43,6 +44,8 @@ export default function SwapActionButton() {
return <SwitchChainButton chainId={supportedTokenChainId} />
} else if (isWrap) {
return <WrapButton disabled={isDisabled} />
} else if (approval.state !== SwapApprovalState.APPROVED) {
return <ApproveButton trade={trade} state={approval.state} approve={approval.approve} />
} else {
return <SwapButton disabled={isDisabled} />
}
Expand Down

0 comments on commit 12e9ddc

Please sign in to comment.