Header: an account menu under the user's name
Profile, invoices, redeeming a code and logging out moved from the crowded top right and the main menu into a menu that opens from the name; on phones the name shows too (shortened), so the profile stays reachable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -2,8 +2,8 @@ import Link from "next/link";
|
||||
|
||||
import type { Me } from "@/lib/types";
|
||||
|
||||
import { LogoutButton } from "./LogoutButton";
|
||||
import { NavLinks } from "./NavLinks";
|
||||
import { UserMenu } from "./UserMenu";
|
||||
|
||||
/** The mark: the orbit, the thread (an S, with the crossbar an f) and a star on the rim. */
|
||||
export function LogoMark({ className = "logo-mark" }: { className?: string }) {
|
||||
@@ -91,8 +91,6 @@ export function SiteHeader({ me }: { me: Me }) {
|
||||
{ href: "/osszevetesek", label: "Összevetések" },
|
||||
{ href: "/kartyajoslas", label: "Kártyajóslás" },
|
||||
{ href: "/csomagok", label: "Csomagok" },
|
||||
...(me.invoice_count > 0 ? [{ href: "/szamlak", label: "Számláim" }] : []),
|
||||
{ href: "/profil", label: "Profil" },
|
||||
];
|
||||
if (me.user.roles.includes("admin")) links.push({ href: "/admin", label: "Admin" });
|
||||
return (
|
||||
@@ -101,11 +99,7 @@ export function SiteHeader({ me }: { me: Me }) {
|
||||
<NavLinks links={links} />
|
||||
<div className="who">
|
||||
<PackageBadge me={me} />
|
||||
<Link href="/bevaltas" className="redeem-link">
|
||||
Kód beváltása
|
||||
</Link>
|
||||
<span className="who-name">{me.user.display_name || me.user.email}</span>
|
||||
<LogoutButton />
|
||||
<UserMenu name={me.user.display_name || me.user.email} invoices={me.invoice_count > 0} />
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user