Skip to content

Commit

Permalink
Abbreviate transaction table column title on tablet
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Jun 14, 2023
1 parent a2633cc commit 279ebaf
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand All @@ -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 }] : []),
Expand Down
3 changes: 2 additions & 1 deletion src/app/hooks/useScreensize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -76,6 +76,7 @@
"to": "To",
"totalSent": "Total Sent",
"transactions": "Transactions",
"transactionAbbreviation": "Txs",
"txnFee": "Txn Fee",
"type": "Type",
"unknown": "Unknown",
Expand Down

0 comments on commit 279ebaf

Please sign in to comment.