diff --git a/src/TokenTransferItem.tsx b/src/TokenTransferItem.tsx index 286d43f..83c5e81 100644 --- a/src/TokenTransferItem.tsx +++ b/src/TokenTransferItem.tsx @@ -3,17 +3,23 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCaretRight } from "@fortawesome/free-solid-svg-icons"; import AddressHighlighter from "./components/AddressHighlighter"; import DecoratedAddressLink from "./components/DecoratedAddressLink"; -import TokenLogo from "./components/TokenLogo"; import FormattedBalance from "./components/FormattedBalance"; -import { AddressContext, TokenMetas, TokenTransfer } from "./types"; +import { + AddressContext, + TokenMetas, + TokenTransfer, + TransactionData, +} from "./types"; type TokenTransferItemProps = { t: TokenTransfer; + txData: TransactionData; tokenMetas: TokenMetas; }; const TokenTransferItem: React.FC = ({ t, + txData, tokenMetas, }) => (
@@ -27,13 +33,20 @@ const TokenTransferItem: React.FC = ({
To - +
@@ -44,23 +57,17 @@ const TokenTransferItem: React.FC = ({ decimals={tokenMetas[t.token].decimals} /> - - {tokenMetas[t.token] ? ( - <> -
- -
- - - ) : ( - - )} -
+ + +
diff --git a/src/components/DecoratedAddressLink.tsx b/src/components/DecoratedAddressLink.tsx index 9dcd416..6d58bf5 100644 --- a/src/components/DecoratedAddressLink.tsx +++ b/src/components/DecoratedAddressLink.tsx @@ -5,8 +5,9 @@ import { faBurn, faCoins, } from "@fortawesome/free-solid-svg-icons"; +import TokenLogo from "./TokenLogo"; import AddressOrENSName from "./AddressOrENSName"; -import { AddressContext, ZERO_ADDRESS } from "../types"; +import { AddressContext, TokenMeta, ZERO_ADDRESS } from "../types"; type DecoratedAddressLinkProps = { address: string; @@ -16,6 +17,9 @@ type DecoratedAddressLinkProps = { addressCtx?: AddressContext; miner?: boolean; selfDestruct?: boolean; + txFrom?: boolean; + txTo?: boolean; + tokenMeta?: TokenMeta; }; const DecoratedAddresssLink: React.FC = ({ @@ -26,17 +30,20 @@ const DecoratedAddresssLink: React.FC = ({ addressCtx, miner, selfDestruct, + txFrom, + txTo, + tokenMeta, }) => { const mint = addressCtx === AddressContext.FROM && address === ZERO_ADDRESS; const burn = addressCtx === AddressContext.TO && address === ZERO_ADDRESS; return (
{mint && ( @@ -53,6 +60,11 @@ const DecoratedAddresssLink: React.FC = ({ )} + {tokenMeta && ( +
+ +
+ )} = ({ fromMiner ? "rounded px-2 py-1 bg-yellow-100" : "" }`} > - +
@@ -45,7 +50,12 @@ const InternalTransfer: React.FC = ({ toMiner ? "rounded px-2 py-1 bg-yellow-100" : "" }`} > - + diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 441226a..cba7a9a 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -68,6 +68,7 @@ const Details: React.FC = ({ @@ -79,6 +80,7 @@ const Details: React.FC = ({ @@ -101,7 +103,12 @@ const Details: React.FC = ({
{txData.tokenTransfers.map((t, i) => ( - + ))}
diff --git a/src/transaction/Logs.tsx b/src/transaction/Logs.tsx index bf101fb..f965ecc 100644 --- a/src/transaction/Logs.tsx +++ b/src/transaction/Logs.tsx @@ -1,6 +1,6 @@ import React from "react"; import ContentFrame from "../ContentFrame"; -import AddressOrENSName from "../components/AddressOrENSName"; +import DecoratedAddressLink from "../components/DecoratedAddressLink"; import { TransactionData } from "../types"; type LogsProps = { @@ -22,7 +22,12 @@ const Logs: React.FC = ({ txData }) => (
Address
- +
{l.topics.map((t, i) => ( diff --git a/src/useSelection.ts b/src/useSelection.ts index ed66746..a02f1fe 100644 --- a/src/useSelection.ts +++ b/src/useSelection.ts @@ -1,7 +1,7 @@ import React, { useState, useContext } from "react"; export type Selection = { - type: string; + type: "address"; content: string; };