This commit is contained in:
AyrisAI
2026-07-11 16:15:26 +03:00
parent ccb923e57a
commit ac78e5bf40
16 changed files with 504 additions and 322 deletions
+24 -17
View File
@@ -7,17 +7,23 @@ import { usePathname } from "next/navigation";
import { motion, AnimatePresence } from "framer-motion";
import { Menu, X, Globe } from "lucide-react";
const navLinks = [
// { name: "Odalar", href: "/odalar" },
{ name: "Aktiviteler", href: "/aktiviteler" },
{ name: "Restoran", href: "/restoran" },
{ name: "Etkinlikler", href: "/etkinlikler" },
{ name: "Hakkımızda", href: "/hakkimizda" },
{ name: "İletişim", href: "/iletisim" },
const navLinksEn = [
{ name: "Activities", href: "/en/aktiviteler" },
{ name: "Restaurant", href: "/en/restoran" },
{ name: "Events", href: "/en/etkinlikler" },
{ name: "About Us", href: "/en/hakkimizda" },
{ name: "Contact", href: "/en/iletisim" },
];
export default function Navbar() {
const navLinksTr = [
{ name: "Aktiviteler", href: "/tr/aktiviteler" },
{ name: "Restoran", href: "/tr/restoran" },
{ name: "Etkinlikler", href: "/tr/etkinlikler" },
{ name: "Hakkımızda", href: "/tr/hakkimizda" },
{ name: "İletişim", href: "/tr/iletisim" },
];
export default function Navbar({ lang }: { lang?: string }) {
const [isOpen, setIsOpen] = useState(false);
const [scrolled, setScrolled] = useState(false);
const pathname = usePathname();
@@ -30,10 +36,11 @@ export default function Navbar() {
useEffect(() => { setIsOpen(false); }, [pathname]);
const isHome = pathname === "/" || pathname === "/tr" || pathname === "/en";
const currentLang = pathname.startsWith("/en") ? "en" : "tr";
const currentLang = lang || (pathname.startsWith("/en") ? "en" : "tr");
const toggleLang = currentLang === "en" ? "tr" : "en";
const navLinks = currentLang === "en" ? navLinksEn : navLinksTr;
const isHome = pathname === "/" || pathname === "/tr" || pathname === "/en";
const getToggleHref = () => {
if (pathname === "/") return `/${toggleLang}`;
@@ -55,7 +62,7 @@ export default function Navbar() {
<div className="flex justify-between items-center">
{/* Logo */}
<Link href="/" className="flex-shrink-0 flex items-center group">
<Link href={`/${currentLang}`} className="flex-shrink-0 flex items-center group">
<Image
src="/logo.png"
alt="Kite Beach Logo"
@@ -91,10 +98,10 @@ export default function Navbar() {
})}
<Link
href="/iletisim"
href={`/${currentLang}/iletisim`}
className="btn-shimmer bg-accent text-white px-6 py-2.5 rounded-full text-[11px] font-bold tracking-[0.12em] uppercase hover:bg-accent/90 transition-colors shadow-md"
>
Bize Ulaşın
{currentLang === "en" ? "Contact Us" : "Bize Ulaşın"}
</Link>
{/* Lang Toggle */}
@@ -160,10 +167,10 @@ export default function Navbar() {
{currentLang === "tr" ? "English" : "Türkçe"}
</Link>
<Link
href="/iletisim"
href={`/${currentLang}/iletisim`}
className="mt-4 block w-full text-center bg-accent text-white px-6 py-3.5 rounded-full text-sm font-bold uppercase tracking-wider"
>
Bize Ulaşın
{currentLang === "en" ? "Contact Us" : "Bize Ulaşın"}
</Link>
</div>
</motion.div>