From fe336c5c4327b0bfe3e4f83a0c20ee6b26df9fbe Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 6 Sep 2021 03:43:20 -0300 Subject: [PATCH] Refactorings --- src/AddressTransactions.tsx | 16 ++++++--------- src/Transaction.tsx | 21 +++++++++++--------- src/address/Contracts.tsx | 39 +++++++++++++++++++++---------------- src/components/NavTab.tsx | 23 ++++++++++++---------- src/components/TabGroup.tsx | 7 ------- 5 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 src/components/TabGroup.tsx diff --git a/src/AddressTransactions.tsx b/src/AddressTransactions.tsx index cb17b4b..659c1eb 100644 --- a/src/AddressTransactions.tsx +++ b/src/AddressTransactions.tsx @@ -216,16 +216,12 @@ const AddressTransactions: React.FC = () => { - - - Overview - - - - - Contract - - + + Overview + + + Contract + diff --git a/src/Transaction.tsx b/src/Transaction.tsx index 63ec3ca..e204633 100644 --- a/src/Transaction.tsx +++ b/src/Transaction.tsx @@ -1,9 +1,9 @@ import React, { useMemo, useContext } from "react"; import { Route, Switch, useParams } from "react-router-dom"; +import { Tab } from "@headlessui/react"; import StandardFrame from "./StandardFrame"; import StandardSubtitle from "./StandardSubtitle"; import ContentFrame from "./ContentFrame"; -import TabGroup from "./components/TabGroup"; import NavTab from "./components/NavTab"; import Details from "./transaction/Details"; import Logs from "./transaction/Logs"; @@ -56,14 +56,17 @@ const Transaction: React.FC = () => { )} {txData && ( - - Overview - {txData.confirmedData?.blockNumber !== undefined && ( - - Logs{txData && ` (${txData.confirmedData?.logs?.length ?? 0})`} - - )} - + + + Overview + {txData.confirmedData?.blockNumber !== undefined && ( + + Logs + {txData && ` (${txData.confirmedData?.logs?.length ?? 0})`} + + )} + +
= ({ Yes with{" "} - {ethers.utils.commify(optimizer?.runs)} + {commify(optimizer?.runs)} {" "} runs @@ -56,20 +57,24 @@ const Contracts: React.FC = ({ )} {rawMetadata !== undefined && rawMetadata !== null && (
-
- {Object.entries(rawMetadata.sources).map(([k]) => ( - - ))} -
+ + + {Object.entries(rawMetadata.sources).map(([k]) => ( + + + + ))} + + {selected && ( = ({ href, children }) => ( - - {children} - + + + {children} + + ); export default NavTab; diff --git a/src/components/TabGroup.tsx b/src/components/TabGroup.tsx deleted file mode 100644 index f1bdecb..0000000 --- a/src/components/TabGroup.tsx +++ /dev/null @@ -1,7 +0,0 @@ -const TabGroup: React.FC = ({ children }) => ( -
- {children} -
-); - -export default TabGroup;