Add EOA decoration

This commit is contained in:
Willian Mitsuda 2022-02-27 13:54:20 -03:00
parent b985eb6d75
commit 8f78380521
1 changed files with 18 additions and 0 deletions

View File

@ -24,6 +24,7 @@ type DecoratedAddressLinkProps = {
txFrom?: boolean | undefined; txFrom?: boolean | undefined;
txTo?: boolean | undefined; txTo?: boolean | undefined;
metadata?: Metadata | null | undefined; metadata?: Metadata | null | undefined;
eoa?: boolean | undefined;
}; };
const DecoratedAddressLink: React.FC<DecoratedAddressLinkProps> = ({ const DecoratedAddressLink: React.FC<DecoratedAddressLinkProps> = ({
@ -36,6 +37,7 @@ const DecoratedAddressLink: React.FC<DecoratedAddressLinkProps> = ({
txFrom, txFrom,
txTo, txTo,
metadata, metadata,
eoa,
}) => { }) => {
const mint = addressCtx === AddressContext.FROM && address === ZERO_ADDRESS; const mint = addressCtx === AddressContext.FROM && address === ZERO_ADDRESS;
const burn = addressCtx === AddressContext.TO && address === ZERO_ADDRESS; const burn = addressCtx === AddressContext.TO && address === ZERO_ADDRESS;
@ -88,6 +90,22 @@ const DecoratedAddressLink: React.FC<DecoratedAddressLinkProps> = ({
selectedAddress={selectedAddress} selectedAddress={selectedAddress}
dontOverrideColors={mint || burn} dontOverrideColors={mint || burn}
/> />
{eoa === true && (
<span
className="text-xs text-gray-400 text-opacity-70"
title="Externally owned account"
>
(EOA)
</span>
)}
{eoa === false && (
<span
className="text-xs text-gray-400 text-opacity-70"
title="Contract account"
>
(C)
</span>
)}
</div> </div>
); );
}; };