Fix context use
This commit is contained in:
parent
052b2f61e0
commit
7b2bdce210
|
@ -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<MethodNameProps> = ({ data }) => {
|
||||
const runtime = useRuntime();
|
||||
const runtime = useContext(RuntimeContext);
|
||||
|
||||
const [name, setName] = useState<string>();
|
||||
useEffect(() => {
|
||||
|
|
|
@ -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<TokenLogoProps> = (props) => (
|
|||
);
|
||||
|
||||
const InternalTokenLogo: React.FC<TokenLogoProps> = ({ address, name }) => {
|
||||
const { config } = useRuntime();
|
||||
const { config } = useContext(RuntimeContext);
|
||||
|
||||
const srcList: string[] = [];
|
||||
if (config) {
|
||||
|
|
Loading…
Reference in New Issue