From 9b4fe1d6f800e5a9d43c998a1c9605aae48ce35d Mon Sep 17 00:00:00 2001 From: lizhiyong <1679963578@qq.com> Date: Thu, 18 Jan 2024 11:19:57 +0800 Subject: [PATCH] fix ui --- components/FullModal.tsx | 6 +++++- components/Header.tsx | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/components/FullModal.tsx b/components/FullModal.tsx index be1609c..b1e8a5e 100644 --- a/components/FullModal.tsx +++ b/components/FullModal.tsx @@ -34,6 +34,10 @@ const FullModal: FC = ({ 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) @@ -60,7 +64,7 @@ const FullModal: FC = ({ menus, keys = 'text', onChooseItem, cho
{item[keys]} diff --git a/components/Header.tsx b/components/Header.tsx index 76fefb6..ce5e017 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -63,11 +63,11 @@ export const Header: FC = ({ }, { text: 'Explorer', - to: '/', + to: 'https://scan-devnet.ethda.io', }, { text: 'Blobscan', - to: '/', + to: 'https://blobscan-devnet.ethda.io/', }, { text: 'Try BlobTX', @@ -76,11 +76,15 @@ export const Header: FC = ({ { 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 ( @@ -106,12 +110,15 @@ export const Header: FC = ({
onSwitchTo('/')} className={`nav-item ${pathname === '/' ? 'active' : ''}`}> Home
-
onSwitchTo('/')} className={`nav-item ${pathname === '/' ? 'active' : ''}`}> +
onSwitchTo('https://scan-devnet.ethda.io')} + className={`nav-item ${pathname === '/Explorer' ? 'active' : ''}`} + > Explorer
onSwitchTo('https://blobscan-devnet.ethda.io/')} - className={`nav-item ${pathname === '/' ? 'active' : ''}`} + className={`nav-item ${pathname === '/Blobscan' ? 'active' : ''}`} > Blobscan
@@ -119,7 +126,7 @@ export const Header: FC = ({
onSwitchTo('blob-TX')} className={`nav-item ${pathname === '/blob-TX' ? 'active' : ''}`}> Try BlobTx
- + Document