App header: gold marks, a "Felfedezés" dropdown, the Moon today
- Menu items with gold astrological marks (☉ ☽ ☌, card, box); the free pages (signs, famous people, moon calendar, retrogrades) in one "Felfedezés" dropdown with a line about each, opened by a click - A starry header band with a gold edge; the current item has a glowing gold underline - "Ma: Hold a ♉ Bikában" with the Moon's phase drawn as it is lit, to the moon calendar (narrower screens: the phase and the glyph) - The ☰ menu grouped: the Moon today, Saját, Felfedezés · ingyenes as tiles, Csomagok with the package; it covers the page now - Laptops (1440px) keep the row on one line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import Link from "next/link";
|
||||
|
||||
import type { Me } from "@/lib/types";
|
||||
import type { Me, SkyNow } from "@/lib/types";
|
||||
|
||||
import { MobileMenu } from "./MobileMenu";
|
||||
import { NavLinks } from "./NavLinks";
|
||||
import { MoonChip } from "./MoonChip";
|
||||
import { type NavGroup, type NavItem, 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. */
|
||||
@@ -128,23 +129,47 @@ function PackageBadge({ me }: { me: Me }) {
|
||||
);
|
||||
}
|
||||
|
||||
export function SiteHeader({ me }: { me: Me }) {
|
||||
const links = [
|
||||
{ href: "/keplet", label: "Képletem" },
|
||||
{ href: "/szemelyek", label: "Személyek" },
|
||||
{ href: "/osszevetesek", label: "Összevetések" },
|
||||
{ href: "/kartyajoslas", label: "Kártyajóslás" },
|
||||
{ href: "/csillagjegyek", label: "Csillagjegyek" },
|
||||
{ href: "/hires-emberek", label: "Híres emberek" },
|
||||
{ href: "/csomagok", label: "Csomagok" },
|
||||
/** The free pages: in the menu row one dropdown, in the ☰ menu a group of tiles. */
|
||||
const EXPLORE: NavItem[] = [
|
||||
{ href: "/csillagjegyek", label: "Csillagjegyek", icon: "signs", note: "A tizenkét jegy jellemzése" },
|
||||
{ href: "/hires-emberek", label: "Híres emberek", icon: "famous", note: "Ismert emberek képlete és elemzése" },
|
||||
{ href: "/holdnaptar", label: "Holdnaptár", icon: "moon", note: "Holdfázisok, fogyatkozások, holdjegyek" },
|
||||
{ href: "/retrograd", label: "Retrográd bolygók", icon: "retro", note: "Mikor retrográd a Merkúr és a többi" },
|
||||
];
|
||||
|
||||
/**
|
||||
* The header of the logged-in app: the menu with gold marks (the free pages
|
||||
* in one "Felfedezés" dropdown), the Moon today, the package and the account.
|
||||
* Below 1380px the menu moves behind ☰, grouped.
|
||||
*/
|
||||
export function SiteHeader({ me, sky }: { me: Me; sky?: SkyNow | null }) {
|
||||
const own: NavItem[] = [
|
||||
{ href: "/keplet", label: "Képletem", icon: "chart" },
|
||||
{ href: "/szemelyek", label: "Személyek", icon: "persons" },
|
||||
{ href: "/osszevetesek", label: "Összevetések", icon: "compare" },
|
||||
{ href: "/kartyajoslas", label: "Kártyajóslás", icon: "tarot" },
|
||||
];
|
||||
if (me.user.roles.includes("admin")) links.push({ href: "/admin", label: "Admin" });
|
||||
else if (me.user.roles.includes("creator")) links.push({ href: "/admin/hires-emberek", label: "Szerző" });
|
||||
const packages: NavItem = { href: "/csomagok", label: "Csomagok", icon: "packages" };
|
||||
const team: NavItem[] = me.user.roles.includes("admin")
|
||||
? [{ href: "/admin", label: "Admin", icon: "admin" }]
|
||||
: me.user.roles.includes("creator")
|
||||
? [{ href: "/admin/hires-emberek", label: "Szerző", icon: "admin" }]
|
||||
: [];
|
||||
const entries: (NavItem | NavGroup)[] = [
|
||||
...own,
|
||||
{ label: "Felfedezés", icon: "explore", title: "Ingyenes, mindenkinek", items: EXPLORE },
|
||||
packages,
|
||||
...team,
|
||||
];
|
||||
const { natal, synastry } = me.analyses_left;
|
||||
const left = natal + synastry;
|
||||
const packageNote = me.package ? `${me.package.name} · ${left} elemzés` : left > 0 ? `${left} elemzés` : undefined;
|
||||
return (
|
||||
<header className="site-header">
|
||||
<header className="site-header app-header">
|
||||
<Logo />
|
||||
<NavLinks links={links} />
|
||||
<NavLinks entries={entries} />
|
||||
<div className="who">
|
||||
{sky && <MoonChip sky={sky} />}
|
||||
<PackageBadge me={me} />
|
||||
<UserMenu
|
||||
name={me.user.display_name || me.user.email}
|
||||
@@ -152,7 +177,15 @@ export function SiteHeader({ me }: { me: Me }) {
|
||||
replies={me.feedback_replies_unseen ?? 0}
|
||||
/>
|
||||
</div>
|
||||
<MobileMenu className="mobile-menu-app" sections={[{ links }]} />
|
||||
<MobileMenu
|
||||
className="mobile-menu-app"
|
||||
lead={sky ? <MoonChip sky={sky} /> : undefined}
|
||||
sections={[
|
||||
{ title: "Saját", links: own },
|
||||
{ title: "Felfedezés · ingyenes", grid: true, links: EXPLORE.map(({ note: _note, ...l }) => l) },
|
||||
{ links: [{ ...packages, note: packageNote }, ...team] },
|
||||
]}
|
||||
/>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user