diff --git a/src/_api/type.ts b/src/_api/type.ts index 4cbe2a82..c85f7796 100644 --- a/src/_api/type.ts +++ b/src/_api/type.ts @@ -216,5 +216,5 @@ export interface TTokenListRequestParams extends RequestInit { skipCount: number; maxResultCount: number; sort: SortEnum; - sortBy: string; + orderBy: string; } diff --git a/src/_utils/formatter.ts b/src/_utils/formatter.ts index 1d8d39a7..e9846e0e 100644 --- a/src/_utils/formatter.ts +++ b/src/_utils/formatter.ts @@ -62,9 +62,9 @@ export const addSymbol = (str: string | number) => { return `${str} ${process.env.NEXT_PUBLIC_SYMBOL}`; }; -export const divDecimals = (num: number | string, decimals = 1e10) => { +export const divDecimals = (num: number | string, decimals = 1e8) => { const bigNumber = new BigNumber(num); - return bigNumber.dividedBy(decimals || 1e10).toNumber(); + return bigNumber.dividedBy(decimals || 1e8).toNumber(); }; export const getPageNumber = (page: number, pageSize: number): number => { diff --git a/src/app/[chain]/block/[hash]/_components/detail.tsx b/src/app/[chain]/block/[hash]/_components/detail.tsx index d4128c75..5f142425 100644 --- a/src/app/[chain]/block/[hash]/_components/detail.tsx +++ b/src/app/[chain]/block/[hash]/_components/detail.tsx @@ -40,6 +40,7 @@ export default function Detail({ SSRData }) { setTimeFormat(timeFormat === 'Age' ? 'Date Time (UTC)' : 'Age'); }, chainId: chain as string, + type: 'block', }); }, [chain, timeFormat]); diff --git a/src/app/[chain]/blocks/blockList.tsx b/src/app/[chain]/blocks/blockList.tsx index 3bef1c9e..b59139b8 100644 --- a/src/app/[chain]/blocks/blockList.tsx +++ b/src/app/[chain]/blocks/blockList.tsx @@ -17,6 +17,7 @@ import { pageSizeOption } from '@_utils/contant'; import { fetchBlocks } from '@_api/fetchBlocks'; import { useAppSelector } from '@_store'; import { useParams } from 'next/navigation'; +import { Spin } from 'antd'; export enum pageType { first, @@ -110,24 +111,26 @@ export default function BlockList({ SSRData }) { return (
-
+ +
+
); } diff --git a/src/app/[chain]/blocks/columnConfig.tsx b/src/app/[chain]/blocks/columnConfig.tsx index 7a262b97..72d7df0d 100644 --- a/src/app/[chain]/blocks/columnConfig.tsx +++ b/src/app/[chain]/blocks/columnConfig.tsx @@ -45,8 +45,8 @@ export default function getColumns({ timeFormat, handleTimeChange, chianId }): C width: '208px', key: 'transactionCount', dataIndex: 'transactionCount', - render: (text) => ( - + render: (text, record) => ( + {text} ), diff --git a/src/app/[chain]/blocks/page.tsx b/src/app/[chain]/blocks/page.tsx index f52db530..3fc427b8 100644 --- a/src/app/[chain]/blocks/page.tsx +++ b/src/app/[chain]/blocks/page.tsx @@ -8,3 +8,5 @@ export default async function BlocksPage({ params }) { }); return ; } +export const revalidate = 1; +export const dynamic = 'force-dynamic'; diff --git a/src/app/[chain]/tokens/page.tsx b/src/app/[chain]/tokens/page.tsx index 24b283fa..aac42861 100644 --- a/src/app/[chain]/tokens/page.tsx +++ b/src/app/[chain]/tokens/page.tsx @@ -16,7 +16,7 @@ export default async function TokensPage({ params }: { params: ChainId }) { skipCount: 0, maxResultCount: 50, chainId: params.chain as TChainID, - sortBy: 'HolderCount', + orderBy: 'HolderCount', sort: SortEnum.desc, cache: 'no-store', }); diff --git a/src/app/[chain]/tokens/tokensList.tsx b/src/app/[chain]/tokens/tokensList.tsx index ac3bace0..09ef8a50 100644 --- a/src/app/[chain]/tokens/tokensList.tsx +++ b/src/app/[chain]/tokens/tokensList.tsx @@ -36,7 +36,7 @@ export default function TokensList({ SSRData }: TokensListProps) { maxResultCount: 50, chainId: chain as TChainID, sort, - sortBy: 'HolderCount', + orderBy: 'HolderCount', }; setLoading(true); const data = await fetchTokenList(params); diff --git a/src/app/transactions/columnConfig.tsx b/src/app/transactions/columnConfig.tsx index 2cfac0fe..fc2db083 100644 --- a/src/app/transactions/columnConfig.tsx +++ b/src/app/transactions/columnConfig.tsx @@ -19,6 +19,7 @@ export default function getColumns({ timeFormat, handleTimeChange, chainId = 'AELF', + type, }): ColumnsType { return [ { @@ -70,9 +71,10 @@ export default function getColumns({ title: 'Block', width: 112, dataIndex: 'blockHeight', + hidden: type === 'block', key: 'blockHeight', render: (text) => ( - + {text} ), diff --git a/src/app/transactions/list.tsx b/src/app/transactions/list.tsx index 3dd1950c..048cd6b1 100644 --- a/src/app/transactions/list.tsx +++ b/src/app/transactions/list.tsx @@ -38,6 +38,7 @@ export default function List({ SSRData, showHeader = true }) { handleTimeChange: () => { setTimeFormat(timeFormat === 'Age' ? 'Date Time (UTC)' : 'Age'); }, + type: 'tx', }); }, [timeFormat]);