diff --git a/packages/nextjs/components/Header.tsx b/packages/nextjs/components/Header.tsx index 3384e28..7af1f9a 100644 --- a/packages/nextjs/components/Header.tsx +++ b/packages/nextjs/components/Header.tsx @@ -1,7 +1,7 @@ "use client"; import React, { useCallback, useRef, useState } from "react"; -import Image from "next/image"; +// import Image from "next/image"; import Link from "next/link"; import { usePathname } from "next/navigation"; // import Image from "next/image"; @@ -9,8 +9,9 @@ import { useAccount } from "wagmi"; import { PlusIcon } from "@heroicons/react/24/solid"; // import { Bars3Icon } from "@heroicons/react/24/outline"; import { FaucetButton, RainbowKitCustomConnectButton } from "~~/components/scaffold-eth"; -import { useOutsideClick, useScaffoldReadContract, useScaffoldWriteContract } from "~~/hooks/scaffold-eth"; -import { notification } from "~~/utils/scaffold-eth"; +import { useOutsideClick, useScaffoldReadContract } from "~~/hooks/scaffold-eth"; + +// import { notification } from "~~/utils/scaffold-eth"; type HeaderMenuLink = { label: string; @@ -65,7 +66,7 @@ export const Header = () => { // const pathname = usePathname(); // Add this line to track the active route const { address: connectedAddress, isConnected } = useAccount(); - const { writeContractAsync: usdcWriteAsync } = useScaffoldWriteContract("MockUSDC"); + // const { writeContractAsync: usdcWriteAsync } = useScaffoldWriteContract("MockUSDC"); const { data: profileInfo } = useScaffoldReadContract({ contractName: "ProfileInfo", @@ -74,12 +75,28 @@ export const Header = () => { watch: true, }); - const { data: usdcBalance } = useScaffoldReadContract({ - contractName: "MockUSDC", - functionName: "balanceOf", - args: [connectedAddress], - watch: true, - }); + // const { data: usdcBalance } = useScaffoldReadContract({ + // contractName: "MockUSDC", + // functionName: "balanceOf", + // args: [connectedAddress], + // watch: true, + // }); + + // const handleMintUSDC = async () => { + // try { + // await usdcWriteAsync({ + // functionName: "mint", + // args: [connectedAddress, BigInt(100e6)], // Mint 1 USDC + // }); + + // notification.success("USDC Minted Successfully"); + // } catch (error) { + // console.error("Error during minting:", error); + + // // Log the error and notify the user + // notification.error("Minting failed, please try again."); + // } + // }; const defaultProfilePicture = "https://ipfs.io/ipfs/QmVCvzEQHFKzAYSsou8jEJtWdFj31n2XgPpbLjbZqui4YY"; @@ -100,36 +117,20 @@ export const Header = () => { useCallback(() => setIsMenuOpen(false), []), ); - const handleMintUSDC = async () => { - try { - await usdcWriteAsync({ - functionName: "mint", - args: [connectedAddress, BigInt(100e6)], // Mint 1 USDC - }); - - notification.success("USDC Minted Successfully"); - } catch (error) { - console.error("Error during minting:", error); - - // Log the error and notify the user - notification.error("Minting failed, please try again."); - } - }; - return (