Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.

Commit c6200d5

Browse files
authored
Merge pull request #1674 from autonomys/add-deprecating-msg
Add deprecating message banner
2 parents 583cfa0 + 528f7fe commit c6200d5

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { EXTERNAL_ROUTES } from '../../constants/routes'
2+
import Link from 'next/link'
3+
import { useIndexers } from 'hooks/useIndexers'
4+
import { NetworkId } from '@autonomys/auto-utils'
5+
6+
export const DeprecatingBanner = () => {
7+
const { network } = useIndexers()
8+
return (
9+
<div className='container mx-auto mb-4 flex grow justify-center px-5 md:px-[25px] 2xl:px-0'>
10+
<div className='sticky top-0 z-10 w-full'>
11+
<div className='w-full rounded-lg bg-[#DDEFF1] p-5 shadow dark:border-none dark:bg-boxDark'>
12+
<div className='flex flex-col gap-4 text-center md:text-left'>
13+
<div className='text-[20px] font-bold text-[#282929] dark:text-white'>
14+
⚠️ Astral will be deprecated soon ⚠️
15+
</div>
16+
<div className='text-[15px] text-[#282929] dark:text-white'>
17+
Please use Subscan for up-to-date network data and Polkadot.js Apps to interact with
18+
the chain.
19+
</div>
20+
<div className='flex flex-col items-center gap-4 md:flex-row md:items-center'>
21+
{network === NetworkId.MAINNET && (
22+
<Link href={EXTERNAL_ROUTES.subscan} target='_blank'>
23+
<button className='self-start rounded-lg bg-white px-[33px] py-[13px] text-sm font-medium text-gray-800 hover:bg-gray-200 dark:bg-[#1E254E] dark:text-white'>
24+
Visit Subscan
25+
</button>
26+
</Link>
27+
)}
28+
<Link className='ml-4' href={EXTERNAL_ROUTES.polkadot(network)} target='_blank'>
29+
<button className='self-start rounded-lg bg-white px-[33px] py-[13px] text-sm font-medium text-gray-800 hover:bg-gray-200 dark:bg-[#1E254E] dark:text-white'>
30+
Visit Polkadot.js Apps
31+
</button>
32+
</Link>
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
</div>
38+
)
39+
}

explorer/src/components/layout/Layout.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import { CookieBanner } from 'components/common/CookieBanner'
44
import { ErrorFallback } from 'components/common/ErrorFallback'
5-
import { useOutOfSyncBanner } from 'components/common/OutOfSyncBanner'
6-
import { UnsupportedNetworkBanner } from 'components/common/UnsupportedNetworkBanner'
75
import { Container } from 'components/layout/Container'
86
import Footer from 'components/layout/Footer'
97
import { SectionHeader } from 'components/layout/SectionHeader'
@@ -12,6 +10,8 @@ import { FC, ReactNode, useEffect } from 'react'
1210
import { ErrorBoundary } from 'react-error-boundary'
1311
import ReactGA from 'react-ga4'
1412
import { logError } from 'utils/log'
13+
import { DeprecatingBanner } from '../common/DeprecatingBanner'
14+
import { UnsupportedNetworkBanner } from '../common/UnsupportedNetworkBanner'
1515

1616
type Props = {
1717
children?: ReactNode
@@ -20,16 +20,14 @@ type Props = {
2020

2121
export const MainLayout: FC<Props> = ({ children, subHeader }) => {
2222
const pathname = usePathname()
23-
const outOfSync = useOutOfSyncBanner()
24-
2523
useEffect(() => {
2624
ReactGA.send({ hitType: 'pageview', page: pathname })
2725
}, [pathname])
2826

2927
return (
3028
<div className='relative flex min-h-screen w-full flex-col bg-gradient-to-b from-backgroundLight to-backgroundDark dark:bg-boxDark dark:from-backgroundDarker dark:to-backgroundDarkest'>
3129
<div className='relative flex min-h-screen w-full flex-col'>
32-
{outOfSync}
30+
<DeprecatingBanner />
3331
<UnsupportedNetworkBanner />
3432
<SectionHeader />
3533
{subHeader}

indexers/dictionary

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 31a83976902749397b8f5d6a0b6ad85b01a639e4

0 commit comments

Comments
 (0)