From 6c02c6a6b64d4fd5c7285e93f2012a9fd6af428a Mon Sep 17 00:00:00 2001 From: Devsi Date: Mon, 22 Jan 2024 12:42:35 +0530 Subject: [PATCH] link active --- components/Navbar.js | 45 +++++++++++++++++++++++++++++++++++++++++- pages/subscription.tsx | 4 +++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/components/Navbar.js b/components/Navbar.js index dfe41be..ba26ba4 100644 --- a/components/Navbar.js +++ b/components/Navbar.js @@ -17,6 +17,7 @@ import { useWallet } from "@aptos-labs/wallet-adapter-react"; import dynamic from "next/dynamic"; import { Network } from "@aptos-labs/ts-sdk"; import Button from "../components/Button"; +import { useRouter } from 'next/router'; import SingleSignerTransaction from "../components/transactionFlow/SingleSigner"; const REACT_APP_GATEWAY_URL = process.env.NEXT_PUBLIC_GATEWAY_URL; const mynetwork = process.env.NEXT_PUBLIC_NETWORK; @@ -46,6 +47,7 @@ const Navbar = ({ isHome }) => { const [message, setMessage] = useState(""); const [signature, setSignature] = useState(""); const [challengeId, setChallengeId] = useState(""); + const [link, setlink] = useState(""); const { isSignedIn, setIsSignedIn } = useContext(AuthContext); const sdk = useSDK(); @@ -53,6 +55,9 @@ const Navbar = ({ isHome }) => { let sendable = isSendableNetwork(connected, network?.name); + const router = useRouter(); + console.log("router", router); + console.log("account details", account); const address = Cookies.get("erebrus_wallet"); @@ -248,22 +253,60 @@ const Navbar = ({ isHome }) => { */}
- + { link !== "mint" ?( + {setlink("mint")}} + style={{ textDecoration: "none", position: "relative", + borderBottom: router.pathname.includes('mint') ? '2px solid white' : '', }} + onMouseOver={(e) => (e.currentTarget.style.borderBottom = "1px solid #fff")} + onMouseOut={(e) => (e.currentTarget.style.borderBottom = "none")} + > + Mint NFT + ): + ( + Mint NFT + )} {/* Demo Clients */} + { link !== "subscription" ?( {setlink("subscription")}} + style={{ textDecoration: "none", position: "relative", + borderBottom: router.pathname.includes('subscription') ? '2px solid white' : '', }} + onMouseOver={(e) => (e.currentTarget.style.borderBottom = "1px solid #fff")} + onMouseOut={(e) => (e.currentTarget.style.borderBottom = "none")} + > + Subscription + ): + ( + Subscription + )} {isMismatched && (