From 3fe1720efaed970e75892ca6598142be805dcde3 Mon Sep 17 00:00:00 2001 From: Sohan Rout Date: Fri, 31 Jul 2026 23:40:07 +0530 Subject: [PATCH 1/6] Feat : added bun support and migrated to latest next --- .github/workflows/test.yml | 13 +- app/components/navbar.jsx | 124 +- app/components/navbarinner.jsx | 19 +- app/contexts/ThemeContext.jsx | 33 + app/layout.jsx | 9 +- app/login/page.jsx | 18 +- app/not-found.jsx | 11 +- .../queue/implementation/array/content.jsx | 20 +- .../implementation/linkedList/content.jsx | 20 +- .../operations/enqueue-dequeue/content.jsx | 20 +- .../queue/operations/isempty/content.jsx | 20 +- .../queue/operations/isfull/content.jsx | 20 +- .../queue/operations/peek-front/content.jsx | 20 +- .../queue/types/circular/content.jsx | 20 +- app/visualizer/queue/types/deque/content.jsx | 20 +- .../queue/types/priority/content.jsx | 20 +- .../queue/types/singleEnded/content.jsx | 20 +- .../searching/binarysearch/content.jsx | 21 +- .../searching/linearsearch/content.jsx | 21 +- app/visualizer/sorting/bubblesort/content.jsx | 21 +- .../sorting/insertionsort/content.jsx | 20 +- app/visualizer/sorting/mergesort/content.jsx | 21 +- app/visualizer/sorting/quicksort/content.jsx | 21 +- .../sorting/selectionsort/content.jsx | 21 +- .../implementation/usingArray/content.jsx | 21 +- .../usingLinkedList/content.jsx | 21 +- app/visualizer/stack/isempty/content.jsx | 21 +- app/visualizer/stack/isfull/content.jsx | 21 +- app/visualizer/stack/peek/content.jsx | 21 +- .../stack/polish/postfix/content.jsx | 21 +- .../stack/polish/prefix/content.jsx | 21 +- app/visualizer/stack/push-pop/content.jsx | 21 +- bun.lock | 1484 +++ package-lock.json | 10136 ---------------- package.json | 9 +- public/sitemap-0.xml | 88 +- 36 files changed, 1668 insertions(+), 10790 deletions(-) create mode 100755 app/contexts/ThemeContext.jsx create mode 100755 bun.lock delete mode 100755 package-lock.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a8078d..eabf455 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,17 +14,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 + - name: Set up Bun + uses: oven-sh/setup-bun@v2 with: - node-version: 20 - cache: 'npm' + bun-version: latest - name: Install dependencies - run: npm install + run: bun install --frozen-lockfile - name: Run tests - run: npm run test + run: bun run test - name: Build Next.js - run: npm run build \ No newline at end of file + run: bun run build \ No newline at end of file diff --git a/app/components/navbar.jsx b/app/components/navbar.jsx index 802420d..3a6cb1d 100755 --- a/app/components/navbar.jsx +++ b/app/components/navbar.jsx @@ -1,8 +1,9 @@ "use client"; import Link from "next/link"; -import { useState, useEffect } from "react"; +import { useState } from "react"; import { useRouter } from "next/navigation"; import { useUser } from '@/app/contexts/UserContext'; +import { useTheme } from '@/app/contexts/ThemeContext'; import { supabase } from '@/lib/supabase'; // Constants for services dropdown items @@ -119,8 +120,8 @@ const ChevronIcon = ({ isOpen = false }) => ( ); -// Service item component for both desktop and mobile -const ServiceItem = ({ title, description, icon, iconBg, href }) => ( +// Dropdown item, shared by the About and Services menus on both desktop and mobile +const DropdownItem = ({ title, description, icon, iconBg, href }) => ( ( ); -// Services dropdown component for desktop -const DesktopServicesDropdown = () => ( +// Dropdown menu component for desktop (hover-triggered via group-hover) +const DesktopDropdown = ({ items }) => (
- {SERVICES.map((service, index) => ( - + {items.map((item, index) => ( + ))}
); -// Services dropdown component for mobile -const MobileServicesDropdown = ({ isOpen }) => ( +// Dropdown menu component for mobile (click-triggered via isOpen state) +const MobileDropdown = ({ items, isOpen }) => (
- {SERVICES.map((service, index) => ( - - ))} -
-); - -// Service item component for both desktop and mobile -const AboutItem = ({ title, description, icon, iconBg, href }) => ( - -
-
- {icon} -
-
-
{title}
-
{description}
-
-
- - - - -); - -// About dropdown component for desktop -const AboutServicesDropdown = () => ( -
-
- {ABOUT.map((about, index) => ( - - ))} -
-
-); - -// Services dropdown component for mobile -const MobileAboutDropdown = ({ isOpen }) => ( -
- {ABOUT.map((about, index) => ( - + {items.map((item, index) => ( + ))}
); export default function Navbar() { - const [theme, setTheme] = useState("light"); const [mobileMenuOpen, setMobileMenuOpen] = useState(false); - const [isScrolled, setIsScrolled] = useState(false); + const [isAboutOpen, setIsAboutOpen] = useState(false); const [isServicesOpen, setIsServicesOpen] = useState(false); const [isUserMenuOpen, setIsUserMenuOpen] = useState(false); const router = useRouter(); const { user, setUser } = useUser(); + const { theme, toggleTheme } = useTheme(); const handleLogout = async () => { await supabase.auth.signOut(); @@ -228,41 +182,13 @@ const handleLogout = async () => { router.push('/'); }; - // Load theme from localStorage on mount and apply it - useEffect(() => { - const savedTheme = localStorage.getItem("theme") || "light"; - setTheme(savedTheme); - document.documentElement.classList.toggle("dark", savedTheme === "dark"); - }, []); - - // Handle scroll effect - useEffect(() => { - const handleScroll = () => { - setIsScrolled(window.scrollY > 10); - }; - window.addEventListener("scroll", handleScroll); - return () => window.removeEventListener("scroll", handleScroll); - }, []); - - const toggleTheme = () => { - const newTheme = theme === "light" ? "dark" : "light"; - setTheme(newTheme); - localStorage.setItem("theme", newTheme); - document.documentElement.classList.toggle("dark", newTheme === "dark"); - window.dispatchEvent(new Event("themeChange")); - }; - // Close mobile menu const closeMobileMenu = () => { setMobileMenuOpen(false); }; return ( -