diff --git a/src/app/collective-rewards/rewards/builders/ClaimableRewards.tsx b/src/app/collective-rewards/rewards/builders/ClaimableRewards.tsx index cc89ca00..8acbeb4f 100644 --- a/src/app/collective-rewards/rewards/builders/ClaimableRewards.tsx +++ b/src/app/collective-rewards/rewards/builders/ClaimableRewards.tsx @@ -15,7 +15,6 @@ import { withSpinner } from '@/components/LoadingSpinner/withLoadingSpinner' import { usePricesContext } from '@/shared/context/PricesContext' import { FC } from 'react' import { Address } from 'viem' -import { Popover } from '../../../../components/Popover' type TokenRewardsMetricsProps = { builder: Address @@ -58,19 +57,11 @@ const TokenRewardsMetrics: FC = ({ fiatAmount, isLoading: rewardsLoading, children: ( - -

You cannot be paused to claim rewards

- - } - size="small" - position="top" - trigger="hover" - disabled={!isPaused} - > - claimRewards()} disabled={!isClaimable || isPaused} /> -
+ claimRewards()} + disabled={!isClaimable || isPaused} + isPaused={isPaused} + /> ), }) } diff --git a/src/app/collective-rewards/rewards/builders/Rewards.tsx b/src/app/collective-rewards/rewards/builders/Rewards.tsx index 4fd514ea..e99a2866 100644 --- a/src/app/collective-rewards/rewards/builders/Rewards.tsx +++ b/src/app/collective-rewards/rewards/builders/Rewards.tsx @@ -40,6 +40,7 @@ const RewardsContent: FC = props => {

You cannot be paused to claim rewards

} + className="w-full" size="small" position="top" trigger="hover" diff --git a/src/app/collective-rewards/rewards/builders/hooks/useClaimBuilderRewards.ts b/src/app/collective-rewards/rewards/builders/hooks/useClaimBuilderRewards.ts index 84b9219c..f39035fb 100644 --- a/src/app/collective-rewards/rewards/builders/hooks/useClaimBuilderRewards.ts +++ b/src/app/collective-rewards/rewards/builders/hooks/useClaimBuilderRewards.ts @@ -3,15 +3,14 @@ import { GaugeAbi } from '@/lib/abis/v2/GaugeAbi' import { Address } from 'viem' import { useWaitForTransactionReceipt, useWriteContract } from 'wagmi' import { useGetBuilderRewards } from '@/app/collective-rewards/rewards' -import { useBuilderContext } from '../../../user' +import { useBuilderContext } from '@/app/collective-rewards/user' const useClaimBuilderReward = (builder: Address, gauge: Address, rewardToken?: Address) => { const { writeContractAsync, error: executionError, data: hash, isPending } = useWriteContract() const { getBuilderByAddress } = useBuilderContext() const claimingBuilder = getBuilderByAddress(builder) - console.log('🚀 ~ useClaimBuilderReward ~ claimingBuilder:', claimingBuilder) - const isPaused = !!claimingBuilder?.stateFlags?.paused + const isPaused = claimingBuilder?.stateFlags?.paused ?? false const { isLoading, isSuccess, data, error: receiptError } = useWaitForTransactionReceipt({ hash }) diff --git a/src/app/collective-rewards/rewards/components/ClaimYouRewardButton.tsx b/src/app/collective-rewards/rewards/components/ClaimYouRewardButton.tsx index e5c21e3c..3b2248be 100644 --- a/src/app/collective-rewards/rewards/components/ClaimYouRewardButton.tsx +++ b/src/app/collective-rewards/rewards/components/ClaimYouRewardButton.tsx @@ -14,12 +14,16 @@ const ClaimYourRewardsSvg = () => ( ) -export const ClaimYourRewardsButton: FC> = buttonProps => ( +export const ClaimYourRewardsButton: FC< + Pick & { isPaused?: boolean } +> = ({ isPaused, ...buttonProps }) => (
-

Claim your rewards

+

+ {isPaused ? 'You cannot be paused to claim rewards' : 'Claim your rewards'} +

} size="small"