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" 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 ( - - ); -}