diff --git a/components/admin/admin-header.tsx b/components/admin/admin-header.tsx index c5d8105..f15df0e 100644 --- a/components/admin/admin-header.tsx +++ b/components/admin/admin-header.tsx @@ -11,13 +11,11 @@ import { ClipboardListIcon, MessagesSquareIcon, LogOutIcon, - MenuIcon, PlusIcon, SwordsIcon, } from "lucide-react"; -import { Button, buttonVariants } from "@/components/ui/button"; -import { Sheet, SheetClose, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet"; +import { Button } from "@/components/ui/button"; import { authClient } from "@/lib/auth/client"; import { unsubscribeCommissionPush } from "@/components/commission/push-client"; import { CommissionPushEntryPrompt } from "@/components/commission/push-entry-prompt"; @@ -25,15 +23,6 @@ import { CommissionPushEntryPrompt } from "@/components/commission/push-entry-pr export function AdminHeader() { const pathname = usePathname(); const router = useRouter(); - const mobileLinks = [ - { href: "/admin/commission", label: "Commission", icon: MessagesSquareIcon, active: pathname.startsWith("/admin/commission") }, - { href: "/admin/stygian", label: "Stygian", icon: SwordsIcon, active: pathname === "/admin/stygian" }, - { href: "/admin/activity", label: "Activity", icon: ClipboardListIcon, active: pathname === "/admin/activity" }, - { href: "/admin/glossary", label: "Glossary", icon: BookOpenIcon, active: pathname === "/admin/glossary" }, - { href: "/admin", label: "Dashboard", icon: LayoutDashboardIcon, active: pathname === "/admin" }, - { href: "/admin/create", label: "New Guide", icon: PlusIcon, active: pathname === "/admin/create" }, - { href: "/admin/image/overview", label: "Image Generator", icon: ImageIcon, active: pathname.startsWith("/admin/image") }, - ]; const signOut = async () => { await unsubscribeCommissionPush().catch(() => undefined); await authClient.signOut({ @@ -56,57 +45,62 @@ export function AdminHeader() { className="mr-auto flex min-h-11 shrink-0 items-center gap-3 rounded-lg font-heading font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" > - ไกด์เกนชินไม่ใช่เกมมือถือ + ไกด์เกนชินไม่ใช่เกมมือถือ - + }> - Commission + size="sm" nativeButton={false} render={} aria-label="Commission"> + Commission } + aria-label="Stygian" > - Stygian + Stygian } + aria-label="Activity" > - Activity + Activity } + aria-label="Glossary" > - Glossary + Glossary } + aria-label="Dashboard" > - Dashboard + Dashboard } + aria-label="New Guide" > - New Guide + New Guide } + aria-label="Image Generator" > - Image Generator + Image Generator - - }> - - - - เมนูแอดมิน - - {mobileLinks.map(({ href, label, icon: Icon, active }) => ( - } - > - {label} - - ))} - }> - เปิดหน้าเว็บไซต์ - - - ออกจากระบบ - - - - > diff --git a/components/public/site-header.tsx b/components/public/site-header.tsx index ef652b1..af63c7f 100644 --- a/components/public/site-header.tsx +++ b/components/public/site-header.tsx @@ -1,28 +1,20 @@ import Image from "next/image"; import Link from "next/link"; import { Suspense } from "react"; -import { MenuIcon } from "lucide-react"; +import { PencilIcon } from "lucide-react"; -import { Button, buttonVariants } from "@/components/ui/button"; -import { Sheet, SheetClose, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet"; +import { Button } from "@/components/ui/button"; import { VisitorPresence } from "@/components/public/visitor-presence"; import { getAdminSession } from "@/lib/auth/server"; -async function AdminEditLink({ editHref, mobile = false }: { editHref: string; mobile?: boolean }) { +async function AdminEditLink({ editHref }: { editHref: string }) { const isAdmin = Boolean(await getAdminSession()); return isAdmin ? ( - mobile ? ( - } - > - ไปหน้าแก้ไข - - ) : ( - }> - ไปหน้าแก้ไข - - ) + } aria-label="ไปหน้าแก้ไข"> + + ไปหน้าแก้ไข + ) : null; } @@ -36,48 +28,30 @@ export function SiteHeader({ editHref = "/admin", guideId }: { editHref?: string className="mr-auto flex min-h-11 shrink-0 items-center gap-3 rounded-lg font-heading font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" > - ไกด์เกนชินไม่ใช่เกมมือถือ + ไกด์เกนชินไม่ใช่เกมมือถือ - - }> + + } aria-label="Commission"> - Commission + Commission } + aria-label="Stygian Guide" > - Stygian Guide + Stygian Guide - - - }> - - - - เมนู - - }> - - Commission - - }> - - Stygian Guide - - - - - - - + + + ); diff --git a/components/public/visitor-presence.tsx b/components/public/visitor-presence.tsx index ee5879c..2716ecc 100644 --- a/components/public/visitor-presence.tsx +++ b/components/public/visitor-presence.tsx @@ -11,22 +11,19 @@ export function VisitorPresence({ guideId }: { guideId?: string }) { - ทั้งหมด {counts?.global ?? "-"} + ทั้งหมด {counts?.global ?? "-"} {guideId ? ( - ไกด์นี้ - G {counts?.guide ?? "-"} + ไกด์นี้ {counts?.guide ?? "-"} ) : null}