From 25f821548e0d2b9b2e2c962ed418458b2448313d Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 8 Nov 2021 07:49:30 -0300 Subject: [PATCH 1/2] Extract InputDecoder component --- src/transaction/Details.tsx | 56 ++++-------------- src/transaction/decoder/InputDecoder.tsx | 75 ++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 45 deletions(-) create mode 100644 src/transaction/decoder/InputDecoder.tsx diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 3df374a..b6246b2 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -6,7 +6,6 @@ import { } from "@ethersproject/abi"; import { BigNumber } from "@ethersproject/bignumber"; import { toUtf8String } from "@ethersproject/strings"; -import { Tab } from "@headlessui/react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCheckCircle } from "@fortawesome/free-solid-svg-icons/faCheckCircle"; import { faCube } from "@fortawesome/free-solid-svg-icons/faCube"; @@ -33,8 +32,7 @@ import PercentageBar from "../components/PercentageBar"; import ExternalLink from "../components/ExternalLink"; import RelativePosition from "../components/RelativePosition"; import PercentagePosition from "../components/PercentagePosition"; -import ModeTab from "../components/ModeTab"; -import DecodedParamsTable from "./decoder/DecodedParamsTable"; +import InputDecoder from "./decoder/InputDecoder"; import { rawInputTo4Bytes, use4Bytes } from "../use4Bytes"; import { DevDoc, UserDoc } from "../useSourcify"; import { ResolvedAddresses } from "../api/address-resolver"; @@ -338,48 +336,16 @@ const Details: React.FC = ({ )} - - - Decoded - Raw - UTF-8 - - - - {fourBytes === "0x" ? ( - <>No parameters - ) : resolvedTxDesc === undefined ? ( - <>Waiting for data... - ) : resolvedTxDesc === null ? ( - <>Can't decode data - ) : ( - - )} - - -