@@ -6,7 +6,7 @@ import { Address } from 'viem';
6
6
import { getPendingIncentives , useClaimableIncentives } from 'libs/common-contract-functions/src' ;
7
7
import { UNICODE_SYMBOLS } from 'libs/util-constants/src/lib/symbols' ;
8
8
import { TOKENOMICS } from 'libs/util-contracts/src' ;
9
- import { areAddressesEqual , notifyError , notifySuccess } from 'libs/util-functions/src' ;
9
+ import { notifyError , notifySuccess } from 'libs/util-functions/src' ;
10
10
11
11
import { getEthersProviderForEthereum , getTokenomicsEthersContract } from 'common-util/Contracts' ;
12
12
import { claimOwnerIncentivesRequest } from 'common-util/functions/requests' ;
@@ -18,6 +18,7 @@ const { Text } = Typography;
18
18
19
19
type RewardsSectionProps = {
20
20
ownerAddress : Address ;
21
+ isOwner : boolean ;
21
22
id : string ;
22
23
type : string ;
23
24
dataTestId : string ;
@@ -64,7 +65,7 @@ const getColumns = (
64
65
} ,
65
66
] ;
66
67
67
- export const RewardsSection : FC < RewardsSectionProps > = ( { ownerAddress, id, type, dataTestId } ) => {
68
+ export const RewardsSection : FC < RewardsSectionProps > = ( { ownerAddress, isOwner , id, type, dataTestId } ) => {
68
69
const { account } = useHelpers ( ) ;
69
70
70
71
const [ isClaimLoading , setIsClaimLoading ] = useState ( false ) ;
@@ -142,11 +143,11 @@ export const RewardsSection: FC<RewardsSectionProps> = ({ ownerAddress, id, type
142
143
] ) ;
143
144
144
145
const canClaim = useMemo ( ( ) => {
145
- if ( ! areAddressesEqual ( account . toString ( ) , ownerAddress ) ) return false ;
146
+ if ( ! isOwner ) return false ;
146
147
if ( claimableRewardWei === undefined || claimableTopUpWei === undefined ) return false ;
147
148
148
149
return claimableRewardWei > 0 || claimableTopUpWei > 0 ;
149
- } , [ account , ownerAddress , claimableRewardWei , claimableTopUpWei ] ) ;
150
+ } , [ isOwner , claimableRewardWei , claimableTopUpWei ] ) ;
150
151
151
152
const handleClaim = useCallback ( async ( ) => {
152
153
if ( ! account ) return ;
0 commit comments