From 706fb425f5d965095a9bf98374d5da8ad71eeeaa Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Wed, 15 Sep 2021 15:58:37 -0300 Subject: [PATCH] Initial styling --- src/transaction/DecodedInput.tsx | 34 ++++++++++++++++++++++++++++++++ src/transaction/Details.tsx | 24 ++-------------------- 2 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 src/transaction/DecodedInput.tsx diff --git a/src/transaction/DecodedInput.tsx b/src/transaction/DecodedInput.tsx new file mode 100644 index 0000000..f41406b --- /dev/null +++ b/src/transaction/DecodedInput.tsx @@ -0,0 +1,34 @@ +import React from "react"; +import { TransactionDescription } from "@ethersproject/abi"; + +type DecodedInputProps = { + txDesc: TransactionDescription; +}; + +const DecodedInput: React.FC = ({ txDesc }) => ( + + + + + + + + {txDesc.args.map((r, i) => ( + + + + + + ))} + +
+ param (index) + typevalue
+ {txDesc.functionFragment.inputs[i].name}{" "} + ({i}) + + {txDesc.functionFragment.inputs[i].type} + {r}
+); + +export default React.memo(DecodedInput); diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index cca0ea1..f2cebce 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -30,6 +30,7 @@ import PercentageBar from "../components/PercentageBar"; import ExternalLink from "../components/ExternalLink"; import RelativePosition from "../components/RelativePosition"; import PercentagePosition from "../components/PercentagePosition"; +import DecodedInput from "./DecodedInput"; type DetailsProps = { txData: TransactionData; @@ -343,28 +344,7 @@ const Details: React.FC = ({ - - {txDesc && ( - - - - - - - - - {txDesc.args.map((r, i) => ( - - - - - - - ))} - -
#nametypevalue
{i}{txDesc.functionFragment.inputs[i].name}{txDesc.functionFragment.inputs[i].type}{r}
- )} -
+ {txDesc && }