@@ -12,7 +12,7 @@ import {
1212} from "@/components/ui/resizable-navbar" ;
1313import { useState , useEffect } from "react" ;
1414import { GitHubStarsButton } from '@/components/animate-ui/buttons/github-stars' ;
15- import { useRouter } from "next/navigation" ;
15+ import { useRouter , usePathname } from "next/navigation" ;
1616import { supabase } from "@/lib/supabaseclient" ;
1717import type { User } from '@supabase/supabase-js' ;
1818import Link from "next/link" ;
@@ -47,6 +47,13 @@ export function NavbarDemo({ searchQuery = "", setSearchQuery }: NavbarDemoProps
4747 const [ showMobileSearch , setShowMobileSearch ] = useState ( false ) ;
4848 const [ user , setUser ] = useState < User | null > ( null ) ;
4949 const router = useRouter ( ) ;
50+ const pathname = usePathname ( ) ;
51+
52+ // Only show navbar if NOT on homepage or landing page
53+ const shouldShowNavbar = pathname !== '/' && pathname !== '/home' ;
54+
55+ // Only show search on dashboard page
56+ const showSearch = pathname === '/dashboard' && setSearchQuery ;
5057
5158 useEffect ( ( ) => {
5259 if ( ! supabase ) return ;
@@ -72,6 +79,11 @@ export function NavbarDemo({ searchQuery = "", setSearchQuery }: NavbarDemoProps
7279 }
7380 } ;
7481
82+ // Don't render navbar on homepage
83+ if ( ! shouldShowNavbar ) {
84+ return null ;
85+ }
86+
7587 return (
7688 < div className = "relative w-full" >
7789 < Navbar >
@@ -82,26 +94,26 @@ export function NavbarDemo({ searchQuery = "", setSearchQuery }: NavbarDemoProps
8294 < NavItems items = { navItems } />
8395 </ div >
8496
85- { /* Desktop Search Bar */ }
86- { setSearchQuery && (
97+ { /* Desktop Search - Only on Dashboard */ }
98+ { showSearch && (
8799 < div className = "hidden md:flex items-center mr-4" >
88100 < div className = "relative" >
89101 < input
90102 type = "text"
91103 placeholder = "Search projects..."
92104 value = { searchQuery }
93105 onChange = { ( e ) => setSearchQuery ( e . target . value ) }
94- className = "w-64 px-4 py-2 pl-10 bg-white/10 backdrop-blur-sm border border-white/20
95- rounded-full text-white placeholder-white/50
96- focus:outline-none focus:border-blue-400 focus:ring-2
97- focus:ring-blue-400/50 transition-all"
106+ className = "w-64 px-4 py-2 pl-10 bg-white/5 backdrop-blur-md border border-white/10
107+ rounded-full text-white placeholder-white/40
108+ focus:outline-none focus:border-white/30 focus:bg-white/5
109+ transition-all duration-200 "
98110 />
99- < Search className = "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-white/50 " />
111+ < Search className = "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-white/40 " />
100112 { searchQuery && (
101113 < button
102114 onClick = { clearSearch }
103115 className = "absolute right-3 top-1/2 -translate-y-1/2
104- text-white/50 hover:text-white transition-colors"
116+ text-white/40 hover:text-white transition-colors"
105117 aria-label = "Clear search"
106118 >
107119 < X className = "w-4 h-4" />
@@ -126,8 +138,8 @@ export function NavbarDemo({ searchQuery = "", setSearchQuery }: NavbarDemoProps
126138 < MobileNavHeader >
127139 < NavbarLogo />
128140 < div className = "flex items-center gap-2" >
129- { /* Mobile Search Toggle */ }
130- { setSearchQuery && (
141+ { /* Mobile Search Toggle - Only on Dashboard */ }
142+ { showSearch && (
131143 < button
132144 onClick = { ( ) => setShowMobileSearch ( ! showMobileSearch ) }
133145 className = "text-white/90 hover:text-white transition-colors md:hidden"
@@ -143,26 +155,26 @@ export function NavbarDemo({ searchQuery = "", setSearchQuery }: NavbarDemoProps
143155 </ div >
144156 </ MobileNavHeader >
145157
146- { /* Mobile Search Bar (appears below header when toggled) */ }
147- { showMobileSearch && setSearchQuery && (
158+ { /* Mobile Search Bar */ }
159+ { showMobileSearch && showSearch && (
148160 < div className = "px-4 py-3 border-t border-white/10 md:hidden" >
149161 < div className = "relative" >
150162 < input
151163 type = "text"
152164 placeholder = "Search projects..."
153165 value = { searchQuery }
154166 onChange = { ( e ) => setSearchQuery ( e . target . value ) }
155- className = "w-full px-4 py-3 pl-10 bg-white/10 backdrop-blur-sm border border-white/20
156- rounded-full text-white placeholder-white/50
157- focus:outline-none focus:border-blue-400 focus:ring-2
158- focus:ring-blue-400/50 transition-all"
167+ className = "w-full px-4 py-3 pl-10 bg-white/5 backdrop-blur-sm border border-white/10
168+ rounded-lg text-white placeholder-white/40
169+ focus:outline-none focus:border-white/30 focus:bg-white/5
170+ transition-all"
159171 />
160- < Search className = "absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-white/50 " />
172+ < Search className = "absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-white/40 " />
161173 { searchQuery && (
162174 < button
163175 onClick = { clearSearch }
164176 className = "absolute right-3 top-1/2 -translate-y-1/2
165- text-white/50 hover:text-white transition-colors"
177+ text-white/40 hover:text-white transition-colors"
166178 aria-label = "Clear search"
167179 >
168180 < X className = "w-5 h-5" />
0 commit comments