Files
explore/ui/interopMessages/InteropMessageSourceTx.tsx
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

44 lines
1.0 KiB
TypeScript

import React from 'react';
import type { ChainInfo } from 'types/api/interop';
import type { EntityProps } from 'ui/shared/entities/tx/TxEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity';
import TxEntityInterop from 'ui/shared/entities/tx/TxEntityInterop';
type Props = {
init_transaction_hash?: string | null;
init_chain?: ChainInfo | null;
isLoading?: boolean;
truncation?: EntityProps['truncation'];
};
const InteropMessageSourceTx = (props: Props) => {
if (props.init_chain !== undefined) {
return (
<TxEntityInterop
chain={ props.init_chain }
hash={ props.init_transaction_hash }
isLoading={ props.isLoading }
truncation={ props.truncation || 'constant' }
noCopy
/>
);
}
if (!props.init_transaction_hash) {
return 'N/A';
}
return (
<TxEntity
hash={ props.init_transaction_hash }
isLoading={ props.isLoading }
noIcon
truncation={ props.truncation || 'constant' }
noCopy
/>
);
};
export default InteropMessageSourceTx;