Skip to content

Commit

Permalink
fix: approve not appears to remove liquidity (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
prodesert22 authored Jun 26, 2023
1 parent be08dee commit 215cfda
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/components/Pools/RemoveLiquidity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { Field, useBurnStateAtom } from 'src/state/pburn/atom';
import { useBurnActionHandlers, useBurnState, useDerivedBurnInfo } from 'src/state/pburn/hooks';
import { useUserSlippageTolerance } from 'src/state/puser/hooks';
import { useRemoveLiquidityHook } from 'src/state/pwallet/hooks';
import { isEvmChain } from 'src/utils';
import { wrappedCurrency } from 'src/utils/wrappedCurrency';
import { ButtonWrapper, RemoveWrapper } from './styleds';

Expand Down Expand Up @@ -210,22 +209,20 @@ const RemoveLiquidity = ({ currencyA, currencyB, onLoading, onComplete }: Remove
} else {
return (
<ButtonWrapper>
{isEvmChain(chainId) && (
<Box mr="5px" width="100%">
<Button
variant={getApproveButtonVariant()}
onClick={() => {
onAttemptToApprove({ parsedAmounts, deadline, approveCallback });
}}
isDisabled={approval !== ApprovalState.NOT_APPROVED || signatureData !== null}
loading={attempting && !hash}
loadingText={t('removeLiquidity.approving')}
height="46px"
>
{getApproveButtonText()}
</Button>
</Box>
)}
<Box mr="5px" width="100%">
<Button
variant={getApproveButtonVariant()}
onClick={() => {
onAttemptToApprove({ parsedAmounts, deadline, approveCallback });
}}
isDisabled={approval !== ApprovalState.NOT_APPROVED || signatureData !== null}
loading={attempting && !hash}
loadingText={t('removeLiquidity.approving')}
height="46px"
>
{getApproveButtonText()}
</Button>
</Box>

<Box width="100%">
<Button
Expand Down

1 comment on commit 215cfda

@vercel
Copy link

@vercel vercel bot commented on 215cfda Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.