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
80 lines
2.6 KiB
TypeScript
80 lines
2.6 KiB
TypeScript
import React from 'react';
|
|
|
|
import type { ShibariumWithdrawalsItem } from 'types/api/shibarium';
|
|
|
|
import config from 'configs/app';
|
|
import { layerLabels } from 'lib/rollups/utils';
|
|
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 TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
|
|
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
|
|
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
|
|
|
|
const feature = config.features.rollup;
|
|
|
|
type Props = { item: ShibariumWithdrawalsItem; isLoading?: boolean };
|
|
|
|
const WithdrawalsListItem = ({ item, isLoading }: Props) => {
|
|
if (!(feature.isEnabled && feature.type === 'shibarium')) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<ListItemMobileGrid.Container>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>{ layerLabels.current } block No</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<BlockEntity
|
|
number={ item.l2_block_number }
|
|
isLoading={ isLoading }
|
|
textStyle="sm"
|
|
fontWeight={ 600 }
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>{ layerLabels.current } txn hash</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<TxEntity
|
|
isLoading={ isLoading }
|
|
hash={ item.l2_transaction_hash }
|
|
textStyle="sm"
|
|
truncation="constant_long"
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>{ layerLabels.parent } txn hash</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<TxEntityL1
|
|
isLoading={ isLoading }
|
|
hash={ item.l1_transaction_hash }
|
|
textStyle="sm"
|
|
truncation="constant_long"
|
|
noCopy
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>User</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<AddressStringOrParam
|
|
address={ item.user }
|
|
isLoading={ isLoading }
|
|
noCopy
|
|
truncation="constant"
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<TimeWithTooltip
|
|
timestamp={ item.timestamp }
|
|
isLoading={ isLoading }
|
|
display="inline-block"
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
</ListItemMobileGrid.Container>
|
|
);
|
|
};
|
|
|
|
export default WithdrawalsListItem;
|