update insufficientfunds

This commit is contained in:
Jonas Daniels
2022-03-17 15:40:44 -07:00
parent c7cefec755
commit 44a47b497c
+7
View File
@@ -12,6 +12,7 @@ import { Card } from "components/layout/Card";
import { LinkButton } from "components/shared/LinkButton";
import { BigNumber } from "ethers";
import { useNetworkMismatch } from "hooks/useNetworkMismatch";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import { AiOutlineWarning } from "react-icons/ai";
import { ChainId } from "utils/network";
@@ -23,6 +24,7 @@ const FAUCETS: Partial<Record<ChainId, string>> = {
};
export const InsufficientFunds: React.FC = () => {
const router = useRouter();
const mismatchExists = useNetworkMismatch();
const { address, balance, chainId, getNetworkMetadata } = useWeb3();
const [dismissed, setDismissed] = useState(false);
@@ -63,6 +65,11 @@ export const InsufficientFunds: React.FC = () => {
return null;
}
// if we're on the dashboard overview page do not show the warning, as it is confusing
if (router.pathname === "/[wallet]") {
return null;
}
const { symbol, isTestnet } = getNetworkMetadata(chainId || 0);
return (