From 7b2bdce2105c2eb52c3c9687d712d8e449a52ddd Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Fri, 9 Jul 2021 14:22:25 -0300 Subject: [PATCH] Fix context use --- src/components/MethodName.tsx | 6 +++--- src/components/TokenLogo.tsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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) {