diff --git a/components/app-shell.tsx b/components/app-shell.tsx index f69d0f1..69015a8 100644 --- a/components/app-shell.tsx +++ b/components/app-shell.tsx @@ -1,7 +1,6 @@ "use client"; import { Icon } from "@iconify/react"; -import Link from "next/link"; import { usePathname } from "@/i18n/routing"; import { AnnouncementBar } from "poyraz-ui/organisms"; import { SiteNavbar } from "@/components/site-navbar"; @@ -32,7 +31,6 @@ export function AppShell({ children }: AppShellProps) { } const localizedText = announcement ? getLocalizedValue(announcement.text, locale) : ""; - const localizedActionLabel = announcement ? getLocalizedValue(announcement.actionLabel, locale) : ""; return ( <> @@ -45,18 +43,6 @@ export function AppShell({ children }: AppShellProps) { variant="branded" dismissible={false} icon={} - action={ - localizedActionLabel && announcement.actionHref ? ( - - {localizedActionLabel} - - ) : null - } > {localizedText} diff --git a/components/language-switcher.tsx b/components/language-switcher.tsx index 2a70020..e67cfb6 100644 --- a/components/language-switcher.tsx +++ b/components/language-switcher.tsx @@ -2,6 +2,7 @@ import { useLocale } from "next-intl"; import { useRouter, usePathname } from "@/i18n/routing"; +import { Button } from "poyraz-ui/atoms"; export function LanguageSwitcher() { const locale = useLocale(); @@ -14,13 +15,16 @@ export function LanguageSwitcher() { }; return ( - + ); } diff --git a/components/site-navbar.tsx b/components/site-navbar.tsx index d3be3a2..15feb58 100644 --- a/components/site-navbar.tsx +++ b/components/site-navbar.tsx @@ -5,11 +5,12 @@ import dynamic from "next/dynamic"; import { Link, usePathname } from "@/i18n/routing"; import { useLocale, useTranslations } from "next-intl"; import { LanguageSwitcher } from "@/components/language-switcher"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { - Avatar, - AvatarFallback, - AvatarImage, + Button, + ButtonIcon, + ButtonLabel, + Logo, Separator, } from "poyraz-ui/atoms"; import { @@ -24,7 +25,15 @@ import { SheetContent, SheetTitle, SheetTrigger, + Tabs, + TabsList, + TabsTrigger, + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, } from "poyraz-ui/molecules"; +import { NavbarTopBar, NavbarTopBarSection } from "poyraz-ui/organisms"; import { useKeyboardShortcutLabel } from "@/lib/use-keyboard-shortcut-label"; import { getResumeHref, NAV_LINKS, SOCIAL_LINKS, TOP_ICON_LINKS } from "@/lib/links"; @@ -33,15 +42,66 @@ const SearchCommand = dynamic( { ssr: false }, ); +const glassActionClassName = + "!border-border/80 hover:!border-border focus-visible:!border-border data-[state=open]:!border-border"; + +const slowShineClassName = "[--poyraz-motion-duration-deliberate:1100ms]"; + function getNavLinkClass(isActive: boolean) { return [ - "inline-flex border-b-2 pb-1 text-sm transition-colors", + "inline-flex border-b-2 pb-1 text-sm transition-colors md:border-0 md:pb-0", isActive ? "border-red-600 text-foreground" : "border-transparent text-foreground/55 hover:text-foreground", ].join(" "); } +type ThemeMode = "light" | "dark"; + +function applyTheme(theme: ThemeMode) { + document.documentElement.dataset.poyrazTheme = theme; + document.documentElement.style.colorScheme = theme; + localStorage.setItem("poyraz-theme", theme); +} + +function getInitialTheme(): ThemeMode { + if (typeof window === "undefined") return "light"; + + const storedTheme = localStorage.getItem("poyraz-theme"); + if (storedTheme === "dark" || storedTheme === "light") return storedTheme; + + return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; +} + +function ThemeToggle() { + const [theme, setTheme] = useState(getInitialTheme); + const nextTheme = theme === "dark" ? "light" : "dark"; + const label = theme === "dark" ? "Light mode" : "Dark mode"; + + useEffect(() => { + applyTheme(theme); + }, [theme]); + + return ( + + ); +} + export function SiteNavbar() { const pathname = usePathname(); const [searchOpen, setSearchOpen] = useState(false); @@ -54,27 +114,69 @@ export function SiteNavbar() { return pathname === href || pathname.startsWith(`${href}/`); }; + const activeTab = NAV_LINKS.find((item) => isActiveLink(item.href))?.id; + const languageLabel = locale === "tr" ? "Switch to English" : "Türkçe'ye geç"; + return (
-
- {TOP_ICON_LINKS.map((item) => { - const href = item.id === "cv" ? getResumeHref(locale) : item.href; - return ( - - - - ); - })} - -
+ + + + {TOP_ICON_LINKS.map((item) => { + const href = item.id === "cv" ? getResumeHref(locale) : item.href; + const label = t.has(item.id) ? t(item.id) : item.label; + + return ( + + + + + + {label} + + + ); + })} + + + + + + + {languageLabel} + + + + + + + + + {locale === "tr" ? "Tema değiştir" : "Toggle theme"} + + + + +
- - - - PA - - +
-
))} - - + + - + - - - - {t("social")} + + + - + {t("socialLinks")} {SOCIAL_LINKS.map((item) => ( - - + {item.label} - + ))} @@ -157,19 +291,45 @@ export function SiteNavbar() {
+ + - - - {t("menu")} + + {t("mobileMenu")}
- +