Skip to content

Commit

Permalink
Merge pull request #952 from autonomys/feat/change-subscan-url
Browse files Browse the repository at this point in the history
Change subscan url
  • Loading branch information
marc-aurele-besner authored Nov 15, 2024
2 parents a1eab5c + d6205bd commit c306297
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
1 change: 1 addition & 0 deletions .vscode/astral.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"gemini",
"graphiql",
"leaderboard",
"polkadot",
"siwe",
"subscan",
"subspace",
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"gemini",
"graphiql",
"leaderboard",
"polkadot",
"siwe",
"subscan",
"subspace",
Expand Down
27 changes: 17 additions & 10 deletions explorer/src/components/common/IndexingError.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { NetworkId } from '@autonomys/auto-utils'
import { XMarkIcon } from '@heroicons/react/24/outline'
import { EXTERNAL_ROUTES } from 'constants/routes'
import useChain from 'hooks/useChains'
import { FC, useCallback, useState } from 'react'

export const IndexingError: FC = () => {
const [isWarningVisible, setIsWarningVisible] = useState(true)
const { network } = useChain()

const handleHideWarning = useCallback(() => {
setIsWarningVisible(false)
Expand All @@ -17,17 +20,21 @@ export const IndexingError: FC = () => {
<p>
We are currently experiencing issues with our indexing service. Please bear with us as we
work to resolve this issue. You can check{' '}
{network === NetworkId.MAINNET && (
<>
<a
href={EXTERNAL_ROUTES.subscan}
target='_blank'
className='text-md text-whiteOpaque hover:text-primaryAccent'
rel='noreferrer'
>
Subscan
</a>{' '}
or{' '}
</>
)}
<a
href={EXTERNAL_ROUTES.subscan}
target='_blank'
className='text-md text-whiteOpaque hover:text-primaryAccent'
rel='noreferrer'
>
Subscan
</a>{' '}
or{' '}
<a
href={EXTERNAL_ROUTES.polkadot}
href={EXTERNAL_ROUTES.polkadot(network)}
target='_blank'
className='text-md text-whiteOpaque hover:text-primaryAccent'
rel='noreferrer'
Expand Down
17 changes: 10 additions & 7 deletions explorer/src/components/common/OutOfSyncBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useQuery } from '@apollo/client'
import { activate } from '@autonomys/auto-utils'
import { activate, NetworkId } from '@autonomys/auto-utils'
import { EXTERNAL_ROUTES } from 'constants/routes'
import { LastBlockQuery } from 'gql/graphql'
import useChains from 'hooks/useChains'
Expand All @@ -10,6 +10,7 @@ import { LAST_BLOCK } from './query'
const NORMAL_BLOCKS_DIVERGENCE = 120

const OutOfSyncBanner: FC = () => {
const { network } = useChains()
return (
<div className="container mx-auto mb-4 flex grow justify-center px-5 font-['Montserrat'] md:px-[25px] 2xl:px-0">
<div className='sticky top-0 z-50 w-full'>
Expand All @@ -24,12 +25,14 @@ const OutOfSyncBanner: FC = () => {
or use Polkadot.js Apps to interact with the chain.
</div>
<div>
<Link href={EXTERNAL_ROUTES.subscan} target='_blank'>
<button className='self-start rounded-[20px] bg-white px-[33px] py-[13px] text-sm font-medium text-gray-800 hover:bg-gray-200 dark:bg-[#1E254E] dark:text-white'>
Visit Subscan
</button>
</Link>
<Link className='ml-4' href={EXTERNAL_ROUTES.polkadot} target='_blank'>
{network === NetworkId.MAINNET && (
<Link href={EXTERNAL_ROUTES.subscan} target='_blank'>
<button className='self-start rounded-[20px] bg-white px-[33px] py-[13px] text-sm font-medium text-gray-800 hover:bg-gray-200 dark:bg-[#1E254E] dark:text-white'>
Visit Subscan
</button>
</Link>
)}
<Link className='ml-4' href={EXTERNAL_ROUTES.polkadot(network)} target='_blank'>
<button className='self-start rounded-[20px] bg-white px-[33px] py-[13px] text-sm font-medium text-gray-800 hover:bg-gray-200 dark:bg-[#1E254E] dark:text-white'>
Visit Polkadot.js Apps
</button>
Expand Down
6 changes: 3 additions & 3 deletions explorer/src/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ export const EXTERNAL_ROUTES = {
subSocial: 'https://app.subsocial.network/@NetworkSubspace',
},
novaExplorer: 'https://nova.subspace.network/',
polkadot:
'https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-0.gemini-3h.subspace.network%2Fws#/explorer',
subscan: 'https://subspace.subscan.io/',
polkadot: (network: NetworkId): string =>
`https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-0.${network}.subspace.network%2Fws#/explorer`,
subscan: 'https://autonomys.subscan.io/',
spaceAcres: 'https://api.github.com/repos/subspace/space-acres/releases/latest',
}

Expand Down

0 comments on commit c306297

Please sign in to comment.