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 { fourBytesURL } from "../url";
|
||||||
import { useRuntime } from "../useRuntime";
|
import { RuntimeContext } from "../useRuntime";
|
||||||
|
|
||||||
type MethodNameProps = {
|
type MethodNameProps = {
|
||||||
data: string;
|
data: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const MethodName: React.FC<MethodNameProps> = ({ data }) => {
|
const MethodName: React.FC<MethodNameProps> = ({ data }) => {
|
||||||
const runtime = useRuntime();
|
const runtime = useContext(RuntimeContext);
|
||||||
|
|
||||||
const [name, setName] = useState<string>();
|
const [name, setName] = useState<string>();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Suspense } from "react";
|
import React, { Suspense, useContext } from "react";
|
||||||
import { useImage } from "react-image";
|
import { useImage } from "react-image";
|
||||||
import { tokenLogoURL } from "../url";
|
import { tokenLogoURL } from "../url";
|
||||||
import { useRuntime } from "../useRuntime";
|
import { RuntimeContext } from "../useRuntime";
|
||||||
|
|
||||||
type TokenLogoProps = {
|
type TokenLogoProps = {
|
||||||
address: string;
|
address: string;
|
||||||
|
@ -15,7 +15,7 @@ const TokenLogo: React.FC<TokenLogoProps> = (props) => (
|
||||||
);
|
);
|
||||||
|
|
||||||
const InternalTokenLogo: React.FC<TokenLogoProps> = ({ address, name }) => {
|
const InternalTokenLogo: React.FC<TokenLogoProps> = ({ address, name }) => {
|
||||||
const { config } = useRuntime();
|
const { config } = useContext(RuntimeContext);
|
||||||
|
|
||||||
const srcList: string[] = [];
|
const srcList: string[] = [];
|
||||||
if (config) {
|
if (config) {
|
||||||
|
|
Loading…
Reference in New Issue