diff --git a/src/features/defi/providers/foxy/components/FoxyManager/Overview/FoxyOverview.tsx b/src/features/defi/providers/foxy/components/FoxyManager/Overview/FoxyOverview.tsx index 2170f1096e3..3852b26ba9c 100644 --- a/src/features/defi/providers/foxy/components/FoxyManager/Overview/FoxyOverview.tsx +++ b/src/features/defi/providers/foxy/components/FoxyManager/Overview/FoxyOverview.tsx @@ -57,7 +57,7 @@ export const FoxyOverview: React.FC = ({ stakingAssetId, } = useFoxyQuery() const foxyApi = getFoxyApi() - const [canClaim, setCanClaim] = useState(false) + const [canClaim, setCanClaim] = useState(null) // The highest level AssetId/OpportunityId, in this case of the single FOXy contract const assetId = toAssetId({ chainId, @@ -209,6 +209,7 @@ export const FoxyOverview: React.FC = ({ action: DefiAction.Claim, variant: 'ghost-filled', colorScheme: 'green', + isLoading: canClaim === null, isDisabled: claimDisabled, toolTip: translate('defi.modals.overview.noWithdrawals'), }, diff --git a/src/features/defi/providers/foxy/components/FoxyManager/Overview/WithdrawCard.tsx b/src/features/defi/providers/foxy/components/FoxyManager/Overview/WithdrawCard.tsx index 4e9046a5aba..11e1b96b961 100644 --- a/src/features/defi/providers/foxy/components/FoxyManager/Overview/WithdrawCard.tsx +++ b/src/features/defi/providers/foxy/components/FoxyManager/Overview/WithdrawCard.tsx @@ -1,4 +1,4 @@ -import { Button, Stack, useColorModeValue } from '@chakra-ui/react' +import { Button, Skeleton, Stack, useColorModeValue } from '@chakra-ui/react' import dayjs from 'dayjs' import type { DefiParams, @@ -20,7 +20,7 @@ import type { UserUndelegation } from 'state/slices/opportunitiesSlice/resolvers type WithdrawCardProps = { asset: Asset undelegation: UserUndelegation | undefined - canClaimWithdraw: boolean + canClaimWithdraw: boolean | null } export const WithdrawCard = ({ asset, undelegation, canClaimWithdraw }: WithdrawCardProps) => { @@ -31,6 +31,7 @@ export const WithdrawCard = ({ asset, undelegation, canClaimWithdraw }: Withdraw } = useWallet() const hasClaim = bnOrZero(undelegation?.undelegationAmountCryptoBaseUnit).gt(0) const textColor = useColorModeValue('black', 'white') + const canClaimWithdrawLoading = canClaimWithdraw === null const isUndelegationAvailable = canClaimWithdraw && undelegation && dayjs().isAfter(dayjs.unix(undelegation.completionTime)) const successColor = useColorModeValue('green.500', 'green.200') @@ -106,21 +107,23 @@ export const WithdrawCard = ({ asset, undelegation, canClaimWithdraw }: Withdraw symbol={asset.symbol} maximumFractionDigits={4} /> - {isUndelegationAvailable ? ( - - - - - ) : ( - - )} + + {isUndelegationAvailable ? ( + + + + + ) : ( + + )} + )}