Files
enochleeandGitHub 4c78f91771 display copy button for tx hashes in relevant components (#3031)
* default TxEntity.noCopy to false
remove redundant noCopy=false
restore noCopy for tx hashes in this components

This commit has no essential change, order than defaulting noCopy for TxEntity to false, and reversing the use of the prop

* To reflect new default of TxEntity and UserOpEntity

Updated tests to with-no-copy from with-copy
remove outdated screenshots
Regenerate screenshot for new default

* display copy button for tx hash

In the following pages:
/txs, /internal-txs
/token-transfers
/address/txs, /address/token-transfers(tab)
/deposits, /withdrawals
/batches[id]/txs(tab)
/advanced-filter

* update snapshots

* update snapshots
2025-10-21 17:28:01 +02:00

70 lines
2.0 KiB
TypeScript

import React from 'react';
import type { ShibariumWithdrawalsItem } from 'types/api/shibarium';
import config from 'configs/app';
import { TableCell, TableRow } from 'toolkit/chakra/table';
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 TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
const feature = config.features.rollup;
type Props = { item: ShibariumWithdrawalsItem; isLoading?: boolean };
const WithdrawalsTableItem = ({ item, isLoading }: Props) => {
if (!(feature.isEnabled && feature.type === 'shibarium')) {
return null;
}
return (
<TableRow>
<TableCell verticalAlign="middle">
<BlockEntity
number={ item.l2_block_number }
isLoading={ isLoading }
textStyle="sm"
fontWeight={ 600 }
/>
</TableCell>
<TableCell verticalAlign="middle">
<TxEntity
isLoading={ isLoading }
hash={ item.l2_transaction_hash }
textStyle="sm"
truncation="constant_long"
/>
</TableCell>
<TableCell verticalAlign="middle">
<TxEntityL1
isLoading={ isLoading }
hash={ item.l1_transaction_hash }
truncation="constant_long"
textStyle="sm"
noCopy
/>
</TableCell>
<TableCell verticalAlign="middle">
<AddressStringOrParam
address={ item.user }
isLoading={ isLoading }
truncation="constant"
noCopy
/>
</TableCell>
<TableCell verticalAlign="middle" pr={ 12 }>
<TimeWithTooltip
timestamp={ item.timestamp }
isLoading={ isLoading }
display="inline-block"
color="text.secondary"
/>
</TableCell>
</TableRow>
);
};
export default WithdrawalsTableItem;