Skip to content

Commit

Permalink
link active
Browse files Browse the repository at this point in the history
  • Loading branch information
devsisingh committed Jan 22, 2024
1 parent f02ae23 commit 6c02c6a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
45 changes: 44 additions & 1 deletion components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -46,13 +47,17 @@ 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();

const { account, connected, network, wallet , signMessage} = useWallet();

let sendable = isSendableNetwork(connected, network?.name);

const router = useRouter();
console.log("router", router);

console.log("account details", account);

const address = Cookies.get("erebrus_wallet");
Expand Down Expand Up @@ -248,22 +253,60 @@ const Navbar = ({ isHome }) => {
</Link> */}
</div>
<div className="hidden lg:flex items-center">
<Link href="/mint" className="text-gray-300 mr-8" scroll={false}>
{ link !== "mint" ?(
<Link
href="/mint"
className="text-gray-300 mr-8"
scroll={false}
onClick={()=> {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
</Link>):
(
<Link
href="/mint"
className="text-gray-300 mr-8"
scroll={false}
style={{ textDecoration: "none", position: "relative",
borderBottom:'2px solid white'}}
>
Mint NFT
</Link>
)}
{/* <Link href="/demo" className="text-gray-300 mr-8">
Demo
</Link>
<Link href="/clients" className="text-gray-300 mr-8">
Clients
</Link> */}
{ link !== "subscription" ?(
<Link
href="/subscription"
className="text-gray-300 mr-8"
scroll={false}
onClick={()=> {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
</Link>):
(
<Link
href="/subscription"
className="text-gray-300 mr-8"
scroll={false}
style={{ textDecoration: "none", position: "relative",
borderBottom:'2px solid white'}}
>
Subscription
</Link>
)}
{isMismatched && (
<button
className="text-purple-400 mr-12"
Expand Down
4 changes: 3 additions & 1 deletion pages/subscription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ const Subscription = () => {
address: `${wallet}`,
limit: 12,
offset: 0,
where: [],
where: [
{ current_token_data: { current_collection: { collection_id: { _eq: "0xf85e432e4bc0d52dec50b53ae3f8528eba3d7c92d1ea7a4aefd20d8d2005f2d7" } } } },
],
},
operationName: "getAccountCurrentTokens",
};
Expand Down

0 comments on commit 6c02c6a

Please sign in to comment.