From 83da6608f076469d179f1b5f1d46002bb6047437 Mon Sep 17 00:00:00 2001 From: Naman Bharsakale Date: Thu, 18 Jun 2026 17:33:19 +0530 Subject: [PATCH] fix: add BOOKMARKS to mobile nav and correct GitHub URL in contribute section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug fixes: - navbar: add BOOKMARKS link to mobile hamburger menu (was desktop-only) - contribute: fix broken GitHub URL (pushkarsinghh → pushkarscripts) Enhancements: - navbar: active link highlighting via usePathname (underlines current page) - navbar: close mobile menu on outside click (useEffect + useRef) - navbar: add aria-expanded to hamburger button for accessibility - navbar: unify all link classes through a single linkClass helper - contribute: add numbered "How to Contribute" steps section - contribute: add CTA button linking directly to GitHub Issues - footer: add Quiz and Bookmarks to Quick Links (were missing) Co-Authored-By: Claude Sonnet 4.6 --- app/components/contribute.tsx | 52 +++++++++++++++++++++++++++++++- app/components/footer.tsx | 2 ++ app/components/navbar.tsx | 57 ++++++++++++++++++++++++++--------- 3 files changed, 95 insertions(+), 16 deletions(-) diff --git a/app/components/contribute.tsx b/app/components/contribute.tsx index 6fb6b32..919c61d 100644 --- a/app/components/contribute.tsx +++ b/app/components/contribute.tsx @@ -12,7 +12,7 @@ export default function ContributionsSection() {

Browse and Tackle Issues

- Check out the available issues on our GitHub repository. Pick one to work on, or raise your own if you spot something new! + Check out the available issues on our GitHub repository. Pick one to work on, or raise your own if you spot something new!

  • Find beginner-friendly and advanced issues
  • @@ -24,6 +24,56 @@ export default function ContributionsSection() {

+ + {/* How to Contribute Steps */} +
+

+ How to Contribute +

+
    +
  1. + + 1 + + + Fork & Clone — Fork the repository on GitHub and clone it to your local machine. + +
  2. +
  3. + + 2 + + + Pick an Issue — Browse open issues or open a new one to discuss your idea before starting. + +
  4. +
  5. + + 3 + + + Create a Branch — Make a dedicated branch for your change (e.g. feat/topic-name). + +
  6. +
  7. + + 4 + + + Open a Pull Request — Push your branch and submit a PR against main. A maintainer will review it shortly. + +
  8. +
+ + Browse Issues on GitHub → + +
); } diff --git a/app/components/footer.tsx b/app/components/footer.tsx index 7684cb0..98ee561 100644 --- a/app/components/footer.tsx +++ b/app/components/footer.tsx @@ -38,6 +38,8 @@ export default function Footer() {
  • Subjects
  • Contribute
  • Sponsor
  • +
  • Quiz
  • +
  • Bookmarks
  • diff --git a/app/components/navbar.tsx b/app/components/navbar.tsx index 988aeb5..e4d4164 100644 --- a/app/components/navbar.tsx +++ b/app/components/navbar.tsx @@ -1,7 +1,8 @@ "use client"; import Link from "next/link"; import { Road_Rage } from "next/font/google"; -import { useState } from "react"; +import { useState, useEffect, useRef } from "react"; +import { usePathname } from "next/navigation"; const roadRage = Road_Rage({ variable: "--font-road-rage", @@ -11,12 +12,32 @@ const roadRage = Road_Rage({ export default function Navbar() { const [menuOpen, setMenuOpen] = useState(false); + const navRef = useRef(null); + const pathname = usePathname(); + + useEffect(() => { + function handleClickOutside(event: MouseEvent) { + if (navRef.current && !navRef.current.contains(event.target as Node)) { + setMenuOpen(false); + } + } + if (menuOpen) { + document.addEventListener("mousedown", handleClickOutside); + } + return () => document.removeEventListener("mousedown", handleClickOutside); + }, [menuOpen]); + + const linkClass = (href: string) => { + const isActive = !href.includes("#") && pathname === href; + return `hover:text-[#d2b48c] transition-colors duration-200 cursor-pointer${ + isActive ? " text-[#d2b48c] underline underline-offset-4" : "" + }`; + }; return ( -