diff --git a/src/transaction/TraceItem.tsx b/src/transaction/TraceItem.tsx index b4b2fbd..14e2afc 100644 --- a/src/transaction/TraceItem.tsx +++ b/src/transaction/TraceItem.tsx @@ -1,4 +1,8 @@ -import React from "react"; +import React, { useState } from "react"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faPlusSquare } from "@fortawesome/free-regular-svg-icons/faPlusSquare"; +import { faMinusSquare } from "@fortawesome/free-regular-svg-icons/faMinusSquare"; +import { Switch } from "@headlessui/react"; import AddressHighlighter from "../components/AddressHighlighter"; import DecoratedAddressLink from "../components/DecoratedAddressLink"; import FormattedBalance from "../components/FormattedBalance"; @@ -23,6 +27,7 @@ const TraceItem: React.FC = ({ fourBytesMap, resolvedAddresses, }) => { + const [expanded, setExpanded] = useState(true); const raw4Bytes = extract4Bytes(t.input); const sigText = raw4Bytes === null @@ -31,11 +36,23 @@ const TraceItem: React.FC = ({ return ( <> -
+
{!last && (
)} + {t.children && ( + + + + )}
{t.type} @@ -61,7 +78,7 @@ const TraceItem: React.FC = ({
- {t.children && ( + {expanded && t.children && (
{t.children.map((tc, i, a) => (