Replace by TransactionAddress component

This commit is contained in:
Willian Mitsuda 2021-11-18 16:01:11 -03:00
parent 454f785878
commit 2e586789a4
2 changed files with 6 additions and 12 deletions

View File

@ -1,19 +1,18 @@
import React from "react"; import React from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faAngleRight } from "@fortawesome/free-solid-svg-icons/faAngleRight"; import { faAngleRight } from "@fortawesome/free-solid-svg-icons/faAngleRight";
import TransactionAddress from "./TransactionAddress";
import AddressHighlighter from "./AddressHighlighter"; import AddressHighlighter from "./AddressHighlighter";
import DecoratedAddressLink from "./DecoratedAddressLink"; import DecoratedAddressLink from "./DecoratedAddressLink";
import { TransactionData, InternalOperation } from "../types"; import { InternalOperation } from "../types";
import { ResolvedAddresses } from "../api/address-resolver"; import { ResolvedAddresses } from "../api/address-resolver";
type InternalCreateProps = { type InternalCreateProps = {
txData: TransactionData;
internalOp: InternalOperation; internalOp: InternalOperation;
resolvedAddresses: ResolvedAddresses | undefined; resolvedAddresses: ResolvedAddresses | undefined;
}; };
const InternalCreate: React.FC<InternalCreateProps> = ({ const InternalCreate: React.FC<InternalCreateProps> = ({
txData,
internalOp, internalOp,
resolvedAddresses, resolvedAddresses,
}) => ( }) => (
@ -33,14 +32,10 @@ const InternalCreate: React.FC<InternalCreateProps> = ({
</div> </div>
<span className="flex items-baseline text-gray-400"> <span className="flex items-baseline text-gray-400">
(Creator:{" "} (Creator:{" "}
<AddressHighlighter address={internalOp.from}> <TransactionAddress
<DecoratedAddressLink
address={internalOp.from} address={internalOp.from}
txFrom={internalOp.from === txData.from}
txTo={internalOp.from === txData.to}
resolvedAddresses={resolvedAddresses} resolvedAddresses={resolvedAddresses}
/> />
</AddressHighlighter>
) )
</span> </span>
</div> </div>

View File

@ -31,7 +31,6 @@ const InternalTransactionOperation: React.FC<InternalTransactionOperationProps>
{(internalOp.type === OperationType.CREATE || {(internalOp.type === OperationType.CREATE ||
internalOp.type === OperationType.CREATE2) && ( internalOp.type === OperationType.CREATE2) && (
<InternalCreate <InternalCreate
txData={txData}
internalOp={internalOp} internalOp={internalOp}
resolvedAddresses={resolvedAddresses} resolvedAddresses={resolvedAddresses}
/> />