Typedef component

This commit is contained in:
Willian Mitsuda 2021-11-06 05:04:50 -03:00
parent fd3173c3a6
commit 9954c8ac02
2 changed files with 9 additions and 9 deletions

View File

@ -6,7 +6,7 @@ import { TransactionData } from "../../types";
import { ResolvedAddresses } from "../../api/address-resolver"; import { ResolvedAddresses } from "../../api/address-resolver";
type AddressDecoderProps = { type AddressDecoderProps = {
r: any; r: string;
txData: TransactionData; txData: TransactionData;
resolvedAddresses?: ResolvedAddresses | undefined; resolvedAddresses?: ResolvedAddresses | undefined;
}; };
@ -17,17 +17,17 @@ const AddressDecoder: React.FC<AddressDecoderProps> = ({
resolvedAddresses, resolvedAddresses,
}) => ( }) => (
<div className="flex items-baseline space-x-2 -ml-1 mr-3"> <div className="flex items-baseline space-x-2 -ml-1 mr-3">
<AddressHighlighter address={r.toString()}> <AddressHighlighter address={r}>
<DecoratedAddressLink <DecoratedAddressLink
address={r.toString()} address={r}
miner={r.toString() === txData.confirmedData?.miner} miner={r === txData.confirmedData?.miner}
txFrom={r.toString() === txData.from} txFrom={r === txData.from}
txTo={r.toString() === txData.to} txTo={r === txData.to}
resolvedAddresses={resolvedAddresses} resolvedAddresses={resolvedAddresses}
/> />
</AddressHighlighter> </AddressHighlighter>
<Copy value={r.toString()} /> <Copy value={r} />
</div> </div>
); );
export default React.memo(AddressDecoder); export default AddressDecoder;

View File

@ -76,7 +76,7 @@ const DecodedParamRow: React.FC<DecodedParamRowProps> = ({
<Uint256Decoder r={r} /> <Uint256Decoder r={r} />
) : paramType.baseType === "address" ? ( ) : paramType.baseType === "address" ? (
<AddressDecoder <AddressDecoder
r={r} r={r.toString()}
txData={txData} txData={txData}
resolvedAddresses={resolvedAddresses} resolvedAddresses={resolvedAddresses}
/> />