From dc4996f76dfe22f181fe8cbe61cb7896c4d40956 Mon Sep 17 00:00:00 2001 From: Apotheosis <97164662+0xApotheosis@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:19:52 +1000 Subject: [PATCH] chore: show chain not supported on rFOX claim --- .../RFOX/components/Stake/StakeInput.tsx | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/pages/RFOX/components/Stake/StakeInput.tsx b/src/pages/RFOX/components/Stake/StakeInput.tsx index a37e706cd59..b2b89bb624d 100644 --- a/src/pages/RFOX/components/Stake/StakeInput.tsx +++ b/src/pages/RFOX/components/Stake/StakeInput.tsx @@ -1,6 +1,11 @@ -import { CardFooter, Collapse, Skeleton, Stack } from '@chakra-ui/react' +import { CardBody, CardFooter, Collapse, Skeleton, Stack } from '@chakra-ui/react' import type { AssetId } from '@shapeshiftoss/caip' -import { foxAssetId, foxOnArbitrumOneAssetId, fromAssetId } from '@shapeshiftoss/caip' +import { + foxAssetId, + foxOnArbitrumOneAssetId, + fromAccountId, + fromAssetId, +} from '@shapeshiftoss/caip' import type { Asset, KnownChainIds } from '@shapeshiftoss/types' import noop from 'lodash/noop' import { useCallback, useEffect, useMemo, useState } from 'react' @@ -35,6 +40,7 @@ import { import { useAppDispatch, useAppSelector } from 'state/store' import { AddressSelection } from '../AddressSelection' +import { ChainNotSupported } from '../Shared/ChainNotSupported' import type { RfoxBridgeQuote } from './Bridge/types' import { BridgeRoutePaths } from './Bridge/types' import { StakeSummary } from './components/StakeSummary' @@ -207,6 +213,11 @@ export const StakeInput: React.FC = ({ methods, }) + const stakingAssetAccountAddress = useMemo( + () => (stakingAssetAccountId ? fromAccountId(stakingAssetAccountId).account : undefined), + [stakingAssetAccountId], + ) + const { data: cooldownPeriod } = useCooldownPeriodQuery() const handleRuneAddressChange = useCallback( @@ -409,6 +420,16 @@ export const StakeInput: React.FC = ({ if (!selectedAsset) return null + if (!stakingAssetAccountAddress) + return ( + + {headerComponent} + + + + + ) + return (