Skip to content

Commit

Permalink
Merge pull request #491 from oasisprotocol/csillag/no-double-transact…
Browse files Browse the repository at this point in the history
…ions-label

Don't show a second 'Transactions' in the transactions row
  • Loading branch information
csillag authored Jun 12, 2023
2 parents b04841d + 6d77bb9 commit 58164a8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 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.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

0 comments on commit 58164a8

Please sign in to comment.