File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed
Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ import { SUPPORTED_CHAINS } from '@/config' ;
2+ import { Terminal } from 'lucide-react' ;
3+ import useUserStore from '@/stores/useUser.store' ;
4+ import { Alert , AlertDescription , AlertTitle } from './ui/alert' ;
5+
6+ const SUPPORTED_CHAIN_IDS = SUPPORTED_CHAINS . map ( ( chain ) => chain . id ) ;
7+
8+ export function UnsupportedChain ( ) {
9+ const { chainId } = useUserStore ( ) ;
10+
11+ const isChainSupported =
12+ chainId !== undefined && SUPPORTED_CHAIN_IDS . includes ( chainId ) ;
13+
14+ if ( isChainSupported ) {
15+ return null ;
16+ }
17+
18+ return (
19+ < Alert variant = "destructive" className = "mx-auto mt-8 text-left" >
20+ < Terminal className = "h-4 w-4" />
21+ < AlertTitle > Error</ AlertTitle >
22+ < AlertDescription >
23+ It seems that you are using a chain that is not supported.
24+ </ AlertDescription >
25+ </ Alert >
26+ ) ;
27+ }
Original file line number Diff line number Diff line change 11export const PREVIEW_TABLE_LENGTH = 5 ;
22export const PREVIEW_TABLE_REFETCH_INTERVAL = 10_000 ;
3+ export const SUPPORTED_CHAINS = [
4+ {
5+ id : 134 ,
6+ name : 'Bellecour' ,
7+ icon : 'src/assets/iexec-logo.svg' ,
8+ blockExplorerUrl : 'https://blockscout-bellecour.iex.ec' ,
9+ subgraphUrl : 'https://thegraph.iex.ec/subgraphs/name/bellecour/poco-v5' ,
10+ } ,
11+ ] ;
Original file line number Diff line number Diff line change 11import { createRootRoute , Outlet } from '@tanstack/react-router' ;
22import { TanStackRouterDevtools } from '@tanstack/react-router-devtools' ;
33import { Footer } from '@/components/Footer' ;
4+ import { UnsupportedChain } from '@/components/UnsupportedChain' ;
45import { Navbar } from '@/components/navbar/NavBar' ;
56import { useSyncAccountWithUserStore } from '@/hooks/useSyncAccountWithUserStore' ;
67
@@ -14,6 +15,7 @@ function Root() {
1415 return (
1516 < div className = "mx-auto mb-20 w-full px-6 md:px-10 lg:px-20" >
1617 < Navbar />
18+ < UnsupportedChain />
1719 < Outlet />
1820 < Footer className = "mt-32" />
1921 < TanStackRouterDevtools />
You can’t perform that action at this time.
0 commit comments