Remove unnecessary parameter

This commit is contained in:
Willian Mitsuda 2022-03-25 21:40:54 -03:00
parent 4b85cc8cd5
commit 247596e58a
3 changed files with 14 additions and 26 deletions

View File

@ -24,12 +24,7 @@ const Trace: React.FC<TraceProps> = ({ txData }) => {
</div>
<div className="ml-5 space-y-3 self-stretch">
{traces.map((t, i, a) => (
<TraceItem
key={i}
t={t}
last={i === a.length - 1}
txData={txData}
/>
<TraceItem key={i} t={t} last={i === a.length - 1} />
))}
</div>
</>

View File

@ -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<TraceInputProps> = ({ t, txData }) => {
const TraceInput: React.FC<TraceInputProps> = ({ t }) => {
const { nativeSymbol } = useChainInfo();
const raw4Bytes = extract4Bytes(t.input);
const fourBytes = use4Bytes(raw4Bytes);

View File

@ -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<TraceItemProps> = ({ t, last, txData }) => {
const TraceItem: React.FC<TraceItemProps> = ({ t, last }) => {
const [expanded, setExpanded] = useState<boolean>(true);
return (
@ -35,7 +33,7 @@ const TraceItem: React.FC<TraceItemProps> = ({ t, last, txData }) => {
/>
</Switch>
)}
<TraceInput t={t} txData={txData} />
<TraceInput t={t} />
</div>
{t.children && (
<div
@ -43,7 +41,7 @@ const TraceItem: React.FC<TraceItemProps> = ({ t, last, txData }) => {
expanded ? "" : "hidden"
}`}
>
<TraceChildren c={t.children} txData={txData} />
<TraceChildren c={t.children} />
</div>
)}
</>
@ -52,19 +50,16 @@ const TraceItem: React.FC<TraceItemProps> = ({ t, last, txData }) => {
type TraceChildrenProps = {
c: TraceGroup[];
txData: TransactionData;
};
const TraceChildren: React.FC<TraceChildrenProps> = React.memo(
({ c, txData }) => {
const TraceChildren: React.FC<TraceChildrenProps> = React.memo(({ c }) => {
return (
<>
{c.map((tc, i, a) => (
<TraceItem key={i} t={tc} last={i === a.length - 1} txData={txData} />
<TraceItem key={i} t={tc} last={i === a.length - 1} />
))}
</>
);
}
);
});
export default TraceItem;