From b5831579e40500fe246b9bd1db0f0430ec2ca332 Mon Sep 17 00:00:00 2001 From: Priyans00 <115811175+Priyans00@users.noreply.github.com> Date: Wed, 10 Sep 2025 11:21:32 +0530 Subject: [PATCH 1/2] Del: Delete depenadabot.yml --- .github/dependabot.yml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 5f0889c..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - -version: 2 -updates: - - package-ecosystem: "npm" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "weekly" From 0063ffe418bbb545d8cd66de041879914969a2df Mon Sep 17 00:00:00 2001 From: Priyans00 <115811175+Priyans00@users.noreply.github.com> Date: Wed, 10 Sep 2025 11:23:38 +0530 Subject: [PATCH 2/2] Del: Delete unused navbar.tsx --- components/navbar.tsx | 239 ------------------------------------------ 1 file changed, 239 deletions(-) delete mode 100644 components/navbar.tsx diff --git a/components/navbar.tsx b/components/navbar.tsx deleted file mode 100644 index 08b2090..0000000 --- a/components/navbar.tsx +++ /dev/null @@ -1,239 +0,0 @@ -"use client"; -import { useState, useEffect } from "react"; -import Link from "next/link"; -import { useRouter, usePathname } from "next/navigation"; -import { createClient } from "@/lib/supabase/client"; -import { User } from '@supabase/supabase-js'; -import { - ShoppingBag, - Plus, - MessageCircle, - Menu, - X, - Home, - Heart, - UserIcon -} from "lucide-react"; -import { Button } from "@/components/ui/button"; -import { ThemeSwitcher } from "@/components/theme-switcher"; - -export function Navbar() { - const [user, setUser] = useState(null); - const [isMenuOpen, setIsMenuOpen] = useState(false); - const [loading, setLoading] = useState(true); - const router = useRouter(); - const pathname = usePathname(); - - useEffect(() => { - const supabase = createClient(); - - // Get initial user - handle missing session gracefully - supabase.auth.getUser().then(({ data, error }) => { - if (error) { - // Don't log "Auth session missing!" as an error - it's normal - if (error.message !== "Auth session missing!") { - console.error("Error fetching user:", error.message); - } - setUser(null); - } else { - setUser(data.user); - } - setLoading(false); - }); - - // Listen for auth changes - const { data: listener } = supabase.auth.onAuthStateChange((_event, session) => { - setUser(session?.user ?? null); - setLoading(false); - }); - - return () => { - listener.subscription.unsubscribe(); - }; - }, []); - - const handleSignOut = async () => { - const supabase = createClient(); - await supabase.auth.signOut(); - router.push('/'); - }; - - const isActivePath = (path: string) => { - return pathname === path; - }; - - const handleSellClick = (e: React.MouseEvent) => { - if (!user) { - e.preventDefault(); - // Store the intended destination in sessionStorage - sessionStorage.setItem('redirectAfterLogin', '/sell'); - router.push('/auth/login'); - } - }; - - const navItems = [ - { href: "/", label: "Home", icon: Home }, - { href: "/item-listing", label: "Browse", icon: ShoppingBag }, - { href: "/sell", label: "Sell", icon: Plus, onClick: handleSellClick }, - ...(user ? [ - { href: "/chat", label: "Messages", icon: MessageCircle }, - { href: "/favorites", label: "Favorites", icon: Heart }, - { href: "/profile", label: "Profile", icon: UserIcon }, - ] : []) - ]; - - return ( - - ); -}