11import Button from 'components/common/Button' ;
2- import TipSection from 'components/common/donate/TipSection' ;
3- import { useDonate } from 'lib/hooks/ethereum/useDonate' ;
4- import { useNativeTokenPrice } from 'lib/hooks/ethereum/useNativeTokenPrice' ;
52import { useAddressPageContext } from 'lib/hooks/page-context/AddressPageContext' ;
6- import { isNullish } from 'lib/utils' ;
73import { useTranslations } from 'next-intl' ;
8- import { useState } from 'react' ;
94import ControlsWrapper from '../ControlsWrapper' ;
5+ import FeeNotice from './FeeNotice' ;
106
117interface Props {
8+ feeDollarAmount : string ;
129 isRevoking : boolean ;
1310 isAllConfirmed : boolean ;
1411 setOpen : ( open : boolean ) => void ;
15- revoke : ( tipDollarAmount : string ) => Promise < void > ;
12+ revoke : ( ) => Promise < void > ;
1613}
1714
18- const BatchRevokeControls = ( { isRevoking, isAllConfirmed, setOpen, revoke } : Props ) => {
15+ const BatchRevokeControls = ( { feeDollarAmount , isRevoking, isAllConfirmed, setOpen, revoke } : Props ) => {
1916 const t = useTranslations ( ) ;
2017 const { address, selectedChainId } = useAddressPageContext ( ) ;
21- const { nativeToken } = useDonate ( selectedChainId , 'batch-revoke-tip' ) ;
22- const { nativeTokenPrice } = useNativeTokenPrice ( selectedChainId ) ;
23-
24- const [ tipAmount , setTipAmount ] = useState < string | null > ( null ) ;
2518
2619 const getButtonText = ( ) => {
2720 if ( isRevoking ) return t ( 'common.buttons.revoking' ) ;
@@ -31,21 +24,13 @@ const BatchRevokeControls = ({ isRevoking, isAllConfirmed, setOpen, revoke }: Pr
3124
3225 const getButtonAction = ( ) => {
3326 if ( isAllConfirmed ) return ( ) => setOpen ( false ) ;
34- return async ( ) => {
35- if ( ! tipAmount && ! isNullish ( nativeTokenPrice ) ) throw new Error ( 'Tip amount is required' ) ;
36- await revoke ( tipAmount ?? '0' ) ;
37- } ;
27+ return revoke ;
3828 } ;
3929
4030 return (
41- < div className = "flex flex-col items-center justify-center gap-4" >
42- < TipSection chainId = { selectedChainId } nativeToken = { nativeToken } onSelect = { setTipAmount } />
43- < ControlsWrapper
44- chainId = { selectedChainId }
45- address = { address }
46- overrideDisabled = { ! tipAmount && ! isNullish ( nativeTokenPrice ) }
47- disabledReason = { t ( 'address.tooltips.select_tip' ) }
48- >
31+ < div className = "flex flex-col items-center justify-center gap-8" >
32+ < FeeNotice chainId = { selectedChainId } feeDollarAmount = { feeDollarAmount } />
33+ < ControlsWrapper chainId = { selectedChainId } address = { address } >
4934 { ( disabled ) => (
5035 < div >
5136 < Button
0 commit comments