mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* Rollups: move layer numbering to the ENV Resolves #2554 * fix review comments
85 lines
3.1 KiB
TypeScript
85 lines
3.1 KiB
TypeScript
import BigNumber from 'bignumber.js';
|
|
import React from 'react';
|
|
|
|
import type { OptimisticL2DepositsItem } from 'types/api/optimisticL2';
|
|
|
|
import config from 'configs/app';
|
|
import { layerLabels } from 'lib/rollups/utils';
|
|
import { Skeleton } from 'toolkit/chakra/skeleton';
|
|
import AddressEntityL1 from 'ui/shared/entities/address/AddressEntityL1';
|
|
import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
|
|
import TxEntity from 'ui/shared/entities/tx/TxEntity';
|
|
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
|
|
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
|
|
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
|
|
|
|
const rollupFeature = config.features.rollup;
|
|
|
|
type Props = { item: OptimisticL2DepositsItem; isLoading?: boolean };
|
|
|
|
const OptimisticDepositsListItem = ({ item, isLoading }: Props) => {
|
|
if (!rollupFeature.isEnabled || rollupFeature.type !== 'optimistic') {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<ListItemMobileGrid.Container>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>{ layerLabels.parent } block No</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<BlockEntityL1
|
|
number={ item.l1_block_number }
|
|
isLoading={ isLoading }
|
|
fontWeight={ 600 }
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>{ layerLabels.current } txn hash</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<TxEntity
|
|
isLoading={ isLoading }
|
|
hash={ item.l2_transaction_hash }
|
|
truncation="constant_long"
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<TimeWithTooltip
|
|
timestamp={ item.l1_block_timestamp }
|
|
isLoading={ isLoading }
|
|
display="inline-block"
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>{ layerLabels.parent } txn hash</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<TxEntityL1
|
|
isLoading={ isLoading }
|
|
hash={ item.l1_transaction_hash }
|
|
truncation="constant_long"
|
|
noCopy
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>{ layerLabels.parent } txn origin</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<AddressEntityL1
|
|
address={{ hash: item.l1_transaction_origin, name: '', is_contract: false, is_verified: false, ens_domain_name: null, implementations: null }}
|
|
isLoading={ isLoading }
|
|
noCopy
|
|
truncation="constant"
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Gas limit</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<Skeleton loading={ isLoading } display="inline-block">{ BigNumber(item.l2_transaction_gas_limit).toFormat() }</Skeleton>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
</ListItemMobileGrid.Container>
|
|
);
|
|
};
|
|
|
|
export default OptimisticDepositsListItem;
|