diff --git a/packages/page-accounts/src/Accounts/BannerAssetHubMigration.tsx b/packages/page-accounts/src/Accounts/BannerAssetHubMigration.tsx new file mode 100644 index 0000000000..4bb499ba88 --- /dev/null +++ b/packages/page-accounts/src/Accounts/BannerAssetHubMigration.tsx @@ -0,0 +1,53 @@ +// Copyright 2017-2025 @polkadot/app-accounts authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import React, { useMemo } from 'react'; + +import { styled } from '@polkadot/react-components'; +import { useStakingAsyncApis } from '@polkadot/react-hooks'; + +import { useTranslation } from '../translate.js'; +import Banner from './Banner.js'; + +const BannerAssetHubMigration = () => { + const { t } = useTranslation(); + const { ahEndPoints, isRelayChain } = useStakingAsyncApis(); + + const assetHubEndPoint = useMemo(() => { + return ahEndPoints[Math.floor(Math.random() * ahEndPoints.length)]; + }, [ahEndPoints]); + + if (!isRelayChain) { + return null; + } + + return ( + +

+ {t('After Asset Hub migration, all funds have been moved to Asset Hub. Please switch to the ')} + + {t('Asset Hub chain')} + + {t(' to view your balances and details.')} +
+ {t('For more information about Asset Hub migration, check the ')} + details here. +

+
+ ); +}; + +const StyledBanner = styled(Banner)` + border: 1px solid #ffc107; + font-size: 1rem !important; +`; + +export default React.memo(BannerAssetHubMigration); diff --git a/packages/page-accounts/src/Accounts/index.tsx b/packages/page-accounts/src/Accounts/index.tsx index 8e8c35a498..ddbafd0f7c 100644 --- a/packages/page-accounts/src/Accounts/index.tsx +++ b/packages/page-accounts/src/Accounts/index.tsx @@ -28,6 +28,7 @@ import Qr from '../modals/Qr.js'; import { useTranslation } from '../translate.js'; import { SORT_CATEGORY, sortAccounts } from '../util.js'; import Account from './Account.js'; +import BannerAssetHubMigration from './BannerAssetHubMigration.js'; import BannerClaims from './BannerClaims.js'; import BannerExtension from './BannerExtension.js'; import Summary from './Summary.js'; @@ -335,6 +336,7 @@ function Overview ({ className = '', onStatusChange }: Props): React.ReactElemen onStatusChange={onStatusChange} /> )} + diff --git a/packages/page-parachains/src/Crowdloan/BannerAssetHubMigration.tsx b/packages/page-parachains/src/Crowdloan/BannerAssetHubMigration.tsx new file mode 100644 index 0000000000..e80d74b7fd --- /dev/null +++ b/packages/page-parachains/src/Crowdloan/BannerAssetHubMigration.tsx @@ -0,0 +1,45 @@ +// Copyright 2017-2025 @polkadot/app-parachains authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import React from 'react'; + +import { MarkWarning, styled } from '@polkadot/react-components'; +import { useStakingAsyncApis } from '@polkadot/react-hooks'; + +import { useTranslation } from '../translate.js'; + +const BannerAssetHubMigration = () => { + const { t } = useTranslation(); + const { isRelayChain } = useStakingAsyncApis(); + + if (!isRelayChain) { + return null; + } + + return ( + +

+ {t('After the Asset Hub migration, crowdloan related activity has been transferred to the `ah_ops` pallet on Asset Hub. You can claim your funds from there, or visit ')} + + {t('the Polkadot Crowdloan UI')} + + {t(' for more details.')} +

+
+ ); +}; + +const StyledBanner = styled(MarkWarning)` + border: 1px solid #ffc107; + background: #ffc10720; + font-size: 1rem !important; +`; + +export default React.memo(BannerAssetHubMigration); diff --git a/packages/page-parachains/src/Crowdloan/index.tsx b/packages/page-parachains/src/Crowdloan/index.tsx index f718450f16..fb67109bc5 100644 --- a/packages/page-parachains/src/Crowdloan/index.tsx +++ b/packages/page-parachains/src/Crowdloan/index.tsx @@ -9,6 +9,7 @@ import { Button, MarkWarning } from '@polkadot/react-components'; import { useBestNumber } from '@polkadot/react-hooks'; import { useTranslation } from '../translate.js'; +import BannerAssetHubMigration from './BannerAssetHubMigration.js'; import FundAdd from './FundAdd.js'; import Funds from './Funds.js'; import Summary from './Summary.js'; @@ -27,6 +28,7 @@ function Crowdloan ({ auctionInfo, campaigns: { activeCap, activeRaised, funds, return (
+ { +function Account ({ allSlashes, className = '', info, isDisabled, minCommission, targets }: Props): React.ReactElement { + const { controllerId, destination, hexSessionIdNext, hexSessionIdQueue, isLoading, isOwnController, isOwnStash, isStashNominating, isStashValidating, nominating, sessionIds, stakingLedger, stashId } = useMemo(() => info, [info]); const { t } = useTranslation(); const { api } = useApi(); const { isRelayChain } = useStakingAsyncApis(); @@ -211,6 +212,7 @@ function Account ({ allSlashes, className = '', info: { controllerId, destinatio