diff --git a/src/address/ContractABI.tsx b/src/address/ContractABI.tsx new file mode 100644 index 0000000..2f079de --- /dev/null +++ b/src/address/ContractABI.tsx @@ -0,0 +1,19 @@ +import React from "react"; +import Copy from "../components/Copy"; +import RawABI from "./RawABI"; + +type ContractABIProps = { + abi: any[]; +}; + +const ContractABI: React.FC = ({ abi }) => ( +
+
+ ABI + +
+ +
+); + +export default React.memo(ContractABI); diff --git a/src/address/Contracts.tsx b/src/address/Contracts.tsx index 0745d73..dbaaf83 100644 --- a/src/address/Contracts.tsx +++ b/src/address/Contracts.tsx @@ -5,13 +5,12 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown"; import ContentFrame from "../ContentFrame"; import InfoRow from "../components/InfoRow"; -import Copy from "../components/Copy"; -import ABI from "./ABI"; import Contract from "./Contract"; import { RuntimeContext } from "../useRuntime"; import { Metadata } from "../useSourcify"; import ExternalLink from "../components/ExternalLink"; import { openInRemixURL } from "../url"; +import ContractABI from "./ContractABI"; type ContractsProps = { checksummedAddress: string; @@ -70,13 +69,7 @@ const Contracts: React.FC = ({ {rawMetadata !== undefined && rawMetadata !== null && ( <> {rawMetadata.output.abi && ( -
-
- ABI - -
- -
+ )}
diff --git a/src/address/ABI.tsx b/src/address/RawABI.tsx similarity index 74% rename from src/address/ABI.tsx rename to src/address/RawABI.tsx index a714367..bc07e81 100644 --- a/src/address/ABI.tsx +++ b/src/address/RawABI.tsx @@ -1,11 +1,11 @@ import React from "react"; import { SyntaxHighlighter, docco } from "../highlight-init"; -type ABIProps = { +type RawABIProps = { abi: any[]; }; -const ABI: React.FC = ({ abi }) => ( +const RawABI: React.FC = ({ abi }) => ( = ({ abi }) => ( ); -export default React.memo(ABI); +export default React.memo(RawABI);