diff --git a/src/locales/en.json b/src/locales/en.json index cc746d903..256ff42f5 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -804,6 +804,9 @@ "type_script_hash": "Type Script Hash", "holders": "Holders", "unique_addresses": "Unique CKB Addresses", + "rgbpp_holders_count": "Holders", + "display_unique_ckb_addresses": "Display Unique CKB Addresses", + "display_rgbpp_holders": "Display RGB++ Holders", "decimal": "Decimal", "transactions": "24hr Transactions", "address_count": "Address Count", diff --git a/src/locales/zh.json b/src/locales/zh.json index 1991eb54d..21935169a 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -805,6 +805,9 @@ "type_script_hash": "Type Script Hash", "holders": "用户数", "unique_addresses": "CKB 地址数", + "rgbpp_holders_count": "持有人数", + "display_unique_ckb_addresses": "展示 CKB 地址数", + "display_rgbpp_holders": "展示 RGB++ 持有人数", "decimal": "小数位", "transactions": "24小时交易数", "address_count": "用户数", diff --git a/src/models/Xudt/index.ts b/src/models/Xudt/index.ts index 772986850..75cff07e3 100644 --- a/src/models/Xudt/index.ts +++ b/src/models/Xudt/index.ts @@ -13,6 +13,7 @@ export interface XUDTHolderAllocation { } export interface XUDT { + holdersCount: string addressesCount: string createdAt: string h24CkbTransactionsCount: string diff --git a/src/pages/Xudts/index.tsx b/src/pages/Xudts/index.tsx index eff46d2c6..50452ef08 100644 --- a/src/pages/Xudts/index.tsx +++ b/src/pages/Xudts/index.tsx @@ -1,4 +1,5 @@ -import { Table } from 'antd' +import { Table, Tooltip } from 'antd' +import { useHistory } from 'react-router' import { useQuery, UseQueryResult } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import { FC, ReactNode, useState } from 'react' @@ -197,6 +198,10 @@ const TokenTable: FC<{ isEmpty: boolean }> = ({ query, sortParam, isEmpty }) => { const { t } = useTranslation() + const RGBPP_VIEW = 'rgbpp' + const { location } = useHistory() + const urlQuery = new URLSearchParams(location.search) + const isRgbppView = urlQuery.get('view') === RGBPP_VIEW const nullableColumns: (ColumnGroupType | ColumnType | false | undefined)[] = [ { @@ -251,16 +256,36 @@ const TokenTable: FC<{ className: styles.colTransactions, render: (_, token) => localeNumberString(token.h24CkbTransactionsCount), }, - { - title: ( - <> - {t('xudt.unique_addresses')} - - - ), - className: styles.colAddressCount, - render: (_, token) => localeNumberString(token.addressesCount), - }, + isRgbppView + ? { + title: ( + + + {t('xudt.rgbpp_holders_count')} + + + ), + className: styles.colAddressCount, + render: (_, token) => localeNumberString(token.holdersCount), + } + : { + title: ( + + + {t('xudt.unique_addresses')} + + + + ), + className: styles.colAddressCount, + render: (_, token) => localeNumberString(token.addressesCount), + }, { title: ( <>