Merge main: new app header (marks, Felfedezés dropdown, the Moon today), package cards text
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -1675,3 +1675,76 @@ span.tarot-fan-card { cursor: default; }
|
||||
.nps-score { min-width: 34px; }
|
||||
}
|
||||
.contact-card p { margin: 0; }
|
||||
|
||||
/* The app header (logged in): a starry band with a gold edge, menu items with
|
||||
gold marks, the free pages in one dropdown, and the Moon today. */
|
||||
.app-header {
|
||||
background:
|
||||
radial-gradient(1px 1px at 22% 28%, rgba(236, 230, 216, 0.6), transparent 60%),
|
||||
radial-gradient(1px 1px at 47% 72%, rgba(236, 230, 216, 0.4), transparent 60%),
|
||||
radial-gradient(1.5px 1.5px at 66% 20%, rgba(217, 180, 106, 0.7), transparent 60%),
|
||||
radial-gradient(1px 1px at 83% 70%, rgba(236, 230, 216, 0.45), transparent 60%),
|
||||
radial-gradient(1px 1px at 95% 30%, rgba(236, 230, 216, 0.5), transparent 60%),
|
||||
rgba(15, 21, 40, 0.95);
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
.app-header::after {
|
||||
content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
|
||||
background: linear-gradient(90deg, rgba(217, 180, 106, 0), rgba(217, 180, 106, 0.6) 30%, rgba(217, 180, 106, 0.6) 70%, rgba(217, 180, 106, 0));
|
||||
}
|
||||
.nav-icon { width: 17px; height: 17px; flex: none; color: rgba(217, 180, 106, 0.8); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
|
||||
.nav-icon.sym { width: auto; height: auto; font-size: 17px; line-height: 1; text-align: center; min-width: 17px; }
|
||||
.nav-icon .nav-icon-fill { fill: currentColor; stroke: none; }
|
||||
.app-nav { gap: 2px; align-items: center; }
|
||||
.app-nav > a, .nav-group-button {
|
||||
display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 11px;
|
||||
color: var(--ink-2); text-decoration: none; border-radius: 8px 8px 0 0; border-bottom: 2px solid transparent; font-size: 15px;
|
||||
}
|
||||
.app-nav > a:hover, .nav-group-button:hover { color: var(--ink); background: rgba(217, 180, 106, 0.06); }
|
||||
.app-nav > a[aria-current="page"], .nav-group-button.is-active {
|
||||
color: var(--ink); background: none; border-bottom-color: var(--gold); box-shadow: 0 7px 12px -9px rgba(217, 180, 106, 0.9);
|
||||
}
|
||||
.app-nav > a[aria-current="page"] .nav-icon, .nav-group-button.is-active .nav-icon { color: var(--gold); }
|
||||
.nav-group { position: relative; }
|
||||
.nav-group-button { background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; cursor: pointer; }
|
||||
.nav-group-button[aria-expanded="true"] { color: var(--gold); background: rgba(217, 180, 106, 0.1); border-radius: 8px; }
|
||||
.nav-group-chevron { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
||||
.nav-group-button[aria-expanded="true"] .nav-group-chevron { transform: rotate(180deg); }
|
||||
.nav-dropdown {
|
||||
position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; width: 340px; padding: 8px;
|
||||
display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line-2);
|
||||
border-radius: 14px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.nav-dropdown-title { padding: 6px 10px 8px; font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold); }
|
||||
.nav-dropdown-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
|
||||
.nav-dropdown-item:hover, .nav-dropdown-item[aria-current="page"] { background: rgba(255, 255, 255, 0.04); color: var(--gold); }
|
||||
.nav-dropdown-item .nav-icon { margin-top: 2px; width: 20px; height: 20px; font-size: 19px; color: var(--gold); }
|
||||
.nav-dropdown-text { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
|
||||
.nav-dropdown-text .hint { font-size: 13px; }
|
||||
.moon-chip {
|
||||
display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 8px; border-radius: 999px;
|
||||
background: rgba(217, 180, 106, 0.08); color: var(--ink); text-decoration: none; font-size: 13px; white-space: nowrap;
|
||||
}
|
||||
.moon-chip:hover { background: rgba(217, 180, 106, 0.14); color: var(--ink); }
|
||||
.moon-chip-glyph { color: var(--gold); font-size: 15px; }
|
||||
.moon-phase-icon { width: 20px; height: 20px; flex: none; }
|
||||
.moon-phase-icon .moon-dark { fill: #1a2238; stroke: var(--gold); stroke-width: 1; }
|
||||
.moon-phase-icon .moon-lit { fill: var(--gold); }
|
||||
@media (max-width: 1760px) { .app-header .who .moon-chip-text { display: none; } .app-header .who .moon-chip { padding: 0 10px 0 8px; } }
|
||||
/* The grouped ☰ menu of the app. */
|
||||
.mobile-menu-panel > .moon-chip { align-self: stretch; min-height: 48px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
|
||||
.mobile-menu-list { display: flex; flex-direction: column; }
|
||||
.mobile-menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
|
||||
.mobile-menu-grid a { border: 1px solid var(--line); font-size: 15px; }
|
||||
.mobile-menu-panel a { gap: 12px; }
|
||||
.mobile-menu-panel a .nav-icon { color: var(--gold); }
|
||||
.mobile-menu-label { flex: 1; min-width: 0; }
|
||||
.mobile-menu-note { font-size: 13px; color: var(--gold); white-space: nowrap; }
|
||||
/* Laptops (1440px): the items closer, so the row still fits next to the account. */
|
||||
@media (max-width: 1520px) {
|
||||
.app-nav > a, .nav-group-button { padding: 10px 7px; gap: 6px; font-size: 14.5px; }
|
||||
.app-header { gap: 16px; }
|
||||
.app-header .who { gap: 8px; }
|
||||
}
|
||||
/* The ☰ panel covers the page fully (the header's blur showed it through). */
|
||||
.mobile-menu-panel { background: #0f1528; }
|
||||
|
||||
@@ -9,6 +9,7 @@ import { SiteFooter } from "@/components/PublicFooter";
|
||||
import { SiteHeader } from "@/components/SiteHeader";
|
||||
import { ValidationMessages } from "@/components/ValidationMessages";
|
||||
import { getMe } from "@/lib/server";
|
||||
import { loadSky } from "@/lib/sky";
|
||||
import { siteUrl } from "@/lib/share";
|
||||
|
||||
import "./globals.css";
|
||||
@@ -31,12 +32,14 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
|
||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
const me = await getMe();
|
||||
// The Moon today in the header (cached for five minutes).
|
||||
const sky = me ? await loadSky() : null;
|
||||
return (
|
||||
<html lang="hu" className={`${cormorant.variable} ${inter.variable}`}>
|
||||
<body>
|
||||
<NightSky />
|
||||
<ValidationMessages />
|
||||
{me && <SiteHeader me={me} />}
|
||||
{me && <SiteHeader me={me} sky={sky} />}
|
||||
{children}
|
||||
{/* At the very bottom, apart from the page content: up top it drew the eye away. */}
|
||||
{me?.nps_due && <NpsBanner />}
|
||||
|
||||
@@ -4,10 +4,14 @@ import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { useEffect, useId, useRef, useState } from "react";
|
||||
|
||||
import { NavIcon, type NavIconName } from "./NavIcon";
|
||||
|
||||
export interface MenuSection {
|
||||
/** A small heading above the group (e.g. "Ingyenes"). */
|
||||
title?: string;
|
||||
links: { href: string; label: string }[];
|
||||
/** Two columns of tiles instead of a list. */
|
||||
grid?: boolean;
|
||||
links: { href: string; label: string; icon?: NavIconName; note?: string }[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -15,7 +19,16 @@ export interface MenuSection {
|
||||
* hidden there, see globals.css). Closes on a click outside, Escape, or
|
||||
* moving to another page. `className` sets the width from which it shows.
|
||||
*/
|
||||
export function MobileMenu({ sections, className }: { sections: MenuSection[]; className: string }) {
|
||||
export function MobileMenu({
|
||||
sections,
|
||||
className,
|
||||
lead,
|
||||
}: {
|
||||
sections: MenuSection[];
|
||||
className: string;
|
||||
/** Shown first in the panel (the Moon today). */
|
||||
lead?: React.ReactNode;
|
||||
}) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const box = useRef<HTMLDivElement>(null);
|
||||
const button = useRef<HTMLButtonElement>(null);
|
||||
@@ -61,9 +74,11 @@ export function MobileMenu({ sections, className }: { sections: MenuSection[]; c
|
||||
</button>
|
||||
{open && (
|
||||
<nav id={panelId} className="mobile-menu-panel" aria-label="Menü">
|
||||
{lead}
|
||||
{sections.map((s, i) => (
|
||||
<div key={i} className="mobile-menu-group">
|
||||
{s.title && <span className="lp-free-label">{s.title}</span>}
|
||||
<div className={s.grid ? "mobile-menu-grid" : "mobile-menu-list"}>
|
||||
{s.links.map((l) => (
|
||||
<Link
|
||||
key={l.href}
|
||||
@@ -71,10 +86,13 @@ export function MobileMenu({ sections, className }: { sections: MenuSection[]; c
|
||||
aria-current={current(l.href) ? "page" : undefined}
|
||||
onClick={() => setOpen(false)}
|
||||
>
|
||||
{l.label}
|
||||
{l.icon && <NavIcon name={l.icon} />}
|
||||
<span className="mobile-menu-label">{l.label}</span>
|
||||
{l.note && <span className="mobile-menu-note">{l.note}</span>}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</nav>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
import Link from "next/link";
|
||||
|
||||
import { SIGNS } from "@/lib/astro";
|
||||
import { SIGN_IN, withArticle } from "@/lib/skyText";
|
||||
import type { SkyNow } from "@/lib/types";
|
||||
|
||||
/** The Moon as it is lit now: the lit part on the right while waxing, on the left while waning. */
|
||||
export function MoonPhaseIcon({
|
||||
illumination,
|
||||
waxing,
|
||||
}: {
|
||||
illumination: number;
|
||||
waxing: boolean;
|
||||
}) {
|
||||
const r = 8.5;
|
||||
const k = Math.min(1, Math.max(0, illumination));
|
||||
const rx = Math.abs(1 - 2 * k) * r;
|
||||
// The outer edge on the lit side, then the terminator back.
|
||||
const outer = waxing ? 1 : 0;
|
||||
const terminator = waxing ? (k > 0.5 ? 1 : 0) : k > 0.5 ? 0 : 1;
|
||||
const d = `M12 ${12 - r}A${r} ${r} 0 0 ${outer} 12 ${12 + r}A${rx} ${r} 0 0 ${terminator} 12 ${12 - r}Z`;
|
||||
return (
|
||||
<svg className="moon-phase-icon" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r={r} className="moon-dark" />
|
||||
<path d={d} className="moon-lit" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* "Ma: Hold a ♉ Bikában" in the header (the moon calendar behind it). Narrow
|
||||
* screens show the phase and the sign's glyph only.
|
||||
*/
|
||||
export function MoonChip({ sky }: { sky: SkyNow }) {
|
||||
const moon = sky.moon;
|
||||
const sign = moon.position.sign;
|
||||
const where = withArticle(SIGN_IN[sign] ?? sign);
|
||||
return (
|
||||
<Link
|
||||
href="/holdnaptar"
|
||||
className="moon-chip"
|
||||
aria-label={`Ma a Hold ${where} jár: holdnaptár`}
|
||||
>
|
||||
<MoonPhaseIcon illumination={moon.illumination} waxing={moon.waxing} />
|
||||
<span className="moon-chip-text" aria-hidden="true">
|
||||
Ma: Hold {where.split(" ")[0]}{" "}
|
||||
</span>
|
||||
<span className="moon-chip-glyph sym" aria-hidden="true">
|
||||
{SIGNS[sign]?.glyph}
|
||||
{"︎"}
|
||||
</span>
|
||||
<span className="moon-chip-text" aria-hidden="true">
|
||||
{" "}
|
||||
{SIGN_IN[sign]}
|
||||
</span>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// Small gold marks before the menu items: astrological glyphs where one fits,
|
||||
// otherwise a line drawing.
|
||||
|
||||
export type NavIconName =
|
||||
| "chart"
|
||||
| "persons"
|
||||
| "compare"
|
||||
| "tarot"
|
||||
| "explore"
|
||||
| "signs"
|
||||
| "famous"
|
||||
| "moon"
|
||||
| "retro"
|
||||
| "packages"
|
||||
| "admin";
|
||||
|
||||
const GLYPHS: Partial<Record<NavIconName, string>> = {
|
||||
chart: "☉",
|
||||
persons: "☽",
|
||||
compare: "☌",
|
||||
explore: "✧",
|
||||
signs: "♈",
|
||||
retro: "☿",
|
||||
};
|
||||
|
||||
export function NavIcon({ name }: { name: NavIconName }) {
|
||||
const glyph = GLYPHS[name];
|
||||
if (glyph) {
|
||||
return (
|
||||
<span className="nav-icon sym" aria-hidden="true">
|
||||
{glyph}
|
||||
{"︎"}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<svg className="nav-icon" viewBox="0 0 24 24" aria-hidden="true">
|
||||
{name === "tarot" && (
|
||||
<>
|
||||
<rect x="5" y="3" width="14" height="18" rx="2.2" />
|
||||
<path
|
||||
d="M12 8l1.2 2.8 2.8 1.2-2.8 1.2L12 16l-1.2-2.8L8 12l2.8-1.2z"
|
||||
className="nav-icon-fill"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{name === "famous" && (
|
||||
<path d="M12 3l2.6 5.6 6.1.7-4.5 4.2 1.2 6L12 16.6 6.6 19.5l1.2-6L3.3 9.3l6.1-.7z" />
|
||||
)}
|
||||
{name === "moon" && (
|
||||
<>
|
||||
<circle cx="12" cy="12" r="8.5" />
|
||||
<path
|
||||
d="M12 3.5a8.5 8.5 0 0 1 0 17a5 8.5 0 0 0 0-17z"
|
||||
className="nav-icon-fill"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{name === "packages" && (
|
||||
<>
|
||||
<path d="M12 2.5l8.5 4.7v9.6L12 21.5l-8.5-4.7V7.2z" />
|
||||
<path d="M3.5 7.2L12 12l8.5-4.8M12 12v9.5" />
|
||||
</>
|
||||
)}
|
||||
{name === "admin" && (
|
||||
<>
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path d="M12 2.5v3M12 18.5v3M2.5 12h3M18.5 12h3M5.3 5.3l2.1 2.1M16.6 16.6l2.1 2.1M5.3 18.7l2.1-2.1M16.6 7.4l2.1-2.1" />
|
||||
</>
|
||||
)}
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -2,16 +2,136 @@
|
||||
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { useEffect, useId, useRef, useState } from "react";
|
||||
|
||||
export function NavLinks({ links }: { links: { href: string; label: string }[] }) {
|
||||
import { NavIcon, type NavIconName } from "./NavIcon";
|
||||
|
||||
export interface NavItem {
|
||||
href: string;
|
||||
label: string;
|
||||
icon: NavIconName;
|
||||
/** One line under the label in a dropdown. */
|
||||
note?: string;
|
||||
}
|
||||
|
||||
export interface NavGroup {
|
||||
label: string;
|
||||
icon: NavIconName;
|
||||
/** The dropdown's small heading. */
|
||||
title: string;
|
||||
items: NavItem[];
|
||||
}
|
||||
|
||||
const isGroup = (e: NavItem | NavGroup): e is NavGroup => "items" in e;
|
||||
|
||||
/**
|
||||
* The app's menu row: items with a gold mark, and a group (the free pages)
|
||||
* that opens on a click as a dropdown. Closes on a click outside, Escape or
|
||||
* moving to another page.
|
||||
*/
|
||||
export function NavLinks({ entries }: { entries: (NavItem | NavGroup)[] }) {
|
||||
const pathname = usePathname();
|
||||
const here = (href: string) => pathname.startsWith(href);
|
||||
return (
|
||||
<nav className="nav app-nav" aria-label="Fő navigáció">
|
||||
{links.map((l) => (
|
||||
<Link key={l.href} href={l.href} aria-current={pathname.startsWith(l.href) ? "page" : undefined}>
|
||||
{l.label}
|
||||
{entries.map((e) =>
|
||||
isGroup(e) ? (
|
||||
<Dropdown
|
||||
key={e.label}
|
||||
group={e}
|
||||
active={e.items.some((i) => here(i.href))}
|
||||
here={here}
|
||||
/>
|
||||
) : (
|
||||
<Link
|
||||
key={e.href}
|
||||
href={e.href}
|
||||
aria-current={here(e.href) ? "page" : undefined}
|
||||
>
|
||||
<NavIcon name={e.icon} />
|
||||
{e.label}
|
||||
</Link>
|
||||
))}
|
||||
),
|
||||
)}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
function Dropdown({
|
||||
group,
|
||||
active,
|
||||
here,
|
||||
}: {
|
||||
group: NavGroup;
|
||||
active: boolean;
|
||||
here: (href: string) => boolean;
|
||||
}) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const box = useRef<HTMLDivElement>(null);
|
||||
const button = useRef<HTMLButtonElement>(null);
|
||||
const id = useId();
|
||||
const pathname = usePathname();
|
||||
|
||||
useEffect(() => setOpen(false), [pathname]);
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
const outside = (e: PointerEvent) => {
|
||||
if (box.current && !box.current.contains(e.target as Node))
|
||||
setOpen(false);
|
||||
};
|
||||
const escape = (e: KeyboardEvent) => {
|
||||
if (e.key === "Escape") {
|
||||
setOpen(false);
|
||||
button.current?.focus();
|
||||
}
|
||||
};
|
||||
document.addEventListener("pointerdown", outside);
|
||||
document.addEventListener("keydown", escape);
|
||||
return () => {
|
||||
document.removeEventListener("pointerdown", outside);
|
||||
document.removeEventListener("keydown", escape);
|
||||
};
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<div className="nav-group" ref={box}>
|
||||
<button
|
||||
ref={button}
|
||||
type="button"
|
||||
className={active ? "nav-group-button is-active" : "nav-group-button"}
|
||||
aria-expanded={open}
|
||||
aria-controls={id}
|
||||
onClick={() => setOpen((o) => !o)}
|
||||
>
|
||||
<NavIcon name={group.icon} />
|
||||
{group.label}
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
aria-hidden="true"
|
||||
className="nav-group-chevron"
|
||||
>
|
||||
<path d="M6 9l6 6 6-6" />
|
||||
</svg>
|
||||
</button>
|
||||
{open && (
|
||||
<div id={id} className="nav-dropdown">
|
||||
<span className="nav-dropdown-title">{group.title}</span>
|
||||
{group.items.map((i) => (
|
||||
<Link
|
||||
key={i.href}
|
||||
href={i.href}
|
||||
className="nav-dropdown-item"
|
||||
aria-current={here(i.href) ? "page" : undefined}
|
||||
>
|
||||
<NavIcon name={i.icon} />
|
||||
<span className="nav-dropdown-text">
|
||||
<span>{i.label}</span>
|
||||
{i.note && <span className="hint">{i.note}</span>}
|
||||
</span>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -184,8 +184,7 @@ export function PackageCards({
|
||||
{termsConsent && (
|
||||
<>
|
||||
{" "}
|
||||
A csomagot azonnal megkapod, ezért a fizetésnél kéred a teljesítés megkezdését, és ezzel lemondasz a 14
|
||||
napos elállási jogról. <Link href="/aszf">ÁSZF</Link>
|
||||
<Link href="/aszf">ÁSZF</Link>
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
|
||||
@@ -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" },
|
||||
];
|
||||
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ő" });
|
||||
|
||||
/**
|
||||
* 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" },
|
||||
];
|
||||
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