@@ -4,15 +4,10 @@ import { useState } from 'react';
44import { useLoginLogout } from '@/hooks/useLoginLogout' ;
55import useUserStore from '@/stores/useUser.store' ;
66import iExecLogo from '../../assets/iexec-logo.svg' ;
7+ import { ChainLink } from '../ChainLink.tsx' ;
78import { Button } from '../ui/button.tsx' ;
8- import {
9- Select ,
10- SelectContent ,
11- SelectItem ,
12- SelectTrigger ,
13- SelectValue ,
14- } from '../ui/select.tsx' ;
159import { AddressChip } from './AddressChip.tsx' ;
10+ import { ChainSelector } from './ChainSelector.tsx' ;
1611
1712export function Navbar ( ) {
1813 const { isConnected, address } = useUserStore ( ) ;
@@ -24,30 +19,21 @@ export function Navbar() {
2419
2520 return (
2621 < div className = "flex items-center justify-between pt-6 lg:pt-3" >
27- < Link to = "/" className = "-m-2 flex items-center gap-2 p-2 font-mono" >
22+ < ChainLink to = "/" className = "-m-2 flex items-center gap-2 p-2 font-mono" >
2823 < img src = { iExecLogo } width = "25" height = "25" alt = "iExec logo" />
2924 < span className = "hidden sm:block" > iExec Explorer</ span >
30- </ Link >
25+ </ ChainLink >
3126 < div className = "mr-6 flex items-center gap-4 md:mr-0" >
3227 { isConnected && (
3328 < div className = "hidden md:flex" >
3429 < Button variant = "link" asChild className = "text-white" >
35- < Link to = "/account" > iExec Account</ Link >
30+ < ChainLink to = "/account" > iExec Account</ ChainLink >
3631 </ Button >
3732 < span className = "border-secondary border-l" />
3833 </ div >
3934 ) }
4035 < div className = "content hidden md:flex" >
41- < Select value = "bellecour" >
42- < SelectTrigger className = "" >
43- < SelectValue />
44- </ SelectTrigger >
45- < SelectContent >
46- < SelectItem value = "bellecour" >
47- < img src = { iExecLogo } className = "size-4" alt = "" /> Bellecour
48- </ SelectItem >
49- </ SelectContent >
50- </ Select >
36+ < ChainSelector />
5137 </ div >
5238 { isConnected ? (
5339 < div className = "flex max-w-[1260px] items-center gap-2" >
@@ -89,9 +75,9 @@ export function Navbar() {
8975
9076 < div className = "border-grey-600 bg-grey-900 pointer-events-auto fixed inset-y-0 left-0 z-10 flex w-full -translate-x-full flex-col overflow-auto rounded-r-3xl border-r px-6 pt-6 duration-300 group-has-[:checked]:translate-x-0 lg:w-[255px] lg:translate-x-0" >
9177 < div className = "-m-2 mr-6 flex items-center justify-between gap-2 py-2 pl-2" >
92- < Link to = "/" className = "font-mono" onClick = { handleMenuToggle } >
78+ < ChainLink to = "/" className = "font-mono" onClick = { handleMenuToggle } >
9379 < img src = { iExecLogo } width = "25" height = "25" alt = "iExec logo" />
94- </ Link >
80+ </ ChainLink >
9581 { isConnected ? (
9682 < div className = "flex max-w-[1260px] items-center gap-2" >
9783 < AddressChip address = { address ! } />
@@ -117,18 +103,9 @@ export function Navbar() {
117103 asChild
118104 className = "justify-baseline px-3 text-white"
119105 >
120- < Link to = "/account" > iExec Account</ Link >
106+ < ChainLink to = "/account" > iExec Account</ ChainLink >
121107 </ Button >
122- < Select value = "bellecour" >
123- < SelectTrigger className = "w-full border-none" >
124- < SelectValue />
125- </ SelectTrigger >
126- < SelectContent >
127- < SelectItem value = "bellecour" >
128- < img src = { iExecLogo } className = "size-4" alt = "" /> Bellecour
129- </ SelectItem >
130- </ SelectContent >
131- </ Select >
108+ < ChainSelector />
132109 </ div >
133110 </ div >
134111 </ div >
0 commit comments