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

Don't show a second 'Transactions' in the transactions row #491

Merged
merged 1 commit into from
Jun 12, 2023
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
2 changes: 1 addition & 1 deletion src/app/components/Account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const Account: FC<AccountProps> = ({ account, isLoading, tokenPriceInfo,
const balance = account?.balances[0]?.balance ?? '0'
const address = account ? account.address_eth ?? account.address : undefined

const transactionsLabel = account ? t('common.transactionsNumber', { count: account.stats.num_txns }) : ''
const transactionsLabel = account ? account.stats.num_txns.toLocaleString() : ''
const transactionsAnchor = account
? `${RouteUtils.getAccountRoute(
account,
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Blocks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const Blocks = (props: BlocksProps) => {
},
{
align: TableCellAlign.Right,
content: block.num_transactions,
content: block.num_transactions.toLocaleString(),
key: 'txs',
},
...(verbose
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/BlockDetailPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const BlockDetailView: FC<{
if (!block) return <></>

const transactionsAnchor = `${RouteUtils.getBlockRoute(block, block.round)}#${transactionsContainerId}`
const transactionLabel = t('common.transactionsNumber', { count: block.num_transactions })
const transactionLabel = block.num_transactions.toLocaleString()
const blockGasLimit = paraTimesConfig[block.layer]?.mainnet.blockGasLimit
if (!blockGasLimit) throw new Error('blockGasLimit is not configured')
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ describe('SearchResultsView', () => {
/>,
)
expect(screen.getByText('1,396,255')).toBeInTheDocument()
expect(screen.getByRole('link', { name: '10 transactions' })).toBeInTheDocument()
expect(screen.getByRole('link', { name: '10 transactions' })).toHaveAttribute(
expect(screen.getByRole('link', { name: '10' })).toBeInTheDocument()
expect(screen.getByRole('link', { name: '10' })).toHaveAttribute(
'href',
'/mainnet/emerald/blocks/1396255#transactions',
)

expect(screen.getByText('143,553')).toBeInTheDocument()
expect(screen.getByRole('link', { name: '1 transaction' })).toBeInTheDocument()
expect(screen.getByRole('link', { name: '1 transaction' })).toHaveAttribute(
expect(screen.getByRole('link', { name: '1' })).toBeInTheDocument()
expect(screen.getByRole('link', { name: '1' })).toHaveAttribute(
'href',
'/mainnet/sapphire/blocks/143553#transactions',
)
Expand Down
2 changes: 0 additions & 2 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@
"to": "To",
"totalSent": "Total Sent",
"transactions": "Transactions",
"transactionsNumber_one": "1 transaction",
"transactionsNumber_other": "{{ count }} transactions",
"txnFee": "Txn Fee",
"type": "Type",
"unknown": "Unknown",
Expand Down