|
|
|
|
@ -6,7 +6,7 @@ import { Heart, Menu, X } from "lucide-react";
|
|
|
|
|
import { ThemeToggle } from "@/components/ThemeToggle";
|
|
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
|
import { LoginDialog } from "@/components/LoginDialog";
|
|
|
|
|
import { useRouter } from "next/navigation";
|
|
|
|
|
import { useRouter, usePathname } from "next/navigation";
|
|
|
|
|
import Link from "next/link";
|
|
|
|
|
import { useAppTheme } from "@/components/ThemeProvider";
|
|
|
|
|
|
|
|
|
|
@ -16,6 +16,8 @@ export function Navbar() {
|
|
|
|
|
const [loginDialogOpen, setLoginDialogOpen] = useState(false);
|
|
|
|
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const pathname = usePathname();
|
|
|
|
|
const isUserDashboard = pathname?.startsWith("/user/dashboard");
|
|
|
|
|
|
|
|
|
|
const scrollToSection = (id: string) => {
|
|
|
|
|
const element = document.getElementById(id);
|
|
|
|
|
@ -71,37 +73,41 @@ export function Navbar() {
|
|
|
|
|
</motion.div>
|
|
|
|
|
|
|
|
|
|
{/* Desktop Navigation */}
|
|
|
|
|
<div className="hidden lg:flex items-center gap-4 xl:gap-6">
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("about")}
|
|
|
|
|
className={`text-sm font-medium transition-colors cursor-pointer px-3 py-2 rounded-lg ${isDark ? 'text-gray-300 hover:text-white hover:bg-gray-800' : 'text-gray-700 hover:text-primary hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
About
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("services")}
|
|
|
|
|
className={`text-sm font-medium transition-colors cursor-pointer px-3 py-2 rounded-lg ${isDark ? 'text-gray-300 hover:text-white hover:bg-gray-800' : 'text-gray-700 hover:text-primary hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
Services
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("contact")}
|
|
|
|
|
className={`text-sm font-medium transition-colors cursor-pointer px-3 py-2 rounded-lg ${isDark ? 'text-gray-300 hover:text-white hover:bg-gray-800' : 'text-gray-700 hover:text-primary hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
Contact
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
{!isUserDashboard && (
|
|
|
|
|
<div className="hidden lg:flex items-center gap-4 xl:gap-6">
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("about")}
|
|
|
|
|
className={`text-sm font-medium transition-colors cursor-pointer px-3 py-2 rounded-lg ${isDark ? 'text-gray-300 hover:text-white hover:bg-gray-800' : 'text-gray-700 hover:text-primary hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
About
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("services")}
|
|
|
|
|
className={`text-sm font-medium transition-colors cursor-pointer px-3 py-2 rounded-lg ${isDark ? 'text-gray-300 hover:text-white hover:bg-gray-800' : 'text-gray-700 hover:text-primary hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
Services
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("contact")}
|
|
|
|
|
className={`text-sm font-medium transition-colors cursor-pointer px-3 py-2 rounded-lg ${isDark ? 'text-gray-300 hover:text-white hover:bg-gray-800' : 'text-gray-700 hover:text-primary hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
Contact
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* Desktop Actions */}
|
|
|
|
|
<div className="hidden lg:flex items-center gap-2">
|
|
|
|
|
<Button
|
|
|
|
|
size="sm"
|
|
|
|
|
variant="outline"
|
|
|
|
|
className={`hover:opacity-90 hover:scale-105 transition-all text-xs sm:text-sm ${isDark ? 'border-gray-700 text-gray-300 hover:bg-gray-800' : ''}`}
|
|
|
|
|
onClick={() => setLoginDialogOpen(true)}
|
|
|
|
|
>
|
|
|
|
|
Sign In
|
|
|
|
|
</Button>
|
|
|
|
|
{!isUserDashboard && (
|
|
|
|
|
<Button
|
|
|
|
|
size="sm"
|
|
|
|
|
variant="outline"
|
|
|
|
|
className={`hover:opacity-90 hover:scale-105 transition-all text-xs sm:text-sm ${isDark ? 'border-gray-700 text-gray-300 hover:bg-gray-800' : ''}`}
|
|
|
|
|
onClick={() => setLoginDialogOpen(true)}
|
|
|
|
|
>
|
|
|
|
|
Sign In
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
|
|
|
|
<ThemeToggle />
|
|
|
|
|
<Button size="sm" className="hover:opacity-90 hover:scale-105 transition-all text-xs sm:text-sm" asChild>
|
|
|
|
|
<a href="/book-now">Book Now</a>
|
|
|
|
|
@ -155,36 +161,42 @@ export function Navbar() {
|
|
|
|
|
>
|
|
|
|
|
<div className="flex flex-col p-4 sm:p-6 space-y-3 sm:space-y-4">
|
|
|
|
|
{/* Mobile Navigation Links */}
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("about")}
|
|
|
|
|
className={`text-left text-sm sm:text-base font-medium py-2.5 sm:py-3 px-3 sm:px-4 rounded-lg transition-colors ${isDark ? 'text-gray-300 hover:bg-gray-800' : 'text-gray-700 hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
About
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("services")}
|
|
|
|
|
className={`text-left text-sm sm:text-base font-medium py-2.5 sm:py-3 px-3 sm:px-4 rounded-lg transition-colors ${isDark ? 'text-gray-300 hover:bg-gray-800' : 'text-gray-700 hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
Services
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("contact")}
|
|
|
|
|
className={`text-left text-sm sm:text-base font-medium py-2.5 sm:py-3 px-3 sm:px-4 rounded-lg transition-colors ${isDark ? 'text-gray-300 hover:bg-gray-800' : 'text-gray-700 hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
Contact
|
|
|
|
|
</button>
|
|
|
|
|
{!isUserDashboard && (
|
|
|
|
|
<>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("about")}
|
|
|
|
|
className={`text-left text-sm sm:text-base font-medium py-2.5 sm:py-3 px-3 sm:px-4 rounded-lg transition-colors ${isDark ? 'text-gray-300 hover:bg-gray-800' : 'text-gray-700 hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
About
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("services")}
|
|
|
|
|
className={`text-left text-sm sm:text-base font-medium py-2.5 sm:py-3 px-3 sm:px-4 rounded-lg transition-colors ${isDark ? 'text-gray-300 hover:bg-gray-800' : 'text-gray-700 hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
Services
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => scrollToSection("contact")}
|
|
|
|
|
className={`text-left text-sm sm:text-base font-medium py-2.5 sm:py-3 px-3 sm:px-4 rounded-lg transition-colors ${isDark ? 'text-gray-300 hover:bg-gray-800' : 'text-gray-700 hover:bg-gray-100'}`}
|
|
|
|
|
>
|
|
|
|
|
Contact
|
|
|
|
|
</button>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<div className={`border-t pt-3 sm:pt-4 mt-3 sm:mt-4 space-y-2 sm:space-y-3 ${isDark ? 'border-gray-700' : 'border-gray-200'}`}>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
className={`w-full justify-start text-sm sm:text-base ${isDark ? 'border-gray-700 text-gray-300 hover:bg-gray-800' : ''}`}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setLoginDialogOpen(true);
|
|
|
|
|
setMobileMenuOpen(false);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
Sign In
|
|
|
|
|
</Button>
|
|
|
|
|
{!isUserDashboard && (
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
className={`w-full justify-start text-sm sm:text-base ${isDark ? 'border-gray-700 text-gray-300 hover:bg-gray-800' : ''}`}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setLoginDialogOpen(true);
|
|
|
|
|
setMobileMenuOpen(false);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
Sign In
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
|
|
|
|
<Button
|
|
|
|
|
className="w-full justify-start bg-gradient-to-r from-rose-500 to-pink-600 hover:from-rose-600 hover:to-pink-700 text-white text-sm sm:text-base"
|
|
|
|
|
asChild
|
|
|
|
|
|