From 247596e58a64e3c52dd57fd510075e2690f6caa6 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Fri, 25 Mar 2022 21:40:54 -0300 Subject: [PATCH] Remove unnecessary parameter --- src/transaction/Trace.tsx | 7 +------ src/transaction/TraceInput.tsx | 4 +--- src/transaction/TraceItem.tsx | 29 ++++++++++++----------------- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/transaction/Trace.tsx b/src/transaction/Trace.tsx index 5a2a4f9..a04bcdb 100644 --- a/src/transaction/Trace.tsx +++ b/src/transaction/Trace.tsx @@ -24,12 +24,7 @@ const Trace: React.FC = ({ txData }) => {
{traces.map((t, i, a) => ( - + ))}
diff --git a/src/transaction/TraceInput.tsx b/src/transaction/TraceInput.tsx index 2ae54e9..c21adfc 100644 --- a/src/transaction/TraceInput.tsx +++ b/src/transaction/TraceInput.tsx @@ -13,14 +13,12 @@ import { useTransactionDescription, } from "../use4Bytes"; import { useChainInfo } from "../useChainInfo"; -import { TransactionData } from "../types"; type TraceInputProps = { t: TraceEntry; - txData: TransactionData; }; -const TraceInput: React.FC = ({ t, txData }) => { +const TraceInput: React.FC = ({ t }) => { const { nativeSymbol } = useChainInfo(); const raw4Bytes = extract4Bytes(t.input); const fourBytes = use4Bytes(raw4Bytes); diff --git a/src/transaction/TraceItem.tsx b/src/transaction/TraceItem.tsx index 5dd4a3d..d6a4d7d 100644 --- a/src/transaction/TraceItem.tsx +++ b/src/transaction/TraceItem.tsx @@ -5,15 +5,13 @@ import { faMinusSquare } from "@fortawesome/free-regular-svg-icons/faMinusSquare import { Switch } from "@headlessui/react"; import { TraceGroup } from "../useErigonHooks"; import TraceInput from "./TraceInput"; -import { TransactionData } from "../types"; type TraceItemProps = { t: TraceGroup; last: boolean; - txData: TransactionData; }; -const TraceItem: React.FC = ({ t, last, txData }) => { +const TraceItem: React.FC = ({ t, last }) => { const [expanded, setExpanded] = useState(true); return ( @@ -35,7 +33,7 @@ const TraceItem: React.FC = ({ t, last, txData }) => { /> )} - + {t.children && (
= ({ t, last, txData }) => { expanded ? "" : "hidden" }`} > - +
)} @@ -52,19 +50,16 @@ const TraceItem: React.FC = ({ t, last, txData }) => { type TraceChildrenProps = { c: TraceGroup[]; - txData: TransactionData; }; -const TraceChildren: React.FC = React.memo( - ({ c, txData }) => { - return ( - <> - {c.map((tc, i, a) => ( - - ))} - - ); - } -); +const TraceChildren: React.FC = React.memo(({ c }) => { + return ( + <> + {c.map((tc, i, a) => ( + + ))} + + ); +}); export default TraceItem;