Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop into testnet #1803

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "用户数",
Expand Down
1 change: 1 addition & 0 deletions src/models/Xudt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface XUDTHolderAllocation {
}

export interface XUDT {
holdersCount: string
addressesCount: string
createdAt: string
h24CkbTransactionsCount: string
Expand Down
47 changes: 36 additions & 11 deletions src/pages/Xudts/index.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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<XUDT> | ColumnType<XUDT> | false | undefined)[] = [
{
Expand Down Expand Up @@ -251,16 +256,36 @@ const TokenTable: FC<{
className: styles.colTransactions,
render: (_, token) => localeNumberString(token.h24CkbTransactionsCount),
},
{
title: (
<>
<span>{t('xudt.unique_addresses')}</span>
<SortButton field="addresses_count" sortParam={sortParam} />
</>
),
className: styles.colAddressCount,
render: (_, token) => localeNumberString(token.addressesCount),
},
isRgbppView
? {
title: (
<Tooltip title={t('xudt.display_rgbpp_holders')}>
<Link
to={`${location.pathname}?${new URLSearchParams({ ...urlQuery, view: 'ckb' })}`}
style={{ color: 'var(--primary-color)' }}
>
{t('xudt.rgbpp_holders_count')}
</Link>
</Tooltip>
),
className: styles.colAddressCount,
render: (_, token) => localeNumberString(token.holdersCount),
}
: {
title: (
<Tooltip title={t('xudt.display_unique_ckb_addresses')}>
<Link
to={`${location.pathname}?${new URLSearchParams({ ...urlQuery, view: RGBPP_VIEW })}`}
style={{ color: 'var(--primary-color)' }}
>
{t('xudt.unique_addresses')}
</Link>
<SortButton field="addresses_count" sortParam={sortParam} />
</Tooltip>
),
className: styles.colAddressCount,
render: (_, token) => localeNumberString(token.addressesCount),
},
{
title: (
<>
Expand Down