diff --git a/src/_components/LogsContainer/index.tsx b/src/_components/LogsContainer/index.tsx
index 38ec7b38a..616e90f76 100644
--- a/src/_components/LogsContainer/index.tsx
+++ b/src/_components/LogsContainer/index.tsx
@@ -1,9 +1,6 @@
import React from 'react';
import { ILogsProps } from './type';
import DetailContainer from '@_components/DetailContainer';
-import Link from 'next/link';
-import addressFormat from '@_utils/urlUtils';
-import Copy from '@_components/Copy';
import LogItems from './logItems';
import { useParams } from 'next/navigation';
import ContractToken from '@_components/ContractToken';
diff --git a/src/_components/MobileHeaderMenu/index.tsx b/src/_components/MobileHeaderMenu/index.tsx
index 1584fdf5c..c0ab1736a 100644
--- a/src/_components/MobileHeaderMenu/index.tsx
+++ b/src/_components/MobileHeaderMenu/index.tsx
@@ -3,11 +3,10 @@ import IconFont from '@_components/IconFont';
import { MenuItem, NetworkItem } from '@_types';
import { Drawer, Menu, MenuProps } from 'antd';
import Link from 'next/link';
-import { useParams, usePathname, useRouter, useSearchParams } from 'next/navigation';
-import { useCallback, useMemo, useState } from 'react';
+import { useParams, usePathname, useSearchParams } from 'next/navigation';
+import { useMemo, useState } from 'react';
import './index.css';
-import { useAppDispatch, useAppSelector } from '@_store';
-import { setDefaultChain } from '@_store/features/chainIdSlice';
+import { useAppSelector } from '@_store';
import { getPathnameFirstSlash, isURL } from '@_utils/urlUtils';
import { useEnvContext } from 'next-runtime-env';
import { checkMainNet } from '@_utils/isMainNet';
@@ -19,6 +18,7 @@ import { homePath } from '@_components/Main';
import { DEFAULT_CHAIN, TG_BOT_LINK } from '@_utils/contant';
const ChangeIcoTest = '/image/aelf-header-top-test-change.svg';
import { TelegramPlatform } from '@portkey/did-ui-react';
+import useChainSelect from '@_hooks/useChainSelect';
interface IProps {
headerMenuList: MenuItem[];
@@ -38,7 +38,6 @@ export default function MobileHeaderMenu({ headerMenuList, setCurrent, selectedK
setShowMobileMenu(!showMobileMenu);
};
- console.log(chainArr, 'chainArr');
const onClick: MenuProps['onClick'] = (e) => {
if (!e.key.startsWith('http')) {
setCurrent(e.key);
@@ -47,7 +46,6 @@ export default function MobileHeaderMenu({ headerMenuList, setCurrent, selectedK
};
const { NEXT_PUBLIC_NETWORK_TYPE } = useEnvContext();
const isMainNet = checkMainNet(NEXT_PUBLIC_NETWORK_TYPE);
- const router = useRouter();
function getItem(label: React.ReactNode, key: React.Key, children?: AntdMenuItem[], type?: 'group'): AntdMenuItem {
return {
key,
@@ -84,21 +82,11 @@ export default function MobileHeaderMenu({ headerMenuList, setCurrent, selectedK
return getItem(label, path, convertMenuItems(children));
});
};
- const dispatch = useAppDispatch();
- const onSelectHandler = useCallback(
- (value: string) => {
- dispatch(setDefaultChain(value));
- if (value === DEFAULT_CHAIN) {
- router.push('/');
- } else {
- router.push(`/${value}`);
- }
- setCurrent('/');
- },
- [dispatch, router, setCurrent],
- );
const pathname = usePathname();
+
+ const onSelectHandler = useChainSelect(headerMenuList, setCurrent);
+
const origin = typeof window !== 'undefined' && window.location.origin;
const { chain } = useParams();
@@ -165,7 +153,7 @@ export default function MobileHeaderMenu({ headerMenuList, setCurrent, selectedK
},
...chainList,
];
- }, [chainArr, networkList, onSelectHandler, origin, selectChain]);
+ }, [chainArr, isTg, networkList, onSelectHandler, origin, selectChain]);
const items: MenuProps['items'] = [...convertMenuItems(headerMenuList)];
diff --git a/src/_hooks/useChainSelect.ts b/src/_hooks/useChainSelect.ts
new file mode 100644
index 000000000..0cd8e738b
--- /dev/null
+++ b/src/_hooks/useChainSelect.ts
@@ -0,0 +1,48 @@
+import { useAppDispatch } from '@_store';
+import { setDefaultChain } from '@_store/features/chainIdSlice';
+import { MenuItem } from '@_types';
+import { DEFAULT_CHAIN } from '@_utils/contant';
+import { usePathname, useRouter } from 'next/navigation';
+import { useCallback, useMemo } from 'react';
+
+export default function useChainSelect(headerMenuList: MenuItem[], setCurrent) {
+ const menus = useMemo(() => {
+ return headerMenuList.reduce((pre, cur) => {
+ if (cur.children.length) {
+ pre.push(...cur.children);
+ } else {
+ pre.push(cur);
+ }
+ return pre;
+ }, [] as MenuItem[]);
+ }, [headerMenuList]);
+
+ const dispatch = useAppDispatch();
+
+ const pathname = usePathname();
+
+ const router = useRouter();
+
+ const onSelectHandler = useCallback(
+ (value: string) => {
+ dispatch(setDefaultChain(value));
+ const segments = pathname.split('/');
+ const current = segments.length > 2 ? `/${segments[2]}` : '';
+
+ if (menus.find((item) => item.path === current)) {
+ router.push(`/${value}${current}`);
+ setCurrent(current);
+ } else {
+ if (value === DEFAULT_CHAIN) {
+ router.push('/');
+ } else {
+ router.push(`/${value}`);
+ }
+ setCurrent('/');
+ }
+ },
+ [dispatch, menus, pathname, router, setCurrent],
+ );
+
+ return onSelectHandler;
+}
diff --git a/src/_pluginsComponents/nft/_overview/OverView.tsx b/src/_pluginsComponents/nft/_overview/OverView.tsx
index d8eb8881b..a7309bfdc 100644
--- a/src/_pluginsComponents/nft/_overview/OverView.tsx
+++ b/src/_pluginsComponents/nft/_overview/OverView.tsx
@@ -4,7 +4,6 @@ import { CollectionDetailData } from '../type';
import '../detail.css';
import ContractToken from '@_components/ContractToken';
-import { AddressType } from '@_types/common';
import { useSearchParams } from 'next/navigation';
import { TChainID } from '@_api/type';
import { addSymbol, thousandsNumber } from '@_utils/formatter';
@@ -208,10 +207,10 @@ export default function OverView(props: OverViewProps) {
-
diff --git a/src/_pluginsComponents/nft/type.ts b/src/_pluginsComponents/nft/type.ts
index 9cf1cb8e2..795e6aa65 100644
--- a/src/_pluginsComponents/nft/type.ts
+++ b/src/_pluginsComponents/nft/type.ts
@@ -1,5 +1,5 @@
import { IFromInfo, TChainID, TransactionStatus } from '@_api/type';
-import { IToken } from '@_types/common';
+import { IAddress, IToken } from '@_types/common';
import { ISearchProps } from 'aelf-design';
// Collection detail api return type
@@ -13,6 +13,7 @@ export interface CollectionDetailData {
mergeHolders: number;
floorPrice: number;
tokenContractAddress: string;
+ contractAddress: IAddress;
mainChainFloorPrice: number;
sideChainFloorPrice: number;
mainChainFloorPriceOfUsd: number;
diff --git a/src/_types/common.ts b/src/_types/common.ts
index 167a39e52..d799c6d47 100644
--- a/src/_types/common.ts
+++ b/src/_types/common.ts
@@ -18,7 +18,7 @@ export interface IToken {
export interface IAddress {
name: string;
address: string;
- addressType: TAddressType;
+ addressType: AddressType;
isManager: false;
isProducer: true;
}
diff --git a/src/app/[chain]/block/[hash]/_components/baseinfo.tsx b/src/app/[chain]/block/[hash]/_components/baseinfo.tsx
index 00bc894b4..5fc28c2a9 100644
--- a/src/app/[chain]/block/[hash]/_components/baseinfo.tsx
+++ b/src/app/[chain]/block/[hash]/_components/baseinfo.tsx
@@ -53,7 +53,7 @@ export default function BaseInfo({ data, tabChange, jump }) {
- {formatDate(data.timestamp, 'age')}({dayjs.unix(data.timestamp).format('MMM-DD-YYYY hh:mm:ss Z')})
+ {formatDate(data.timestamp, 'age')}({formatDate(data.timestamp, 'Date Time (UTC)')})
),
diff --git a/src/app/[chain]/blocks/blockList.tsx b/src/app/[chain]/blocks/blockList.tsx
index abb2b4a0f..af5ad0dcd 100644
--- a/src/app/[chain]/blocks/blockList.tsx
+++ b/src/app/[chain]/blocks/blockList.tsx
@@ -84,8 +84,8 @@ export default function BlockList({ SSRData, defaultPage, defaultPageSize, defau
});
}, [chain, timeFormat]);
- const pageMaxBlock = data[0]?.blockHeight;
- const pageMinBlock = data[data.length - 1]?.blockHeight;
+ const pageMaxBlock = data && data[0]?.blockHeight;
+ const pageMinBlock = data && data[data.length - 1]?.blockHeight;
const { pageChange, pageSizeChange, chainChange } = usePagination({
setCurrentPage,
diff --git a/src/app/[chain]/blocks/columnConfig.tsx b/src/app/[chain]/blocks/columnConfig.tsx
index 1d74bb074..fcec8c2e1 100644
--- a/src/app/[chain]/blocks/columnConfig.tsx
+++ b/src/app/[chain]/blocks/columnConfig.tsx
@@ -4,15 +4,32 @@ import Link from 'next/link';
import Copy from '@_components/Copy';
import { MULTI_CHAIN } from '@_utils/contant';
import ChainTags from '@_components/ChainTags';
+import EPTooltip from '@_components/EPToolTip';
-const getAddressLink = (address, chainId, record) => (
-
- {record.producerName || addressFormat(hiddenAddress(address, 4, 4), record.chainIds ? record.chainIds[0] : chainId)}
-
-);
+const getAddressLink = (address, chainId, record) => {
+ const chain = record.chainIds ? record.chainIds[0] : chainId;
+ return (
+
+ Producer Name: {record.producerName}
+ ({addressFormat(address, chain)})
+
+ ) : (
+ addressFormat(address || '', chain)
+ )
+ }
+ mode="dark"
+ pointAtCenter={false}>
+