Skip to content

Commit

Permalink
Don't show a second 'Transactions' in the transactions row
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Jun 12, 2023
1 parent a6c7fbc commit 1a98d81
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
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 : ''
const transactionsAnchor = account
? `${RouteUtils.getAccountRoute(
account,
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
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

0 comments on commit 1a98d81

Please sign in to comment.