Commit f982eb07 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Time format toggle for table views (#2729)

* cookie for storing time format value

* rename TimeAgo component

* add toggle to tables (pt. 1)

* move TimeWithTooltip component

* add toggle to tables (pt. 2)

* change implementation of toggle component

* remove unnecessary timestamp label

* update screenshots

* more screenshot updates

* [skip ci] update clock icon

* update screenshots
parent 3e88991b
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.444 18.315a10 10 0 1 0 11.112-16.63 10 10 0 0 0-11.112 16.63ZM5.3 2.965a8.462 8.462 0 1 1 9.402 14.07A8.462 8.462 0 0 1 5.3 2.965Zm8.637 11.978a.768.768 0 0 0 .295.057.769.769 0 0 0 .546-1.315l-4.008-4V3.846a.769.769 0 1 0-1.538 0V10a.77.77 0 0 0 .223.546l4.23 4.23a.77.77 0 0 0 .252.167Z" fill="currentColor"/> <path d="M8.05.194a10 10 0 1 1 3.903 19.614A10 10 0 0 1 8.049.194ZM10 1.539a8.462 8.462 0 1 0 0 16.925 8.462 8.462 0 0 0 0-16.925Zm0 1.538a.77.77 0 0 1 .77.77v5.838l4.007 4a.771.771 0 0 1 .169.841.772.772 0 0 1-1.01.417.77.77 0 0 1-.251-.165l-4.23-4.232A.77.77 0 0 1 9.23 10V3.847a.77.77 0 0 1 .77-.77Z" fill="currentColor"/>
<path d="M19.697 9.64a9.704 9.704 0 0 0-1.434-4.73l-.194-.303a9.705 9.705 0 0 0-4.026-3.43l-.33-.143A9.703 9.703 0 0 0 8.461.419l-.354.064a9.705 9.705 0 0 0-4.71 2.405l-.259.25a9.705 9.705 0 0 0-2.58 4.618l-.075.35a9.705 9.705 0 0 0 .552 5.607l.143.33a9.704 9.704 0 0 0 3.43 4.025l.303.194a9.706 9.706 0 0 0 5.09 1.442l.48-.012a9.704 9.704 0 0 0 6.38-2.83l.332-.349A9.706 9.706 0 0 0 19.703 10l-.006-.359Zm-1.518-.047a8.189 8.189 0 0 0-2.11-5.09l-.28-.293a8.188 8.188 0 0 0-5.383-2.389L10 1.811a8.19 8.19 0 0 0-4.294 1.217l-.256.163A8.19 8.19 0 0 0 2.556 6.59l-.121.278a8.19 8.19 0 0 0-.466 4.73l.065.297A8.188 8.188 0 0 0 4.21 15.79l.218.21a8.19 8.19 0 0 0 3.974 2.03l.298.054a8.19 8.19 0 0 0 4.433-.52l.278-.12a8.19 8.19 0 0 0 3.397-2.895l.164-.255a8.19 8.19 0 0 0 1.216-4.295l-.01-.406ZM10.61 3.937a.61.61 0 0 0-.102-.339l-.077-.092a.61.61 0 0 0-.311-.168L10 3.327a.61.61 0 0 0-.338.102l-.093.077a.61.61 0 0 0-.179.43V10c0 .08.015.16.045.235l.056.105a.618.618 0 0 0 .075.092l4.17 4.17c.056.055.123.1.198.13l.115.035c.039.008.079.01.118.01h.002l.119-.01a.615.615 0 0 0 .115-.035l.107-.056a.601.601 0 0 0 .092-.075l.077-.093a.609.609 0 0 0 .057-.106l.035-.114.011-.12c0-.041-.004-.082-.011-.12l-.035-.115a.61.61 0 0 0-.134-.198L10.61 9.75V3.937Zm7.869 6.376a8.486 8.486 0 0 1-1.255 4.136l-.17.264a8.486 8.486 0 0 1-3.52 2.999l-.287.126a8.486 8.486 0 0 1-4.594.538l-.309-.055a8.484 8.484 0 0 1-4.117-2.104L4 15.999a8.485 8.485 0 0 1-2.254-4.037l-.068-.307a8.486 8.486 0 0 1 .484-4.902l.126-.288a8.486 8.486 0 0 1 2.999-3.52l.263-.17A8.486 8.486 0 0 1 10 1.516l.42.01A8.485 8.485 0 0 1 16 4l.289.305A8.484 8.484 0 0 1 18.485 10l-.006.314Zm1.509.182a10.002 10.002 0 0 1-2.575 6.216l-.342.36a10.001 10.001 0 0 1-6.575 2.916L10 20a10 10 0 0 1-5.244-1.486l-.311-.2A10.002 10.002 0 0 1 .91 14.166l-.148-.34a10.001 10.001 0 0 1-.57-5.777l.079-.362A10.002 10.002 0 0 1 2.928 2.93l.268-.257A10.001 10.001 0 0 1 8.049.192l.365-.065a10 10 0 0 1 5.413.634l.34.148a10.003 10.003 0 0 1 4.148 3.535l.2.312A10.002 10.002 0 0 1 20 9.999l-.012.496Zm-9.081-.869 3.904 3.899a.907.907 0 0 1 .198.294l.03.085c.026.085.04.174.04.263l-.005.09a.903.903 0 0 1-.035.174l-.03.085a.908.908 0 0 1-.138.229l-.06.066a.896.896 0 0 1-.216.157l-.08.037a.907.907 0 0 1-.61.03l-.083-.03a.904.904 0 0 1-.295-.194l-4.17-4.169a.914.914 0 0 1-.157-.214l-.038-.081a.91.91 0 0 1-.068-.349V3.937c0-.24.096-.471.265-.64l.067-.06A.906.906 0 0 1 10 3.03l.09.005c.207.021.402.113.551.261l.06.066a.906.906 0 0 1 .206.575v5.69Z" fill="currentColor"/>
</svg> </svg>
import React from 'react'; import React from 'react';
import type { TimeFormat } from 'types/settings';
import { ADDRESS_FORMATS, type AddressFormat } from 'types/views/address'; import { ADDRESS_FORMATS, type AddressFormat } from 'types/views/address';
import * as cookies from 'lib/cookies'; import * as cookies from 'lib/cookies';
...@@ -13,6 +14,8 @@ interface SettingsProviderProps { ...@@ -13,6 +14,8 @@ interface SettingsProviderProps {
interface TSettingsContext { interface TSettingsContext {
addressFormat: AddressFormat; addressFormat: AddressFormat;
toggleAddressFormat: () => void; toggleAddressFormat: () => void;
timeFormat: TimeFormat;
toggleTimeFormat: () => void;
} }
export const SettingsContext = React.createContext<TSettingsContext | null>(null); export const SettingsContext = React.createContext<TSettingsContext | null>(null);
...@@ -25,6 +28,10 @@ export function SettingsContextProvider({ children }: SettingsProviderProps) { ...@@ -25,6 +28,10 @@ export function SettingsContextProvider({ children }: SettingsProviderProps) {
initialAddressFormat && ADDRESS_FORMATS.includes(initialAddressFormat as AddressFormat) ? initialAddressFormat as AddressFormat : 'base16', initialAddressFormat && ADDRESS_FORMATS.includes(initialAddressFormat as AddressFormat) ? initialAddressFormat as AddressFormat : 'base16',
); );
const [ timeFormat, setTimeFormat ] = React.useState<TimeFormat>(
cookies.get(cookies.NAMES.TIME_FORMAT, appCookies) as TimeFormat || 'relative',
);
const toggleAddressFormat = React.useCallback(() => { const toggleAddressFormat = React.useCallback(() => {
setAddressFormat(prev => { setAddressFormat(prev => {
const nextValue = prev === 'base16' ? 'bech32' : 'base16'; const nextValue = prev === 'base16' ? 'bech32' : 'base16';
...@@ -33,12 +40,22 @@ export function SettingsContextProvider({ children }: SettingsProviderProps) { ...@@ -33,12 +40,22 @@ export function SettingsContextProvider({ children }: SettingsProviderProps) {
}); });
}, []); }, []);
const toggleTimeFormat = React.useCallback(() => {
setTimeFormat(prev => {
const nextValue = prev === 'relative' ? 'absolute' : 'relative';
cookies.set(cookies.NAMES.TIME_FORMAT, nextValue);
return nextValue;
});
}, []);
const value = React.useMemo(() => { const value = React.useMemo(() => {
return { return {
addressFormat, addressFormat,
toggleAddressFormat, toggleAddressFormat,
timeFormat,
toggleTimeFormat,
}; };
}, [ addressFormat, toggleAddressFormat ]); }, [ addressFormat, toggleAddressFormat, timeFormat, toggleTimeFormat ]);
return ( return (
<SettingsContext.Provider value={ value }> <SettingsContext.Provider value={ value }>
......
...@@ -12,6 +12,7 @@ export enum NAMES { ...@@ -12,6 +12,7 @@ export enum NAMES {
COLOR_MODE_HEX = 'chakra-ui-color-mode-hex', COLOR_MODE_HEX = 'chakra-ui-color-mode-hex',
ADDRESS_IDENTICON_TYPE = 'address_identicon_type', ADDRESS_IDENTICON_TYPE = 'address_identicon_type',
ADDRESS_FORMAT = 'address_format', ADDRESS_FORMAT = 'address_format',
TIME_FORMAT = 'time_format',
INDEXING_ALERT = 'indexing_alert', INDEXING_ALERT = 'indexing_alert',
ADBLOCK_DETECTED = 'adblock_detected', ADBLOCK_DETECTED = 'adblock_detected',
MIXPANEL_DEBUG = '_mixpanel_debug', MIXPANEL_DEBUG = '_mixpanel_debug',
......
...@@ -37,10 +37,11 @@ export interface TableColumnHeaderSortableProps<F extends string> extends TableC ...@@ -37,10 +37,11 @@ export interface TableColumnHeaderSortableProps<F extends string> extends TableC
onSortToggle: (sortField: F) => void; onSortToggle: (sortField: F) => void;
disabled?: boolean; disabled?: boolean;
indicatorPosition?: 'left' | 'right'; indicatorPosition?: 'left' | 'right';
contentAfter?: React.ReactNode;
} }
export const TableColumnHeaderSortable = <F extends string>(props: TableColumnHeaderSortableProps<F>) => { export const TableColumnHeaderSortable = <F extends string>(props: TableColumnHeaderSortableProps<F>) => {
const { sortField, sortValue, onSortToggle, children, disabled, indicatorPosition = 'left', ...rest } = props; const { sortField, sortValue, onSortToggle, children, disabled, indicatorPosition = 'left', contentAfter, ...rest } = props;
const handleSortToggle = React.useCallback(() => { const handleSortToggle = React.useCallback(() => {
onSortToggle(sortField); onSortToggle(sortField);
...@@ -64,6 +65,7 @@ export const TableColumnHeaderSortable = <F extends string>(props: TableColumnHe ...@@ -64,6 +65,7 @@ export const TableColumnHeaderSortable = <F extends string>(props: TableColumnHe
) } ) }
{ children } { children }
</Link> </Link>
{ contentAfter }
</TableColumnHeader> </TableColumnHeader>
); );
}; };
......
export const COLOR_THEME_IDS = [ 'light', 'dim', 'midnight', 'dark' ] as const; export const COLOR_THEME_IDS = [ 'light', 'dim', 'midnight', 'dark' ] as const;
export type ColorThemeId = typeof COLOR_THEME_IDS[number]; export type ColorThemeId = typeof COLOR_THEME_IDS[number];
export const TIME_FORMAT = [ 'relative', 'absolute' ] as const;
export type TimeFormat = typeof TIME_FORMAT[number];
...@@ -20,6 +20,7 @@ import DataListDisplay from 'ui/shared/DataListDisplay'; ...@@ -20,6 +20,7 @@ import DataListDisplay from 'ui/shared/DataListDisplay';
import Pagination from 'ui/shared/pagination/Pagination'; import Pagination from 'ui/shared/pagination/Pagination';
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages'; import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
import * as SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice'; import * as SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import AddressBlocksValidatedListItem from './blocksValidated/AddressBlocksValidatedListItem'; import AddressBlocksValidatedListItem from './blocksValidated/AddressBlocksValidatedListItem';
import AddressBlocksValidatedTableItem from './blocksValidated/AddressBlocksValidatedTableItem'; import AddressBlocksValidatedTableItem from './blocksValidated/AddressBlocksValidatedTableItem';
...@@ -103,11 +104,14 @@ const AddressBlocksValidated = ({ shouldRender = true, isQueryEnabled = true }: ...@@ -103,11 +104,14 @@ const AddressBlocksValidated = ({ shouldRender = true, isQueryEnabled = true }:
const content = query.data?.items ? ( const content = query.data?.items ? (
<> <>
<Box hideBelow="lg"> <Box hideBelow="lg">
<TableRoot style={{ tableLayout: 'auto' }}> <TableRoot tableLayout="auto">
<TableHeaderSticky top={ query.pagination.isVisible ? ACTION_BAR_HEIGHT_DESKTOP : 0 }> <TableHeaderSticky top={ query.pagination.isVisible ? ACTION_BAR_HEIGHT_DESKTOP : 0 }>
<TableRow> <TableRow>
<TableColumnHeader>Block</TableColumnHeader> <TableColumnHeader>Block</TableColumnHeader>
<TableColumnHeader>Age</TableColumnHeader> <TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>Txn</TableColumnHeader> <TableColumnHeader>Txn</TableColumnHeader>
<TableColumnHeader>Gas used</TableColumnHeader> <TableColumnHeader>Gas used</TableColumnHeader>
{ !config.UI.views.block.hiddenFields?.total_reward && !config.features.rollup.isEnabled && { !config.UI.views.block.hiddenFields?.total_reward && !config.features.rollup.isEnabled &&
......
...@@ -41,7 +41,10 @@ test.describe('base view', () => { ...@@ -41,7 +41,10 @@ test.describe('base view', () => {
); );
}); });
test('desktop', async() => { test('desktop', async({ page }) => {
await expect(component).toHaveScreenshot();
await component.locator('button[aria-label="Toggle time format"]').click();
await page.mouse.move(0, 0);
await expect(component).toHaveScreenshot(); await expect(component).toHaveScreenshot();
}); });
......
...@@ -8,7 +8,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton'; ...@@ -8,7 +8,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile'; import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import NovesFromTo from 'ui/shared/Noves/NovesFromTo'; import NovesFromTo from 'ui/shared/Noves/NovesFromTo';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = { type Props = {
isPlaceholderData: boolean; isPlaceholderData: boolean;
...@@ -41,7 +41,7 @@ const AddressAccountHistoryListItem = (props: Props) => { ...@@ -41,7 +41,7 @@ const AddressAccountHistoryListItem = (props: Props) => {
Action Action
</Text> </Text>
</Flex> </Flex>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ props.tx.rawTransactionData.timestamp * 1000 } timestamp={ props.tx.rawTransactionData.timestamp * 1000 }
color="text.secondary" color="text.secondary"
borderRadius="sm" borderRadius="sm"
......
...@@ -8,7 +8,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton'; ...@@ -8,7 +8,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton';
import { TableCell, TableRow } from 'toolkit/chakra/table'; import { TableCell, TableRow } from 'toolkit/chakra/table';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import NovesFromTo from 'ui/shared/Noves/NovesFromTo'; import NovesFromTo from 'ui/shared/Noves/NovesFromTo';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = { type Props = {
isPlaceholderData: boolean; isPlaceholderData: boolean;
...@@ -27,7 +27,7 @@ const AddressAccountHistoryTableItem = (props: Props) => { ...@@ -27,7 +27,7 @@ const AddressAccountHistoryTableItem = (props: Props) => {
return ( return (
<TableRow> <TableRow>
<TableCell px={ 3 } py="18px" fontSize="sm" > <TableCell px={ 3 } py="18px" fontSize="sm" >
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ props.tx.rawTransactionData.timestamp * 1000 } timestamp={ props.tx.rawTransactionData.timestamp * 1000 }
isLoading={ props.isPlaceholderData } isLoading={ props.isPlaceholderData }
color="text.secondary" color="text.secondary"
......
...@@ -11,7 +11,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton'; ...@@ -11,7 +11,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton';
import BlockGasUsed from 'ui/shared/block/BlockGasUsed'; import BlockGasUsed from 'ui/shared/block/BlockGasUsed';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile'; import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = Block & { type Props = Block & {
page: number; page: number;
...@@ -30,7 +30,7 @@ const AddressBlocksValidatedListItem = (props: Props) => { ...@@ -30,7 +30,7 @@ const AddressBlocksValidatedListItem = (props: Props) => {
noIcon noIcon
fontWeight={ 700 } fontWeight={ 700 }
/> />
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ props.timestamp } timestamp={ props.timestamp }
enableIncrement={ props.page === 1 } enableIncrement={ props.page === 1 }
isLoading={ props.isLoading } isLoading={ props.isLoading }
......
...@@ -10,7 +10,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton'; ...@@ -10,7 +10,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton';
import { TableCell, TableRow } from 'toolkit/chakra/table'; import { TableCell, TableRow } from 'toolkit/chakra/table';
import BlockGasUsed from 'ui/shared/block/BlockGasUsed'; import BlockGasUsed from 'ui/shared/block/BlockGasUsed';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = Block & { type Props = Block & {
page: number; page: number;
...@@ -32,7 +32,7 @@ const AddressBlocksValidatedTableItem = (props: Props) => { ...@@ -32,7 +32,7 @@ const AddressBlocksValidatedTableItem = (props: Props) => {
/> />
</TableCell> </TableCell>
<TableCell> <TableCell>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ props.timestamp } timestamp={ props.timestamp }
enableIncrement={ props.page === 1 } enableIncrement={ props.page === 1 }
isLoading={ props.isLoading } isLoading={ props.isLoading }
......
...@@ -11,6 +11,7 @@ import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } ...@@ -11,6 +11,7 @@ import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow }
import ActionBar, { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar'; import ActionBar, { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar';
import DataListDisplay from 'ui/shared/DataListDisplay'; import DataListDisplay from 'ui/shared/DataListDisplay';
import Pagination from 'ui/shared/pagination/Pagination'; import Pagination from 'ui/shared/pagination/Pagination';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import AddressCoinBalanceListItem from './AddressCoinBalanceListItem'; import AddressCoinBalanceListItem from './AddressCoinBalanceListItem';
import AddressCoinBalanceTableItem from './AddressCoinBalanceTableItem'; import AddressCoinBalanceTableItem from './AddressCoinBalanceTableItem';
...@@ -31,7 +32,10 @@ const AddressCoinBalanceHistory = ({ query }: Props) => { ...@@ -31,7 +32,10 @@ const AddressCoinBalanceHistory = ({ query }: Props) => {
<TableRow> <TableRow>
<TableColumnHeader width="20%">Block</TableColumnHeader> <TableColumnHeader width="20%">Block</TableColumnHeader>
<TableColumnHeader width="20%">Txn</TableColumnHeader> <TableColumnHeader width="20%">Txn</TableColumnHeader>
<TableColumnHeader width="20%">Age</TableColumnHeader> <TableColumnHeader width="20%">
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader width="20%" isNumeric pr={ 1 }>Balance { currencyUnits.ether }</TableColumnHeader> <TableColumnHeader width="20%" isNumeric pr={ 1 }>Balance { currencyUnits.ether }</TableColumnHeader>
<TableColumnHeader width="20%" isNumeric>Delta</TableColumnHeader> <TableColumnHeader width="20%" isNumeric>Delta</TableColumnHeader>
</TableRow> </TableRow>
......
...@@ -10,7 +10,7 @@ import { WEI, ZERO } from 'toolkit/utils/consts'; ...@@ -10,7 +10,7 @@ import { WEI, ZERO } from 'toolkit/utils/consts';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile'; import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = AddressCoinBalanceHistoryItem & { type Props = AddressCoinBalanceHistoryItem & {
page: number; page: number;
...@@ -59,7 +59,7 @@ const AddressCoinBalanceListItem = (props: Props) => { ...@@ -59,7 +59,7 @@ const AddressCoinBalanceListItem = (props: Props) => {
) } ) }
<Flex columnGap={ 2 } w="100%"> <Flex columnGap={ 2 } w="100%">
<Skeleton loading={ props.isLoading } fontWeight={ 500 } flexShrink={ 0 }>Age</Skeleton> <Skeleton loading={ props.isLoading } fontWeight={ 500 } flexShrink={ 0 }>Age</Skeleton>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ props.block_timestamp } timestamp={ props.block_timestamp }
enableIncrement={ props.page === 1 } enableIncrement={ props.page === 1 }
isLoading={ props.isLoading } isLoading={ props.isLoading }
......
...@@ -9,7 +9,7 @@ import { TableCell, TableRow } from 'toolkit/chakra/table'; ...@@ -9,7 +9,7 @@ import { TableCell, TableRow } from 'toolkit/chakra/table';
import { WEI, ZERO } from 'toolkit/utils/consts'; import { WEI, ZERO } from 'toolkit/utils/consts';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = AddressCoinBalanceHistoryItem & { type Props = AddressCoinBalanceHistoryItem & {
page: number; page: number;
...@@ -42,7 +42,7 @@ const AddressCoinBalanceTableItem = (props: Props) => { ...@@ -42,7 +42,7 @@ const AddressCoinBalanceTableItem = (props: Props) => {
) } ) }
</TableCell> </TableCell>
<TableCell> <TableCell>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ props.block_timestamp } timestamp={ props.block_timestamp }
enableIncrement={ props.page === 1 } enableIncrement={ props.page === 1 }
isLoading={ props.isLoading } isLoading={ props.isLoading }
......
...@@ -9,7 +9,7 @@ import BlockEntity from 'ui/shared/entities/block/BlockEntity'; ...@@ -9,7 +9,7 @@ import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import TokenEntity from 'ui/shared/entities/token/TokenEntity'; import TokenEntity from 'ui/shared/entities/token/TokenEntity';
import EpochRewardTypeTag from 'ui/shared/EpochRewardTypeTag'; import EpochRewardTypeTag from 'ui/shared/EpochRewardTypeTag';
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid'; import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = { type Props = {
item: AddressEpochRewardsItem; item: AddressEpochRewardsItem;
...@@ -39,7 +39,7 @@ const AddressEpochRewardsListItem = ({ item, isLoading }: Props) => { ...@@ -39,7 +39,7 @@ const AddressEpochRewardsListItem = ({ item, isLoading }: Props) => {
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.block_timestamp } timestamp={ item.block_timestamp }
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
......
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import type { AddressEpochRewardsItem } from 'types/api/address'; import type { AddressEpochRewardsItem } from 'types/api/address';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import AddressEpochRewardsTableItem from './AddressEpochRewardsTableItem'; import AddressEpochRewardsTableItem from './AddressEpochRewardsTableItem';
...@@ -17,7 +18,10 @@ const AddressEpochRewardsTable = ({ items, isLoading, top }: Props) => { ...@@ -17,7 +18,10 @@ const AddressEpochRewardsTable = ({ items, isLoading, top }: Props) => {
<TableRoot minW="1000px" style={{ tableLayout: 'auto' }}> <TableRoot minW="1000px" style={{ tableLayout: 'auto' }}>
<TableHeaderSticky top={ top }> <TableHeaderSticky top={ top }>
<TableRow> <TableRow>
<TableColumnHeader>Block</TableColumnHeader> <TableColumnHeader>
Block
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>Reward type</TableColumnHeader> <TableColumnHeader>Reward type</TableColumnHeader>
<TableColumnHeader>Associated address</TableColumnHeader> <TableColumnHeader>Associated address</TableColumnHeader>
<TableColumnHeader isNumeric>Value</TableColumnHeader> <TableColumnHeader isNumeric>Value</TableColumnHeader>
......
...@@ -10,7 +10,7 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity'; ...@@ -10,7 +10,7 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import TokenEntity from 'ui/shared/entities/token/TokenEntity'; import TokenEntity from 'ui/shared/entities/token/TokenEntity';
import EpochRewardTypeTag from 'ui/shared/EpochRewardTypeTag'; import EpochRewardTypeTag from 'ui/shared/EpochRewardTypeTag';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = { type Props = {
item: AddressEpochRewardsItem; item: AddressEpochRewardsItem;
...@@ -27,7 +27,7 @@ const AddressEpochRewardsTableItem = ({ item, isLoading }: Props) => { ...@@ -27,7 +27,7 @@ const AddressEpochRewardsTableItem = ({ item, isLoading }: Props) => {
<Skeleton loading={ isLoading }> <Skeleton loading={ isLoading }>
<Text color="text.secondary" fontWeight={ 600 }>{ `Epoch # ${ item.epoch_number }` }</Text> <Text color="text.secondary" fontWeight={ 600 }>{ `Epoch # ${ item.epoch_number }` }</Text>
</Skeleton> </Skeleton>
<TimeAgoWithTooltip timestamp={ item.block_timestamp } isLoading={ isLoading } color="text.secondary" fontWeight={ 400 }/> <TimeWithTooltip timestamp={ item.block_timestamp } isLoading={ isLoading } color="text.secondary" fontWeight={ 400 }/>
</Flex> </Flex>
</TableCell> </TableCell>
<TableCell verticalAlign="middle"> <TableCell verticalAlign="middle">
......
...@@ -12,7 +12,7 @@ import AddressFromToIcon from 'ui/shared/address/AddressFromToIcon'; ...@@ -12,7 +12,7 @@ import AddressFromToIcon from 'ui/shared/address/AddressFromToIcon';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import TokenEntity from 'ui/shared/entities/token/TokenEntity'; import TokenEntity from 'ui/shared/entities/token/TokenEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import { ADVANCED_FILTER_TYPES } from './constants'; import { ADVANCED_FILTER_TYPES } from './constants';
...@@ -36,7 +36,7 @@ const ItemByColumn = ({ item, column, isLoading }: Props) => { ...@@ -36,7 +36,7 @@ const ItemByColumn = ({ item, column, isLoading }: Props) => {
case 'method': case 'method':
return item.method ? <Badge loading={ isLoading } truncated>{ item.method }</Badge> : null; return item.method ? <Badge loading={ isLoading } truncated>{ item.method }</Badge> : null;
case 'age': case 'age':
return <TimeAgoWithTooltip timestamp={ item.timestamp } isLoading={ isLoading } color="text.secondary" fontWeight={ 400 }/>; return <TimeWithTooltip timestamp={ item.timestamp } isLoading={ isLoading } color="text.secondary" fontWeight={ 400 }/>;
case 'from': case 'from':
return ( return (
<Flex w="100%"> <Flex w="100%">
......
...@@ -30,7 +30,7 @@ export const TABLE_COLUMNS: Array<TxTableColumn> = [ ...@@ -30,7 +30,7 @@ export const TABLE_COLUMNS: Array<TxTableColumn> = [
{ {
id: 'age', id: 'age',
name: 'Age', name: 'Age',
width: '80px', width: '190px',
}, },
{ {
id: 'from', id: 'from',
......
...@@ -20,7 +20,7 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity'; ...@@ -20,7 +20,7 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile'; import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import Utilization from 'ui/shared/Utilization/Utilization'; import Utilization from 'ui/shared/Utilization/Utilization';
import { getBaseFeeValue } from './utils'; import { getBaseFeeValue } from './utils';
...@@ -57,7 +57,7 @@ const BlocksListItem = ({ data, isLoading, enableTimeIncrement, animation }: Pro ...@@ -57,7 +57,7 @@ const BlocksListItem = ({ data, isLoading, enableTimeIncrement, animation }: Pro
</Tooltip> </Tooltip>
) } ) }
</Flex> </Flex>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ data.timestamp } timestamp={ data.timestamp }
enableIncrement={ enableTimeIncrement } enableIncrement={ enableTimeIncrement }
isLoading={ isLoading } isLoading={ isLoading }
......
...@@ -11,6 +11,7 @@ import { currencyUnits } from 'lib/units'; ...@@ -11,6 +11,7 @@ import { currencyUnits } from 'lib/units';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import BlocksTableItem from 'ui/blocks/BlocksTableItem'; import BlocksTableItem from 'ui/blocks/BlocksTableItem';
import * as SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice'; import * as SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
interface Props { interface Props {
data: Array<Block>; data: Array<Block>;
...@@ -44,10 +45,13 @@ const BlocksTable = ({ data, isLoading, top, page, showSocketInfo, socketInfoNum ...@@ -44,10 +45,13 @@ const BlocksTable = ({ data, isLoading, top, page, showSocketInfo, socketInfoNum
return ( return (
<AddressHighlightProvider> <AddressHighlightProvider>
<TableRoot minWidth="1040px" fontWeight={ 500 }> <TableRoot minWidth="1070px" fontWeight={ 500 }>
<TableHeaderSticky top={ top }> <TableHeaderSticky top={ top }>
<TableRow> <TableRow>
<TableColumnHeader width="150px">Block</TableColumnHeader> <TableColumnHeader width="180px">
Block
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader width="120px">Size, bytes</TableColumnHeader> <TableColumnHeader width="120px">Size, bytes</TableColumnHeader>
{ !config.UI.views.block.hiddenFields?.miner && ( { !config.UI.views.block.hiddenFields?.miner && (
<TableColumnHeader width={ `${ VALIDATOR_COL_WEIGHT / widthBase * 100 }%` } minW="160px"> <TableColumnHeader width={ `${ VALIDATOR_COL_WEIGHT / widthBase * 100 }%` } minW="160px">
......
...@@ -17,7 +17,7 @@ import BlockGasUsed from 'ui/shared/block/BlockGasUsed'; ...@@ -17,7 +17,7 @@ import BlockGasUsed from 'ui/shared/block/BlockGasUsed';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import Utilization from 'ui/shared/Utilization/Utilization'; import Utilization from 'ui/shared/Utilization/Utilization';
import { getBaseFeeValue } from './utils'; import { getBaseFeeValue } from './utils';
...@@ -58,7 +58,7 @@ const BlocksTableItem = ({ data, isLoading, enableTimeIncrement, animation }: Pr ...@@ -58,7 +58,7 @@ const BlocksTableItem = ({ data, isLoading, enableTimeIncrement, animation }: Pr
</span> </span>
</Tooltip> </Tooltip>
</Flex> </Flex>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ data.timestamp } timestamp={ data.timestamp }
enableIncrement={ enableTimeIncrement } enableIncrement={ enableTimeIncrement }
isLoading={ isLoading } isLoading={ isLoading }
......
...@@ -10,7 +10,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; ...@@ -10,7 +10,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid'; import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
...@@ -44,7 +44,7 @@ const OptimisticDepositsListItem = ({ item, isLoading }: Props) => { ...@@ -44,7 +44,7 @@ const OptimisticDepositsListItem = ({ item, isLoading }: Props) => {
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.l1_block_timestamp } timestamp={ item.l1_block_timestamp }
isLoading={ isLoading } isLoading={ isLoading }
display="inline-block" display="inline-block"
......
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import type { OptimisticL2DepositsItem } from 'types/api/optimisticL2'; import type { OptimisticL2DepositsItem } from 'types/api/optimisticL2';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import OptimisticDepositsTableItem from './OptimisticDepositsTableItem'; import OptimisticDepositsTableItem from './OptimisticDepositsTableItem';
...@@ -19,7 +20,10 @@ const OptimisticDepositsTable = ({ items, top, isLoading }: Props) => { ...@@ -19,7 +20,10 @@ const OptimisticDepositsTable = ({ items, top, isLoading }: Props) => {
<TableRow> <TableRow>
<TableColumnHeader>L1 block No</TableColumnHeader> <TableColumnHeader>L1 block No</TableColumnHeader>
<TableColumnHeader>L2 txn hash</TableColumnHeader> <TableColumnHeader>L2 txn hash</TableColumnHeader>
<TableColumnHeader>Age</TableColumnHeader> <TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>L1 txn hash</TableColumnHeader> <TableColumnHeader>L1 txn hash</TableColumnHeader>
<TableColumnHeader>L1 txn origin</TableColumnHeader> <TableColumnHeader>L1 txn origin</TableColumnHeader>
<TableColumnHeader isNumeric>Gas limit</TableColumnHeader> <TableColumnHeader isNumeric>Gas limit</TableColumnHeader>
......
...@@ -10,7 +10,7 @@ import AddressEntityL1 from 'ui/shared/entities/address/AddressEntityL1'; ...@@ -10,7 +10,7 @@ import AddressEntityL1 from 'ui/shared/entities/address/AddressEntityL1';
import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
...@@ -41,7 +41,7 @@ const OptimisticDepositsTableItem = ({ item, isLoading }: Props) => { ...@@ -41,7 +41,7 @@ const OptimisticDepositsTableItem = ({ item, isLoading }: Props) => {
/> />
</TableCell> </TableCell>
<TableCell verticalAlign="middle" pr={ 12 }> <TableCell verticalAlign="middle" pr={ 12 }>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.l1_block_timestamp } timestamp={ item.l1_block_timestamp }
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
......
...@@ -10,7 +10,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; ...@@ -10,7 +10,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid'; import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
...@@ -53,7 +53,7 @@ const ScrollL2DepositsListItem = ({ item, isLoading }: Props) => { ...@@ -53,7 +53,7 @@ const ScrollL2DepositsListItem = ({ item, isLoading }: Props) => {
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.origination_timestamp } timestamp={ item.origination_timestamp }
isLoading={ isLoading } isLoading={ isLoading }
display="inline-block" display="inline-block"
......
...@@ -4,6 +4,7 @@ import type { ScrollL2MessageItem } from 'types/api/scrollL2'; ...@@ -4,6 +4,7 @@ import type { ScrollL2MessageItem } from 'types/api/scrollL2';
import config from 'configs/app'; import config from 'configs/app';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import ScrollL2DepositsTableItem from './ScrollL2DepositsTableItem'; import ScrollL2DepositsTableItem from './ScrollL2DepositsTableItem';
...@@ -21,7 +22,10 @@ const ScrollL2DepositsTable = ({ items, top, isLoading }: Props) => { ...@@ -21,7 +22,10 @@ const ScrollL2DepositsTable = ({ items, top, isLoading }: Props) => {
<TableColumnHeader>L1 block</TableColumnHeader> <TableColumnHeader>L1 block</TableColumnHeader>
<TableColumnHeader>Index</TableColumnHeader> <TableColumnHeader>Index</TableColumnHeader>
<TableColumnHeader>L1 txn hash</TableColumnHeader> <TableColumnHeader>L1 txn hash</TableColumnHeader>
<TableColumnHeader>Age</TableColumnHeader> <TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>L2 txn hash</TableColumnHeader> <TableColumnHeader>L2 txn hash</TableColumnHeader>
<TableColumnHeader isNumeric>Value { config.chain.currency.symbol }</TableColumnHeader> <TableColumnHeader isNumeric>Value { config.chain.currency.symbol }</TableColumnHeader>
</TableRow> </TableRow>
......
...@@ -10,7 +10,7 @@ import { TableCell, TableRow } from 'toolkit/chakra/table'; ...@@ -10,7 +10,7 @@ import { TableCell, TableRow } from 'toolkit/chakra/table';
import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
...@@ -47,7 +47,7 @@ const ScrollL2DepositsTableItem = ({ item, isLoading }: Props) => { ...@@ -47,7 +47,7 @@ const ScrollL2DepositsTableItem = ({ item, isLoading }: Props) => {
/> />
</TableCell> </TableCell>
<TableCell verticalAlign="middle" pr={ 12 }> <TableCell verticalAlign="middle" pr={ 12 }>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.origination_timestamp } timestamp={ item.origination_timestamp }
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
......
...@@ -8,7 +8,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; ...@@ -8,7 +8,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid'; import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const feature = config.features.rollup; const feature = config.features.rollup;
...@@ -64,7 +64,7 @@ const DepositsListItem = ({ item, isLoading }: Props) => { ...@@ -64,7 +64,7 @@ const DepositsListItem = ({ item, isLoading }: Props) => {
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.timestamp } timestamp={ item.timestamp }
isLoading={ isLoading } isLoading={ isLoading }
display="inline-block" display="inline-block"
......
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import type { ShibariumDepositsItem } from 'types/api/shibarium'; import type { ShibariumDepositsItem } from 'types/api/shibarium';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import DepositsTableItem from './DepositsTableItem'; import DepositsTableItem from './DepositsTableItem';
...@@ -21,7 +22,10 @@ const DepositsTable = ({ items, top, isLoading }: Props) => { ...@@ -21,7 +22,10 @@ const DepositsTable = ({ items, top, isLoading }: Props) => {
<TableColumnHeader>L1 txn hash</TableColumnHeader> <TableColumnHeader>L1 txn hash</TableColumnHeader>
<TableColumnHeader>L2 txn hash</TableColumnHeader> <TableColumnHeader>L2 txn hash</TableColumnHeader>
<TableColumnHeader>User</TableColumnHeader> <TableColumnHeader>User</TableColumnHeader>
<TableColumnHeader>Age</TableColumnHeader> <TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
</TableRow> </TableRow>
</TableHeaderSticky> </TableHeaderSticky>
<TableBody> <TableBody>
......
...@@ -8,7 +8,7 @@ import AddressStringOrParam from 'ui/shared/entities/address/AddressStringOrPara ...@@ -8,7 +8,7 @@ import AddressStringOrParam from 'ui/shared/entities/address/AddressStringOrPara
import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const feature = config.features.rollup; const feature = config.features.rollup;
...@@ -55,7 +55,7 @@ const DepositsTableItem = ({ item, isLoading }: Props) => { ...@@ -55,7 +55,7 @@ const DepositsTableItem = ({ item, isLoading }: Props) => {
/> />
</TableCell> </TableCell>
<TableCell verticalAlign="middle" pr={ 12 }> <TableCell verticalAlign="middle" pr={ 12 }>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.timestamp } timestamp={ item.timestamp }
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
......
...@@ -10,7 +10,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; ...@@ -10,7 +10,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid'; import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
...@@ -53,7 +53,7 @@ const ZkEvmL2DepositsListItem = ({ item, isLoading }: Props) => { ...@@ -53,7 +53,7 @@ const ZkEvmL2DepositsListItem = ({ item, isLoading }: Props) => {
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.timestamp } timestamp={ item.timestamp }
isLoading={ isLoading } isLoading={ isLoading }
display="inline-block" display="inline-block"
......
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import type { ZkEvmL2DepositsItem } from 'types/api/zkEvmL2'; import type { ZkEvmL2DepositsItem } from 'types/api/zkEvmL2';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import ZkEvmL2DepositsTableItem from './ZkEvmL2DepositsTableItem'; import ZkEvmL2DepositsTableItem from './ZkEvmL2DepositsTableItem';
...@@ -20,7 +21,10 @@ const ZkEvmL2DepositsTable = ({ items, top, isLoading }: Props) => { ...@@ -20,7 +21,10 @@ const ZkEvmL2DepositsTable = ({ items, top, isLoading }: Props) => {
<TableColumnHeader>L1 block</TableColumnHeader> <TableColumnHeader>L1 block</TableColumnHeader>
<TableColumnHeader>Index</TableColumnHeader> <TableColumnHeader>Index</TableColumnHeader>
<TableColumnHeader>L1 txn hash</TableColumnHeader> <TableColumnHeader>L1 txn hash</TableColumnHeader>
<TableColumnHeader>Age</TableColumnHeader> <TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>L2 txn hash</TableColumnHeader> <TableColumnHeader>L2 txn hash</TableColumnHeader>
<TableColumnHeader isNumeric>Value</TableColumnHeader> <TableColumnHeader isNumeric>Value</TableColumnHeader>
<TableColumnHeader>Token</TableColumnHeader> <TableColumnHeader>Token</TableColumnHeader>
......
...@@ -10,7 +10,7 @@ import { TableCell, TableRow } from 'toolkit/chakra/table'; ...@@ -10,7 +10,7 @@ import { TableCell, TableRow } from 'toolkit/chakra/table';
import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
...@@ -47,7 +47,7 @@ const ZkEvmL2DepositsTableItem = ({ item, isLoading }: Props) => { ...@@ -47,7 +47,7 @@ const ZkEvmL2DepositsTableItem = ({ item, isLoading }: Props) => {
/> />
</TableCell> </TableCell>
<TableCell verticalAlign="middle" pr={ 12 }> <TableCell verticalAlign="middle" pr={ 12 }>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.timestamp } timestamp={ item.timestamp }
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
......
...@@ -8,7 +8,7 @@ import CopyToClipboard from 'ui/shared/CopyToClipboard'; ...@@ -8,7 +8,7 @@ import CopyToClipboard from 'ui/shared/CopyToClipboard';
import BlockEntityL2 from 'ui/shared/entities/block/BlockEntityL2'; import BlockEntityL2 from 'ui/shared/entities/block/BlockEntityL2';
import HashStringShorten from 'ui/shared/HashStringShorten'; import HashStringShorten from 'ui/shared/HashStringShorten';
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid'; import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
...@@ -51,7 +51,7 @@ const OptimisticL2DisputeGamesListItem = ({ item, isLoading }: Props) => { ...@@ -51,7 +51,7 @@ const OptimisticL2DisputeGamesListItem = ({ item, isLoading }: Props) => {
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.created_at } timestamp={ item.created_at }
isLoading={ isLoading } isLoading={ isLoading }
display="inline-block" display="inline-block"
...@@ -66,7 +66,7 @@ const OptimisticL2DisputeGamesListItem = ({ item, isLoading }: Props) => { ...@@ -66,7 +66,7 @@ const OptimisticL2DisputeGamesListItem = ({ item, isLoading }: Props) => {
{ item.resolved_at && ( { item.resolved_at && (
<> <>
<ListItemMobileGrid.Label isLoading={ isLoading }>Resolution age</ListItemMobileGrid.Label><ListItemMobileGrid.Value> <ListItemMobileGrid.Label isLoading={ isLoading }>Resolution age</ListItemMobileGrid.Label><ListItemMobileGrid.Value>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.resolved_at } timestamp={ item.resolved_at }
isLoading={ isLoading } isLoading={ isLoading }
display="inline-block" display="inline-block"
......
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import type { OptimisticL2DisputeGamesItem } from 'types/api/optimisticL2'; import type { OptimisticL2DisputeGamesItem } from 'types/api/optimisticL2';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import OptimisticL2DisputeGamesTableItem from './OptimisticL2DisputeGamesTableItem'; import OptimisticL2DisputeGamesTableItem from './OptimisticL2DisputeGamesTableItem';
...@@ -21,9 +22,15 @@ const OptimisticL2DisputeGamesTable = ({ items, top, isLoading }: Props) => { ...@@ -21,9 +22,15 @@ const OptimisticL2DisputeGamesTable = ({ items, top, isLoading }: Props) => {
<TableColumnHeader>Game type</TableColumnHeader> <TableColumnHeader>Game type</TableColumnHeader>
<TableColumnHeader>Address</TableColumnHeader> <TableColumnHeader>Address</TableColumnHeader>
<TableColumnHeader>L2 block #</TableColumnHeader> <TableColumnHeader>L2 block #</TableColumnHeader>
<TableColumnHeader>Age</TableColumnHeader> <TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>Status</TableColumnHeader> <TableColumnHeader>Status</TableColumnHeader>
<TableColumnHeader>Resolution age</TableColumnHeader> <TableColumnHeader>
Resolved
<TimeFormatToggle/>
</TableColumnHeader>
</TableRow> </TableRow>
</TableHeaderSticky> </TableHeaderSticky>
<TableBody> <TableBody>
......
...@@ -9,7 +9,7 @@ import { TableCell, TableRow } from 'toolkit/chakra/table'; ...@@ -9,7 +9,7 @@ import { TableCell, TableRow } from 'toolkit/chakra/table';
import CopyToClipboard from 'ui/shared/CopyToClipboard'; import CopyToClipboard from 'ui/shared/CopyToClipboard';
import BlockEntityL2 from 'ui/shared/entities/block/BlockEntityL2'; import BlockEntityL2 from 'ui/shared/entities/block/BlockEntityL2';
import HashStringShorten from 'ui/shared/HashStringShorten'; import HashStringShorten from 'ui/shared/HashStringShorten';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const faultProofSystemFeature = config.features.faultProofSystem; const faultProofSystemFeature = config.features.faultProofSystem;
...@@ -44,7 +44,7 @@ const OptimisticL2DisputeGamesTableItem = ({ item, isLoading }: Props) => { ...@@ -44,7 +44,7 @@ const OptimisticL2DisputeGamesTableItem = ({ item, isLoading }: Props) => {
/> />
</TableCell> </TableCell>
<TableCell verticalAlign="middle"> <TableCell verticalAlign="middle">
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.created_at } timestamp={ item.created_at }
isLoading={ isLoading } isLoading={ isLoading }
display="inline-block" display="inline-block"
...@@ -54,7 +54,7 @@ const OptimisticL2DisputeGamesTableItem = ({ item, isLoading }: Props) => { ...@@ -54,7 +54,7 @@ const OptimisticL2DisputeGamesTableItem = ({ item, isLoading }: Props) => {
<Skeleton loading={ isLoading } display="inline-block">{ item.status }</Skeleton> <Skeleton loading={ isLoading } display="inline-block">{ item.status }</Skeleton>
</TableCell> </TableCell>
<TableCell> <TableCell>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.resolved_at } timestamp={ item.resolved_at }
fallbackText="N/A" fallbackText="N/A"
isLoading={ isLoading } isLoading={ isLoading }
......
...@@ -11,7 +11,7 @@ import { Tooltip } from 'toolkit/chakra/tooltip'; ...@@ -11,7 +11,7 @@ import { Tooltip } from 'toolkit/chakra/tooltip';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = { type Props = {
block: Block; block: Block;
...@@ -43,9 +43,10 @@ const LatestBlocksItem = ({ block, isLoading, animation }: Props) => { ...@@ -43,9 +43,10 @@ const LatestBlocksItem = ({ block, isLoading, animation }: Props) => {
<IconSvg name="checkered_flag" boxSize={ 5 } p="1px" ml={ 2 } isLoading={ isLoading } flexShrink={ 0 }/> <IconSvg name="checkered_flag" boxSize={ 5 } p="1px" ml={ 2 } isLoading={ isLoading } flexShrink={ 0 }/>
</Tooltip> </Tooltip>
) } ) }
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ block.timestamp } timestamp={ block.timestamp }
enableIncrement={ !isLoading } enableIncrement={ !isLoading }
timeFormat="relative"
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
display="inline-block" display="inline-block"
......
...@@ -16,7 +16,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton'; ...@@ -16,7 +16,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton';
import AddressFromTo from 'ui/shared/address/AddressFromTo'; import AddressFromTo from 'ui/shared/address/AddressFromTo';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxStatus from 'ui/shared/statusTag/TxStatus'; import TxStatus from 'ui/shared/statusTag/TxStatus';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import TxFee from 'ui/shared/tx/TxFee'; import TxFee from 'ui/shared/tx/TxFee';
import TxWatchListTags from 'ui/shared/tx/TxWatchListTags'; import TxWatchListTags from 'ui/shared/tx/TxWatchListTags';
import TxAdditionalInfo from 'ui/txs/TxAdditionalInfo'; import TxAdditionalInfo from 'ui/txs/TxAdditionalInfo';
...@@ -63,9 +63,10 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => { ...@@ -63,9 +63,10 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
hash={ tx.hash } hash={ tx.hash }
fontWeight="700" fontWeight="700"
/> />
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ tx.timestamp } timestamp={ tx.timestamp }
enableIncrement enableIncrement
timeFormat="relative"
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
textStyle="sm" textStyle="sm"
......
...@@ -15,7 +15,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton'; ...@@ -15,7 +15,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton';
import AddressFromTo from 'ui/shared/address/AddressFromTo'; import AddressFromTo from 'ui/shared/address/AddressFromTo';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxStatus from 'ui/shared/statusTag/TxStatus'; import TxStatus from 'ui/shared/statusTag/TxStatus';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import TxFee from 'ui/shared/tx/TxFee'; import TxFee from 'ui/shared/tx/TxFee';
import TxWatchListTags from 'ui/shared/tx/TxWatchListTags'; import TxWatchListTags from 'ui/shared/tx/TxWatchListTags';
import TxAdditionalInfo from 'ui/txs/TxAdditionalInfo'; import TxAdditionalInfo from 'ui/txs/TxAdditionalInfo';
...@@ -58,9 +58,10 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => { ...@@ -58,9 +58,10 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
fontWeight="700" fontWeight="700"
truncation="constant_long" truncation="constant_long"
/> />
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ tx.timestamp } timestamp={ tx.timestamp }
enableIncrement enableIncrement
timeFormat="relative"
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
fontWeight="400" fontWeight="400"
......
...@@ -6,7 +6,7 @@ import { route } from 'nextjs-routes'; ...@@ -6,7 +6,7 @@ import { route } from 'nextjs-routes';
import { Link } from 'toolkit/chakra/link'; import { Link } from 'toolkit/chakra/link';
import { Skeleton } from 'toolkit/chakra/skeleton'; import { Skeleton } from 'toolkit/chakra/skeleton';
import BatchEntityL2 from 'ui/shared/entities/block/BatchEntityL2'; import BatchEntityL2 from 'ui/shared/entities/block/BatchEntityL2';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = { type Props = {
number: number; number: number;
...@@ -35,9 +35,10 @@ const LatestBatchItem = ({ number, timestamp, txCount, status, isLoading, animat ...@@ -35,9 +35,10 @@ const LatestBatchItem = ({ number, timestamp, txCount, status, isLoading, animat
fontWeight={ 500 } fontWeight={ 500 }
mr="auto" mr="auto"
/> />
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ timestamp } timestamp={ timestamp }
enableIncrement={ !isLoading } enableIncrement={ !isLoading }
timeFormat="relative"
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
display="inline-block" display="inline-block"
......
...@@ -15,7 +15,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; ...@@ -15,7 +15,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice'; import SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type DepositsItem = { type DepositsItem = {
l1BlockNumber: number | null; l1BlockNumber: number | null;
...@@ -89,8 +89,9 @@ const LatestDepositsItem = ({ item, isLoading }: ItemProps) => { ...@@ -89,8 +89,9 @@ const LatestDepositsItem = ({ item, isLoading }: ItemProps) => {
<Flex justifyContent="space-between" alignItems="center" mb={ 1 }> <Flex justifyContent="space-between" alignItems="center" mb={ 1 }>
{ l1BlockLink } { l1BlockLink }
{ item.timestamp ? ( { item.timestamp ? (
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.timestamp } timestamp={ item.timestamp }
timeFormat="relative"
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
/> />
...@@ -118,8 +119,9 @@ const LatestDepositsItem = ({ item, isLoading }: ItemProps) => { ...@@ -118,8 +119,9 @@ const LatestDepositsItem = ({ item, isLoading }: ItemProps) => {
</Skeleton> </Skeleton>
{ l1TxLink } { l1TxLink }
{ item.timestamp ? ( { item.timestamp ? (
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.timestamp } timestamp={ item.timestamp }
timeFormat="relative"
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
w="fit-content" w="fit-content"
......
...@@ -10,7 +10,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton'; ...@@ -10,7 +10,7 @@ import { Skeleton } from 'toolkit/chakra/skeleton';
import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = { type Props = {
l1BlockNumber: number; l1BlockNumber: number;
...@@ -59,8 +59,9 @@ const LatestDepositsItem = ({ l1BlockNumber, l1TxHash, l2TxHash, timestamp, isLo ...@@ -59,8 +59,9 @@ const LatestDepositsItem = ({ l1BlockNumber, l1TxHash, l2TxHash, timestamp, isLo
<> <>
<Flex justifyContent="space-between" alignItems="center" mb={ 1 }> <Flex justifyContent="space-between" alignItems="center" mb={ 1 }>
{ l1BlockLink } { l1BlockLink }
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ timestamp } timestamp={ timestamp }
timeFormat="relative"
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
/> />
...@@ -86,8 +87,9 @@ const LatestDepositsItem = ({ l1BlockNumber, l1TxHash, l2TxHash, timestamp, isLo ...@@ -86,8 +87,9 @@ const LatestDepositsItem = ({ l1BlockNumber, l1TxHash, l2TxHash, timestamp, isLo
L1 txn L1 txn
</Skeleton> </Skeleton>
{ l1TxLink } { l1TxLink }
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ timestamp } timestamp={ timestamp }
timeFormat="relative"
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
w="fit-content" w="fit-content"
......
...@@ -13,7 +13,7 @@ import BlockEntity from 'ui/shared/entities/block/BlockEntity'; ...@@ -13,7 +13,7 @@ import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile'; import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import TxStatus from 'ui/shared/statusTag/TxStatus'; import TxStatus from 'ui/shared/statusTag/TxStatus';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import { TX_INTERNALS_ITEMS } from 'ui/tx/internals/utils'; import { TX_INTERNALS_ITEMS } from 'ui/tx/internals/utils';
type Props = InternalTransaction & { currentAddress?: string; isLoading?: boolean }; type Props = InternalTransaction & { currentAddress?: string; isLoading?: boolean };
...@@ -48,7 +48,7 @@ const InternalTxsListItem = ({ ...@@ -48,7 +48,7 @@ const InternalTxsListItem = ({
fontWeight={ 700 } fontWeight={ 700 }
truncation="constant_long" truncation="constant_long"
/> />
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ timestamp } timestamp={ timestamp }
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
......
...@@ -5,6 +5,7 @@ import type { InternalTransaction } from 'types/api/internalTransaction'; ...@@ -5,6 +5,7 @@ import type { InternalTransaction } from 'types/api/internalTransaction';
import { AddressHighlightProvider } from 'lib/contexts/addressHighlight'; import { AddressHighlightProvider } from 'lib/contexts/addressHighlight';
import { currencyUnits } from 'lib/units'; import { currencyUnits } from 'lib/units';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import InternalTxsTableItem from './InternalTxsTableItem'; import InternalTxsTableItem from './InternalTxsTableItem';
...@@ -20,7 +21,10 @@ const InternalTxsTable = ({ data, currentAddress, isLoading }: Props) => { ...@@ -20,7 +21,10 @@ const InternalTxsTable = ({ data, currentAddress, isLoading }: Props) => {
<TableRoot minW="900px"> <TableRoot minW="900px">
<TableHeaderSticky top={ 68 }> <TableHeaderSticky top={ 68 }>
<TableRow> <TableRow>
<TableColumnHeader width="180px">Parent txn hash</TableColumnHeader> <TableColumnHeader width="280px">
Parent txn hash
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader width="15%">Type</TableColumnHeader> <TableColumnHeader width="15%">Type</TableColumnHeader>
<TableColumnHeader width="15%">Block</TableColumnHeader> <TableColumnHeader width="15%">Block</TableColumnHeader>
<TableColumnHeader width="50%">From/To</TableColumnHeader> <TableColumnHeader width="50%">From/To</TableColumnHeader>
......
...@@ -11,7 +11,7 @@ import AddressFromTo from 'ui/shared/address/AddressFromTo'; ...@@ -11,7 +11,7 @@ import AddressFromTo from 'ui/shared/address/AddressFromTo';
import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxStatus from 'ui/shared/statusTag/TxStatus'; import TxStatus from 'ui/shared/statusTag/TxStatus';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import TruncatedValue from 'ui/shared/TruncatedValue'; import TruncatedValue from 'ui/shared/TruncatedValue';
import { TX_INTERNALS_ITEMS } from 'ui/tx/internals/utils'; import { TX_INTERNALS_ITEMS } from 'ui/tx/internals/utils';
...@@ -45,13 +45,14 @@ const InternalTxsTableItem = ({ ...@@ -45,13 +45,14 @@ const InternalTxsTableItem = ({
noIcon noIcon
truncation="constant_long" truncation="constant_long"
/> />
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ timestamp } timestamp={ timestamp }
enableIncrement enableIncrement
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
fontWeight="400" fontWeight="400"
fontSize="sm" fontSize="sm"
w="fit-content"
/> />
</Flex> </Flex>
</TableCell> </TableCell>
......
...@@ -8,7 +8,7 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity'; ...@@ -8,7 +8,7 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import AddressEntityInterop from 'ui/shared/entities/address/AddressEntityInterop'; import AddressEntityInterop from 'ui/shared/entities/address/AddressEntityInterop';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile'; import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import InteropMessageStatus from 'ui/shared/statusTag/InteropMessageStatus'; import InteropMessageStatus from 'ui/shared/statusTag/InteropMessageStatus';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import InteropMessageAdditionalInfo from './InteropMessageAdditionalInfo'; import InteropMessageAdditionalInfo from './InteropMessageAdditionalInfo';
import InteropMessageDestinationTx from './InteropMessageDestinationTx'; import InteropMessageDestinationTx from './InteropMessageDestinationTx';
...@@ -29,7 +29,7 @@ const InteropMessagesListItem = ({ item, isLoading }: Props) => { ...@@ -29,7 +29,7 @@ const InteropMessagesListItem = ({ item, isLoading }: Props) => {
<Flex alignItems="flex-start" flexDirection="column" gap={ 2 } w="100%"> <Flex alignItems="flex-start" flexDirection="column" gap={ 2 } w="100%">
<HStack w="100%"> <HStack w="100%">
<Text fontWeight={ 500 } flexGrow={ 1 }>#{ item.nonce }</Text> <Text fontWeight={ 500 } flexGrow={ 1 }>#{ item.nonce }</Text>
<TimeAgoWithTooltip timestamp={ item.timestamp } isLoading={ isLoading } color="text.secondary"/> <TimeWithTooltip timestamp={ item.timestamp } isLoading={ isLoading } color="text.secondary"/>
</HStack> </HStack>
<Grid templateColumns="120px 1fr" rowGap={ 2 }> <Grid templateColumns="120px 1fr" rowGap={ 2 }>
<Text as="span" color="text.secondary">Source tx</Text> <Text as="span" color="text.secondary">Source tx</Text>
......
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import type { InteropMessage } from 'types/api/interop'; import type { InteropMessage } from 'types/api/interop';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import InteropMessagesTableItem from './InteropMessagesTableItem'; import InteropMessagesTableItem from './InteropMessagesTableItem';
...@@ -19,7 +20,10 @@ const InteropMessagesTable = ({ items, top, isLoading }: Props) => { ...@@ -19,7 +20,10 @@ const InteropMessagesTable = ({ items, top, isLoading }: Props) => {
<TableRow> <TableRow>
<TableColumnHeader/> <TableColumnHeader/>
<TableColumnHeader>Message</TableColumnHeader> <TableColumnHeader>Message</TableColumnHeader>
<TableColumnHeader>Age</TableColumnHeader> <TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>Status</TableColumnHeader> <TableColumnHeader>Status</TableColumnHeader>
<TableColumnHeader>Source tx</TableColumnHeader> <TableColumnHeader>Source tx</TableColumnHeader>
<TableColumnHeader>Destination tx</TableColumnHeader> <TableColumnHeader>Destination tx</TableColumnHeader>
......
...@@ -8,7 +8,7 @@ import AddressFromToIcon from 'ui/shared/address/AddressFromToIcon'; ...@@ -8,7 +8,7 @@ import AddressFromToIcon from 'ui/shared/address/AddressFromToIcon';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import AddressEntityInterop from 'ui/shared/entities/address/AddressEntityInterop'; import AddressEntityInterop from 'ui/shared/entities/address/AddressEntityInterop';
import InteropMessageStatus from 'ui/shared/statusTag/InteropMessageStatus'; import InteropMessageStatus from 'ui/shared/statusTag/InteropMessageStatus';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import InteropMessageAdditionalInfo from './InteropMessageAdditionalInfo'; import InteropMessageAdditionalInfo from './InteropMessageAdditionalInfo';
import InteropMessageDestinationTx from './InteropMessageDestinationTx'; import InteropMessageDestinationTx from './InteropMessageDestinationTx';
...@@ -31,7 +31,7 @@ const InteropMessagesTableItem = ({ item, isLoading }: Props) => { ...@@ -31,7 +31,7 @@ const InteropMessagesTableItem = ({ item, isLoading }: Props) => {
</Skeleton> </Skeleton>
</TableCell> </TableCell>
<TableCell> <TableCell>
<TimeAgoWithTooltip timestamp={ item.timestamp } isLoading={ isLoading } color="text.secondary"/> <TimeWithTooltip timestamp={ item.timestamp } isLoading={ isLoading } color="text.secondary"/>
</TableCell> </TableCell>
<TableCell> <TableCell>
<InteropMessageStatus status={ item.status } isLoading={ isLoading }/> <InteropMessageStatus status={ item.status } isLoading={ isLoading }/>
......
...@@ -14,7 +14,7 @@ import TxEntity from 'ui/shared/entities/tx/TxEntity'; ...@@ -14,7 +14,7 @@ import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid'; import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
import ArbitrumL2MessageStatus from 'ui/shared/statusTag/ArbitrumL2MessageStatus'; import ArbitrumL2MessageStatus from 'ui/shared/statusTag/ArbitrumL2MessageStatus';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import type { MessagesDirection } from './ArbitrumL2Messages'; import type { MessagesDirection } from './ArbitrumL2Messages';
...@@ -88,7 +88,7 @@ const ArbitrumL2MessagesListItem = ({ item, isLoading, direction }: Props) => { ...@@ -88,7 +88,7 @@ const ArbitrumL2MessagesListItem = ({ item, isLoading, direction }: Props) => {
<> <>
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.origination_timestamp } timestamp={ item.origination_timestamp }
isLoading={ isLoading } isLoading={ isLoading }
display="inline-block" display="inline-block"
......
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import type { ArbitrumL2MessagesItem } from 'types/api/arbitrumL2'; import type { ArbitrumL2MessagesItem } from 'types/api/arbitrumL2';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import type { MessagesDirection } from './ArbitrumL2Messages'; import type { MessagesDirection } from './ArbitrumL2Messages';
import ArbitrumL2MessagesTableItem from './ArbitrumL2MessagesTableItem'; import ArbitrumL2MessagesTableItem from './ArbitrumL2MessagesTableItem';
...@@ -23,7 +24,10 @@ const ArbitrumL2MessagesTable = ({ items, direction, top, isLoading }: Props) => ...@@ -23,7 +24,10 @@ const ArbitrumL2MessagesTable = ({ items, direction, top, isLoading }: Props) =>
{ direction === 'from-rollup' && <TableColumnHeader>From</TableColumnHeader> } { direction === 'from-rollup' && <TableColumnHeader>From</TableColumnHeader> }
<TableColumnHeader>Message #</TableColumnHeader> <TableColumnHeader>Message #</TableColumnHeader>
<TableColumnHeader>L2 transaction</TableColumnHeader> <TableColumnHeader>L2 transaction</TableColumnHeader>
<TableColumnHeader>Age</TableColumnHeader> <TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>Status</TableColumnHeader> <TableColumnHeader>Status</TableColumnHeader>
<TableColumnHeader>L1 transaction</TableColumnHeader> <TableColumnHeader>L1 transaction</TableColumnHeader>
</TableRow> </TableRow>
......
...@@ -14,7 +14,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1'; ...@@ -14,7 +14,7 @@ import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import ArbitrumL2MessageStatus from 'ui/shared/statusTag/ArbitrumL2MessageStatus'; import ArbitrumL2MessageStatus from 'ui/shared/statusTag/ArbitrumL2MessageStatus';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import type { MessagesDirection } from './ArbitrumL2Messages'; import type { MessagesDirection } from './ArbitrumL2Messages';
...@@ -74,7 +74,7 @@ const ArbitrumL2MessagesTableItem = ({ item, direction, isLoading }: Props) => { ...@@ -74,7 +74,7 @@ const ArbitrumL2MessagesTableItem = ({ item, direction, isLoading }: Props) => {
) } ) }
</TableCell> </TableCell>
<TableCell verticalAlign="middle" pr={ 12 }> <TableCell verticalAlign="middle" pr={ 12 }>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.origination_timestamp } timestamp={ item.origination_timestamp }
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
......
...@@ -10,7 +10,7 @@ import { stripTrailingSlash } from 'toolkit/utils/url'; ...@@ -10,7 +10,7 @@ import { stripTrailingSlash } from 'toolkit/utils/url';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid'; import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
interface Props { interface Props {
event: bens.DomainEvent; event: bens.DomainEvent;
...@@ -37,7 +37,7 @@ const NameDomainHistoryListItem = ({ isLoading, domain, event }: Props) => { ...@@ -37,7 +37,7 @@ const NameDomainHistoryListItem = ({ isLoading, domain, event }: Props) => {
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ event.timestamp } timestamp={ event.timestamp }
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
......
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import type * as bens from '@blockscout/bens-types'; import type * as bens from '@blockscout/bens-types';
import { TableBody, TableColumnHeader, TableColumnHeaderSortable, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableColumnHeaderSortable, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import NameDomainHistoryTableItem from './NameDomainHistoryTableItem'; import NameDomainHistoryTableItem from './NameDomainHistoryTableItem';
import type { SortField, Sort } from './utils'; import type { SortField, Sort } from './utils';
...@@ -28,8 +29,9 @@ const NameDomainHistoryTable = ({ history, domain, isLoading, sort, onSortToggle ...@@ -28,8 +29,9 @@ const NameDomainHistoryTable = ({ history, domain, isLoading, sort, onSortToggle
sortField="timestamp" sortField="timestamp"
sortValue={ sort } sortValue={ sort }
onSortToggle={ onSortToggle } onSortToggle={ onSortToggle }
contentAfter={ <TimeFormatToggle/> }
> >
Age Timestamp
</TableColumnHeaderSortable> </TableColumnHeaderSortable>
<TableColumnHeader width="25%">From</TableColumnHeader> <TableColumnHeader width="25%">From</TableColumnHeader>
<TableColumnHeader width="25%">Method</TableColumnHeader> <TableColumnHeader width="25%">Method</TableColumnHeader>
......
...@@ -10,7 +10,7 @@ import { TableCell, TableRow } from 'toolkit/chakra/table'; ...@@ -10,7 +10,7 @@ import { TableCell, TableRow } from 'toolkit/chakra/table';
import { stripTrailingSlash } from 'toolkit/utils/url'; import { stripTrailingSlash } from 'toolkit/utils/url';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
interface Props { interface Props {
event: bens.DomainEvent; event: bens.DomainEvent;
...@@ -41,7 +41,7 @@ const NameDomainHistoryTableItem = ({ isLoading, event, domain }: Props) => { ...@@ -41,7 +41,7 @@ const NameDomainHistoryTableItem = ({ isLoading, event, domain }: Props) => {
/> />
</TableCell> </TableCell>
<TableCell pl={ 9 } verticalAlign="middle"> <TableCell pl={ 9 } verticalAlign="middle">
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ event.timestamp } timestamp={ event.timestamp }
isLoading={ isLoading } isLoading={ isLoading }
color="text.secondary" color="text.secondary"
......
...@@ -4,6 +4,7 @@ import type * as bens from '@blockscout/bens-types'; ...@@ -4,6 +4,7 @@ import type * as bens from '@blockscout/bens-types';
import { TableBody, TableColumnHeader, TableColumnHeaderSortable, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableColumnHeaderSortable, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar'; import { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import NameDomainsTableItem from './NameDomainsTableItem'; import NameDomainsTableItem from './NameDomainsTableItem';
import type { SortField, Sort } from './utils'; import type { SortField, Sort } from './utils';
...@@ -28,10 +29,14 @@ const NameDomainsTable = ({ data, isLoading, sort, onSortToggle }: Props) => { ...@@ -28,10 +29,14 @@ const NameDomainsTable = ({ data, isLoading, sort, onSortToggle }: Props) => {
sortField="registration_date" sortField="registration_date"
sortValue={ sort } sortValue={ sort }
onSortToggle={ onSortToggle } onSortToggle={ onSortToggle }
contentAfter={ <TimeFormatToggle/> }
> >
Registered on Registered
</TableColumnHeaderSortable> </TableColumnHeaderSortable>
<TableColumnHeader width="25%">Expiration date</TableColumnHeader> <TableColumnHeader width="25%">
Expires
<TimeFormatToggle/>
</TableColumnHeader>
</TableRow> </TableRow>
</TableHeaderSticky> </TableHeaderSticky>
<TableBody> <TableBody>
......
import { chakra } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type * as bens from '@blockscout/bens-types'; import type * as bens from '@blockscout/bens-types';
import dayjs from 'lib/date/dayjs'; import dayjs from 'lib/date/dayjs';
import { Skeleton } from 'toolkit/chakra/skeleton';
import { TableCell, TableRow } from 'toolkit/chakra/table'; import { TableCell, TableRow } from 'toolkit/chakra/table';
import NameDomainExpiryStatus from 'ui/nameDomain/NameDomainExpiryStatus';
import AddressEntity from 'ui/shared/entities/address/AddressEntity'; import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import EnsEntity from 'ui/shared/entities/ens/EnsEntity'; import EnsEntity from 'ui/shared/entities/ens/EnsEntity';
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
type Props = bens.Domain & { type Props = bens.Domain & {
isLoading?: boolean; isLoading?: boolean;
...@@ -32,20 +30,14 @@ const NameDomainsTableItem = ({ ...@@ -32,20 +30,14 @@ const NameDomainsTableItem = ({
{ resolvedAddress && <AddressEntity address={ resolvedAddress } isLoading={ isLoading } fontWeight={ 500 }/> } { resolvedAddress && <AddressEntity address={ resolvedAddress } isLoading={ isLoading } fontWeight={ 500 }/> }
</TableCell> </TableCell>
<TableCell verticalAlign="middle" pl={ 9 }> <TableCell verticalAlign="middle" pl={ 9 }>
{ registrationDate && ( <TimeWithTooltip timestamp={ registrationDate } isLoading={ isLoading }/>
<Skeleton loading={ isLoading }>
{ dayjs(registrationDate).format('lll') }
<chakra.span color="text.secondary"> { dayjs(registrationDate).fromNow() }</chakra.span>
</Skeleton>
) }
</TableCell> </TableCell>
<TableCell verticalAlign="middle"> <TableCell verticalAlign="middle">
{ expiryDate && ( <TimeWithTooltip
<Skeleton loading={ isLoading }> timestamp={ expiryDate }
<span>{ dayjs(expiryDate).format('lll') } </span> isLoading={ isLoading }
<NameDomainExpiryStatus date={ expiryDate }/> color={ expiryDate && dayjs(expiryDate).diff(dayjs(), 'day') < 30 ? 'red.600' : 'inherit' }
</Skeleton> />
) }
</TableCell> </TableCell>
</TableRow> </TableRow>
); );
......
...@@ -10,7 +10,7 @@ import BlockEntityL2 from 'ui/shared/entities/block/BlockEntityL2'; ...@@ -10,7 +10,7 @@ import BlockEntityL2 from 'ui/shared/entities/block/BlockEntityL2';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import HashStringShorten from 'ui/shared/HashStringShorten'; import HashStringShorten from 'ui/shared/HashStringShorten';
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid'; import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
...@@ -31,7 +31,7 @@ const OptimisticL2OutputRootsListItem = ({ item, isLoading }: Props) => { ...@@ -31,7 +31,7 @@ const OptimisticL2OutputRootsListItem = ({ item, isLoading }: Props) => {
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label> <ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
<ListItemMobileGrid.Value> <ListItemMobileGrid.Value>
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.l1_timestamp } timestamp={ item.l1_timestamp }
isLoading={ isLoading } isLoading={ isLoading }
display="inline-block" display="inline-block"
......
...@@ -3,6 +3,7 @@ import React from 'react'; ...@@ -3,6 +3,7 @@ import React from 'react';
import type { OptimisticL2OutputRootsItem } from 'types/api/optimisticL2'; import type { OptimisticL2OutputRootsItem } from 'types/api/optimisticL2';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table'; import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import OptimisticL2OutputRootsTableItem from './OptimisticL2OutputRootsTableItem'; import OptimisticL2OutputRootsTableItem from './OptimisticL2OutputRootsTableItem';
...@@ -18,7 +19,10 @@ const OptimisticL2OutputRootsTable = ({ items, top, isLoading }: Props) => { ...@@ -18,7 +19,10 @@ const OptimisticL2OutputRootsTable = ({ items, top, isLoading }: Props) => {
<TableHeaderSticky top={ top }> <TableHeaderSticky top={ top }>
<TableRow> <TableRow>
<TableColumnHeader width="160px">L2 output index</TableColumnHeader> <TableColumnHeader width="160px">L2 output index</TableColumnHeader>
<TableColumnHeader width="20%">Age</TableColumnHeader> <TableColumnHeader width="20%">
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader width="20%">L2 block #</TableColumnHeader> <TableColumnHeader width="20%">L2 block #</TableColumnHeader>
<TableColumnHeader width="30%">L1 txn hash</TableColumnHeader> <TableColumnHeader width="30%">L1 txn hash</TableColumnHeader>
<TableColumnHeader width="30%">Output root</TableColumnHeader> <TableColumnHeader width="30%">Output root</TableColumnHeader>
......
...@@ -10,7 +10,7 @@ import CopyToClipboard from 'ui/shared/CopyToClipboard'; ...@@ -10,7 +10,7 @@ import CopyToClipboard from 'ui/shared/CopyToClipboard';
import BlockEntityL2 from 'ui/shared/entities/block/BlockEntityL2'; import BlockEntityL2 from 'ui/shared/entities/block/BlockEntityL2';
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1'; import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
import HashStringShorten from 'ui/shared/HashStringShorten'; import HashStringShorten from 'ui/shared/HashStringShorten';
import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
...@@ -27,7 +27,7 @@ const OptimisticL2OutputRootsTableItem = ({ item, isLoading }: Props) => { ...@@ -27,7 +27,7 @@ const OptimisticL2OutputRootsTableItem = ({ item, isLoading }: Props) => {
<Skeleton loading={ isLoading } display="inline-block">{ item.l2_output_index }</Skeleton> <Skeleton loading={ isLoading } display="inline-block">{ item.l2_output_index }</Skeleton>
</TableCell> </TableCell>
<TableCell verticalAlign="middle"> <TableCell verticalAlign="middle">
<TimeAgoWithTooltip <TimeWithTooltip
timestamp={ item.l1_timestamp } timestamp={ item.l1_timestamp }
isLoading={ isLoading } isLoading={ isLoading }
display="inline-block" display="inline-block"
......
...@@ -37,6 +37,7 @@ import IconSvg from 'ui/shared/IconSvg'; ...@@ -37,6 +37,7 @@ import IconSvg from 'ui/shared/IconSvg';
import PageTitle from 'ui/shared/Page/PageTitle'; import PageTitle from 'ui/shared/Page/PageTitle';
import Pagination from 'ui/shared/pagination/Pagination'; import Pagination from 'ui/shared/pagination/Pagination';
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages'; import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
const COLUMNS_CHECKED = {} as Record<ColumnsIds, boolean>; const COLUMNS_CHECKED = {} as Record<ColumnsIds, boolean>;
TABLE_COLUMNS.forEach(c => COLUMNS_CHECKED[c.id] = true); TABLE_COLUMNS.forEach(c => COLUMNS_CHECKED[c.id] = true);
...@@ -151,7 +152,12 @@ const AdvancedFilter = () => { ...@@ -151,7 +152,12 @@ const AdvancedFilter = () => {
wordBreak="break-word" wordBreak="break-word"
whiteSpace="normal" whiteSpace="normal"
> >
{ Boolean(column.name) && <chakra.span mr={ 2 } lineHeight="24px">{ column.name }</chakra.span> } { Boolean(column.name) && (
<chakra.span mr={ 2 } lineHeight="24px" verticalAlign="middle">
{ column.id === 'age' ? 'Timestamp' : column.name }
</chakra.span>
) }
{ column.id === 'age' && <TimeFormatToggle ml={ 0 } mr={ 1 } verticalAlign="middle"/> }
<FilterByColumn <FilterByColumn
column={ column.id } column={ column.id }
columnName={ column.name } columnName={ column.name }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment