diff --git a/public/eth-diamond-black.png b/public/eth-diamond-black.png deleted file mode 100644 index 5149878..0000000 Binary files a/public/eth-diamond-black.png and /dev/null differ diff --git a/src/components/TokenLogo.tsx b/src/components/TokenLogo.tsx index 8568a0b..7eaf2bd 100644 --- a/src/components/TokenLogo.tsx +++ b/src/components/TokenLogo.tsx @@ -1,32 +1,31 @@ -import React, { Suspense, useContext } from "react"; +import React, { useContext } from "react"; import { useImage } from "react-image"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faCoins } from "@fortawesome/free-solid-svg-icons/faCoins"; import { tokenLogoURL } from "../url"; import { RuntimeContext } from "../useRuntime"; +import { ChecksummedAddress } from "../types"; type TokenLogoProps = { - address: string; + address: ChecksummedAddress; name: string; }; -const TokenLogo: React.FC = (props) => ( - - - -); - -const InternalTokenLogo: React.FC = ({ address, name }) => { +const TokenLogo: React.FC = ({ address, name }) => { const { config } = useContext(RuntimeContext); const srcList: string[] = []; if (config) { srcList.push(tokenLogoURL(config.assetsURLPrefix ?? "", address)); } - srcList.push("/eth-diamond-black.png"); - const { src } = useImage({ srcList }); + const { src, isLoading } = useImage({ srcList, useSuspense: false }); return ( -
- {`${name} +
+ {src && ( + {`${name} + )} + {!src && !isLoading && }
); };