Skip to content

Commit

Permalink
fix ui
Browse files Browse the repository at this point in the history
  • Loading branch information
YongZL committed Jan 18, 2024
1 parent e3dabb6 commit 9b4fe1d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
6 changes: 5 additions & 1 deletion components/FullModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ const FullModal: FC<FullModalProps> = ({ menus, keys = 'text', onChooseItem, cho
if (item.onClick) {
item.onClick()
}
if (!item.to.startsWith('/')) {
window.open(item.to, '_blank')
return
}

r.push(item.to as string)

Expand All @@ -60,7 +64,7 @@ const FullModal: FC<FullModalProps> = ({ menus, keys = 'text', onChooseItem, cho
<div className=' text-[22px] inline-block font-medium border-b border-[#D9D9D9] border-solid pb-5 w-full mo:flex mo:w-full items-center mo:justify-between'>
<span
className={classNames({
'text-[#FC7823]': pathname === item.to.split('/')[1],
'text-[#FC7823]': item.to.startsWith('/') && pathname === item.to.split('/')[1],
})}
>
{item[keys]}
Expand Down
19 changes: 13 additions & 6 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ export const Header: FC<HeaderType> = ({
},
{
text: 'Explorer',
to: '/',
to: 'https://scan-devnet.ethda.io',
},
{
text: 'Blobscan',
to: '/',
to: 'https://blobscan-devnet.ethda.io/',
},
{
text: 'Try BlobTX',
Expand All @@ -76,11 +76,15 @@ export const Header: FC<HeaderType> = ({

{
text: 'Document',
to: './docs/lightpaper.pdf',
to: 'https://docs.ethda.io/',
},
]

const onSwitchTo = (address: string) => {
if (!address.startsWith('/')) {
window.open(address, '_blank')
return
}
push(address)
}
return (
Expand All @@ -106,20 +110,23 @@ export const Header: FC<HeaderType> = ({
<div onClick={() => onSwitchTo('/')} className={`nav-item ${pathname === '/' ? 'active' : ''}`}>
Home
</div>
<div onClick={() => onSwitchTo('/')} className={`nav-item ${pathname === '/' ? 'active' : ''}`}>
<div
onClick={() => onSwitchTo('https://scan-devnet.ethda.io')}
className={`nav-item ${pathname === '/Explorer' ? 'active' : ''}`}
>
Explorer
</div>
<div
onClick={() => onSwitchTo('https://blobscan-devnet.ethda.io/')}
className={`nav-item ${pathname === '/' ? 'active' : ''}`}
className={`nav-item ${pathname === '/Blobscan' ? 'active' : ''}`}
>
Blobscan
</div>
<div className={`nav-item ${pathname === '/build' ? 'active' : ''}`}>Build</div>
<div onClick={() => onSwitchTo('blob-TX')} className={`nav-item ${pathname === '/blob-TX' ? 'active' : ''}`}>
Try BlobTx
</div>
<Link href={'./docs/lightpaper.pdf'} target={'_blank'} className={`block nav-item`}>
<Link href={'https://docs.ethda.io/'} target={'_blank'} className={`block nav-item`}>
Document
</Link>
</div>
Expand Down

0 comments on commit 9b4fe1d

Please sign in to comment.