mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +00:00
* 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
97 lines
3.2 KiB
TypeScript
97 lines
3.2 KiB
TypeScript
import React from 'react';
|
|
|
|
import type { UserOpsItem } from 'types/api/userOps';
|
|
|
|
import config from 'configs/app';
|
|
import CurrencyValue from 'ui/shared/CurrencyValue';
|
|
import AddressStringOrParam from 'ui/shared/entities/address/AddressStringOrParam';
|
|
import BlockEntity from 'ui/shared/entities/block/BlockEntity';
|
|
import TxEntity from 'ui/shared/entities/tx/TxEntity';
|
|
import UserOpEntity from 'ui/shared/entities/userOp/UserOpEntity';
|
|
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
|
|
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
|
|
import UserOpStatus from 'ui/shared/userOps/UserOpStatus';
|
|
|
|
type Props = {
|
|
item: UserOpsItem;
|
|
isLoading?: boolean;
|
|
showTx: boolean;
|
|
showSender: boolean;
|
|
};
|
|
|
|
const UserOpsListItem = ({ item, isLoading, showTx, showSender }: Props) => {
|
|
return (
|
|
<ListItemMobileGrid.Container gridTemplateColumns="100px auto">
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>User op hash</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<UserOpEntity hash={ item.hash } isLoading={ isLoading } fontWeight="700" noIcon truncation="constant_long"/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<TimeWithTooltip
|
|
timestamp={ item.timestamp }
|
|
isLoading={ isLoading }
|
|
color="text.secondary"
|
|
display="inline-block"
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Status</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<UserOpStatus status={ item.status } isLoading={ isLoading }/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
{ showSender && (
|
|
<>
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Sender</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<AddressStringOrParam
|
|
address={ item.address }
|
|
isLoading={ isLoading }
|
|
truncation="constant"
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
</>
|
|
) }
|
|
|
|
{ showTx && (
|
|
<>
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Tx hash</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<TxEntity
|
|
hash={ item.transaction_hash }
|
|
isLoading={ isLoading }
|
|
noIcon
|
|
truncation="constant_long"
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
</>
|
|
) }
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Block</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<BlockEntity
|
|
number={ Number(item.block_number) }
|
|
isLoading={ isLoading }
|
|
textStyle="sm"
|
|
noIcon
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
{ !config.UI.views.tx.hiddenFields?.tx_fee && (
|
|
<>
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Fee</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<CurrencyValue value={ item.fee } isLoading={ isLoading } accuracy={ 8 } currency={ config.chain.currency.symbol }/>
|
|
</ListItemMobileGrid.Value>
|
|
</>
|
|
) }
|
|
|
|
</ListItemMobileGrid.Container>
|
|
);
|
|
};
|
|
|
|
export default UserOpsListItem;
|