@@ -12,7 +12,9 @@ import { useNavigate } from 'react-router-dom';
1212const Navbar : React . FC = ( ) => {
1313 const [ isOpen , setIsOpen ] = useState ( false ) ;
1414 const [ isScrolled , setIsScrolled ] = useState ( false ) ;
15- const { user, signOut } = useAuth ( ) ;
15+ const [ isServicesOpen , setIsServicesOpen ] = useState ( false ) ; // Desktop dropdown
16+ const [ isMobileServicesOpen , setIsMobileServicesOpen ] = useState ( false ) ; // Mobile dropdown
17+ const { user } = useAuth ( ) ;
1618 const { t } = useTranslation ( ) ;
1719 const navigate = useNavigate ( ) ;
1820
@@ -74,6 +76,34 @@ const Navbar: React.FC = () => {
7476 </ div >
7577 < Link to = "/" className = "text-foreground hover:text-primary transition-colors" > { t ( 'common.home' ) } </ Link >
7678 < Link to = "/services" className = "text-foreground hover:text-primary transition-colors" > { t ( 'common.services' ) } </ Link >
79+
80+ { /* New "All Services" dropdown button */ }
81+ < div
82+ className = "relative"
83+ onMouseEnter = { ( ) => setIsServicesOpen ( true ) }
84+ onMouseLeave = { ( ) => setIsServicesOpen ( false ) }
85+ >
86+ < button
87+ className = "text-foreground hover:text-primary px-1 py-2 rounded-md text-base font-low transition-colors "
88+ >
89+ { t ( 'common.solutions' ) }
90+ </ button >
91+ < div
92+ className = { `absolute top-full left-0 mt-2 w-48 bg-white shadow-lg rounded-md border border-gray-200 z-50
93+ overflow-hidden transition-all duration-300 ease-in-out
94+ ${ isServicesOpen ? 'max-h-[500px] opacity-100' : 'max-h-0 opacity-0' } ` }
95+ onMouseEnter = { ( ) => setIsServicesOpen ( true ) }
96+ onMouseLeave = { ( ) => setIsServicesOpen ( false ) }
97+ >
98+ < Link to = "/categories/workers" className = "block px-4 py-2 text-gray-700 hover:bg-gray-100" > Worker</ Link >
99+ { /* <Link to="/categories/houseowners" className="block px-4 py-2 text-gray-700 hover:bg-gray-100">Home Owners</Link> */ }
100+ < Link to = "/categories/architects" className = "block px-4 py-2 text-gray-700 hover:bg-gray-100" > Architects/Designers</ Link >
101+ < Link to = "/categories/contractors" className = "block px-4 py-2 text-gray-700 hover:bg-gray-100" > Contractors</ Link >
102+ < Link to = "/categories/developers" className = "block px-4 py-2 text-gray-700 hover:bg-gray-100" > Developers</ Link >
103+ < Link to = "/categories/suppliers" className = "block px-4 py-2 text-gray-700 hover:bg-gray-100" > Material Suppliers</ Link >
104+ </ div >
105+ </ div >
106+
77107 < Link to = "/blog" className = "text-foreground hover:text-primary transition-colors" > { t ( 'common.blog' ) } </ Link >
78108 < Link to = "/about" className = "text-foreground hover:text-primary transition-colors" > { t ( 'common.about' ) } </ Link >
79109 < Link to = "/contact" className = "text-foreground hover:text-primary transition-colors" > { t ( 'common.contact' ) } </ Link >
@@ -129,40 +159,36 @@ const Navbar: React.FC = () => {
129159 } }
130160 />
131161 </ div >
132- < Link
133- to = "/"
134- className = "block px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors"
135- onClick = { ( ) => setIsOpen ( false ) }
136- >
137- { "Home" }
138- </ Link >
139- < Link
140- to = "/services"
141- className = "block px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors"
142- onClick = { ( ) => setIsOpen ( false ) }
143- >
144- { t ( 'common.services' ) }
145- </ Link >
146- < Link to = "/blog"
147- className = "block px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors"
148- onClick = { ( ) => setIsOpen ( false ) }
149- >
150- { t ( 'common.blog' ) }
151- </ Link >
152- < Link
153- to = "/about"
154- className = "block px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors"
155- onClick = { ( ) => setIsOpen ( false ) }
156- >
157- { t ( 'common.about' ) }
158- </ Link >
159- < Link
160- to = "/contact"
161- className = "block px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors"
162- onClick = { ( ) => setIsOpen ( false ) }
162+
163+ < Link to = "/" className = "block px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors" onClick = { ( ) => setIsOpen ( false ) } > Home</ Link >
164+
165+ { /* Services main link (redirect only) */ }
166+ < Link to = "/services" className = "block px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors" onClick = { ( ) => setIsOpen ( false ) } > Services</ Link >
167+
168+ { /* New "All Services" mobile button */ }
169+ < button
170+ className = "w-full text-left px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors flex justify-between items-center"
171+ onClick = { ( ) => setIsMobileServicesOpen ( ! isMobileServicesOpen ) }
163172 >
164- { t ( 'common.contact' ) }
165- </ Link >
173+ { t ( 'common.solutions' ) }
174+ < span className = { `transform transition-transform duration-200 ${ isMobileServicesOpen ? 'rotate-180' : 'rotate-0' } ` } > ▼</ span >
175+ </ button >
176+
177+ { isMobileServicesOpen && (
178+ < div className = "pl-4 mt-2 space-y-1" >
179+ < Link to = "/categories/workers" className = "block px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-md" onClick = { ( ) => setIsOpen ( false ) } > Worker</ Link >
180+ { /* <Link to="/categories/houseowners" className="block px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-md" onClick={() => setIsOpen(false)}>Home Owners</Link> */ }
181+ < Link to = "/categories/architects" className = "block px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-md" onClick = { ( ) => setIsOpen ( false ) } > Architects/Designers</ Link >
182+ < Link to = "/categories/contractors" className = "block px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-md" onClick = { ( ) => setIsOpen ( false ) } > Contractors</ Link >
183+ < Link to = "/categories/developers" className = "block px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-md" onClick = { ( ) => setIsOpen ( false ) } > Developers</ Link >
184+ < Link to = "/categories/suppliers" className = "block px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-md" onClick = { ( ) => setIsOpen ( false ) } > Material Suppliers</ Link >
185+ </ div >
186+ ) }
187+
188+ < Link to = "/blog" className = "block px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors" onClick = { ( ) => setIsOpen ( false ) } > Blog</ Link >
189+ < Link to = "/about" className = "block px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors" onClick = { ( ) => setIsOpen ( false ) } > About</ Link >
190+ < Link to = "/contact" className = "block px-3 py-2 rounded-md text-base font-medium text-foreground hover:bg-muted hover:text-primary transition-colors" onClick = { ( ) => setIsOpen ( false ) } > Contact</ Link >
191+
166192 < div className = "pt-2 space-y-2" >
167193
168194 { /* Profile Button added above sign out */ }
0 commit comments