diff --git a/src/components/MethodName.tsx b/src/components/MethodName.tsx index 3a4d710..55ff909 100644 --- a/src/components/MethodName.tsx +++ b/src/components/MethodName.tsx @@ -1,13 +1,13 @@ -import React, { useState, useEffect } from "react"; +import React, { useState, useEffect, useContext } from "react"; import { fourBytesURL } from "../url"; -import { useRuntime } from "../useRuntime"; +import { RuntimeContext } from "../useRuntime"; type MethodNameProps = { data: string; }; const MethodName: React.FC = ({ data }) => { - const runtime = useRuntime(); + const runtime = useContext(RuntimeContext); const [name, setName] = useState(); useEffect(() => { diff --git a/src/components/TokenLogo.tsx b/src/components/TokenLogo.tsx index cc2e756..c6f5b8b 100644 --- a/src/components/TokenLogo.tsx +++ b/src/components/TokenLogo.tsx @@ -1,7 +1,7 @@ -import React, { Suspense } from "react"; +import React, { Suspense, useContext } from "react"; import { useImage } from "react-image"; import { tokenLogoURL } from "../url"; -import { useRuntime } from "../useRuntime"; +import { RuntimeContext } from "../useRuntime"; type TokenLogoProps = { address: string; @@ -15,7 +15,7 @@ const TokenLogo: React.FC = (props) => ( ); const InternalTokenLogo: React.FC = ({ address, name }) => { - const { config } = useRuntime(); + const { config } = useContext(RuntimeContext); const srcList: string[] = []; if (config) {