Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abbreviate transaction table column title on tablet
Browse files Browse the repository at this point in the history
buberdds committed Jun 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7b3a450 commit 986fbb8
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .changelog/532.bugfix.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Abbreviate transaction table column title on laptop
8 changes: 6 additions & 2 deletions src/app/components/Blocks/index.tsx
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import { paraTimesConfig } from '../../../config'
import { TablePaginationProps } from '../Table/TablePagination'
import { BlockHashLink, BlockLink } from './BlockLink'
import { formatDistanceStrict } from '../../utils/dateFormatter'
import { useScreenSize } from '../../hooks/useScreensize'

export type TableRuntimeBlock = RuntimeBlock & {
markAsNew?: boolean
@@ -28,12 +29,15 @@ type BlocksProps = {
export const Blocks = (props: BlocksProps) => {
const { isLoading, blocks, verbose, pagination, limit } = props
const { t } = useTranslation()

const { isLaptop } = useScreenSize()
const tableColumns: TableColProps[] = [
{ content: t('common.fill') },
{ content: t('common.height'), align: TableCellAlign.Right },
{ content: t('common.age'), align: TableCellAlign.Right },
{ content: t('common.transactions'), align: TableCellAlign.Right },
{
content: isLaptop ? t('common.transactionAbbreviation') : t('common.transactions'),
align: TableCellAlign.Right,
},
...(verbose ? [{ content: t('common.hash') }] : []),
{ content: t('common.size'), align: TableCellAlign.Right },
...(verbose ? [{ content: t('common.gasUsed'), align: TableCellAlign.Right }] : []),
3 changes: 2 additions & 1 deletion src/app/hooks/useScreensize.ts
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ export const useScreenSize = () => {
return {
isMobile: useMediaQuery(theme.breakpoints.down('sm')),
isTablet: useMediaQuery(theme.breakpoints.down('md')),
isDesktop: useMediaQuery(theme.breakpoints.up('md')),
isLaptop: useMediaQuery(theme.breakpoints.down('lg')),
isDesktop: useMediaQuery(theme.breakpoints.up('lg')),
}
}
1 change: 1 addition & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -76,6 +76,7 @@
"to": "To",
"totalSent": "Total Sent",
"transactions": "Transactions",
"transactionAbbreviation": "Txs",
"txnFee": "Txn Fee",
"type": "Type",
"unknown": "Unknown",

0 comments on commit 986fbb8

Please sign in to comment.