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

54 lines
1.9 KiB
TypeScript

import { Grid } from '@chakra-ui/react';
import React from 'react';
import type { CctxListItem } from '@blockscout/zetachain-cctx-types';
import { SECOND } from 'toolkit/utils/consts';
import AddressFromTo from 'ui/shared/address/AddressFromTo';
import TxEntityZetaChainCC from 'ui/shared/entities/tx/TxEntityZetaChainCC';
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import ZetaChainCCTXReducedStatus from 'ui/shared/zetaChain/ZetaChainCCTXReducedStatus';
import ZetaChainCCTXValue from 'ui/shared/zetaChain/ZetaChainCCTXValue';
type Props = {
tx: CctxListItem;
isLoading?: boolean;
animation?: string;
};
const LatestZetaChainCCTXItem = ({ tx, isLoading, animation }: Props) => {
return (
<Grid
gridTemplateColumns="18px 120px 80px 350px auto"
gridGap={ 3 }
width="100%"
minW="740px"
borderBottom="1px solid"
borderColor="border.divider"
alignItems="center"
p={ 4 }
fontSize="sm"
animation={ animation }
>
<ZetaChainCCTXReducedStatus status={ tx.status_reduced } isLoading={ isLoading }/>
<TxEntityZetaChainCC truncation="constant" hash={ tx.index } isLoading={ isLoading } fontWeight={ 600 }/>
<TimeWithTooltip color="text.secondary" timestamp={ Number(tx.last_update_timestamp) * SECOND } isLoading={ isLoading } timeFormat="relative"/>
<AddressFromTo
from={{ hash: tx.sender_address, chainId: tx.source_chain_id.toString(), chainType: 'zeta' }}
to={{ hash: tx.receiver_address, chainId: tx.target_chain_id.toString(), chainType: 'zeta' }}
isLoading={ isLoading }
/>
<ZetaChainCCTXValue
coinType={ tx.coin_type }
tokenSymbol={ tx.token_symbol }
amount={ tx.amount }
decimals={ tx.decimals }
isLoading={ isLoading }
/>
</Grid>
);
};
export default React.memo(LatestZetaChainCCTXItem);