From eb9ca5729ffd24e1cbd9ae191ec778ef3a272755 Mon Sep 17 00:00:00 2001 From: fisher Date: Wed, 9 Oct 2024 17:50:13 +0800 Subject: [PATCH] Support switch chain (#22) * feat(network): add darwinia network to the app * fix(darwinia chain): add transporter * feat(koi and crab): add koi and crab networks * fix(text and title): fix logo and text changes by network changes * first try * fix rpc * Test only crab * Mainnet is needed for other components * remove no use code --------- Co-authored-by: Hamid Roohi --- components/layout.tsx | 4 ++-- components/nav/navbar.tsx | 21 ++++++++++++++------- context/Web3Modal.tsx | 8 +++++--- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/components/layout.tsx b/components/layout.tsx index fce7797d..8e084c97 100644 --- a/components/layout.tsx +++ b/components/layout.tsx @@ -5,7 +5,7 @@ import Footer from "./footer"; export const Layout: React.FC<{ children: ReactNode }> = (props) => { return ( -
+
= (props) => { className="absolute left-0 right-0 top-0 h-[100vh] w-[100vw] object-contain object-left-top" /> -
+
{props.children} diff --git a/components/nav/navbar.tsx b/components/nav/navbar.tsx index ac34622b..b81de2a9 100644 --- a/components/nav/navbar.tsx +++ b/components/nav/navbar.tsx @@ -7,9 +7,13 @@ import Link from "next/link"; import { useState } from "react"; import { MobileNavDialog } from "./mobileNavDialog"; import { NavLink, type INavLink } from "./navLink"; +import { useChainId } from "wagmi"; export const Navbar: React.FC = () => { const [open, setOpen] = useState(false); + const chainId = useChainId(); + + console.log("chain id", chainId); const navLinks: INavLink[] = [ // { path: "/", id: "dashboard", name: "Dashboard", icon: IconType.APP_DASHBOARD }, @@ -23,21 +27,24 @@ export const Navbar: React.FC = () => { return ( <> -