nomadro/components/portal-topbar.tsx
eric 9f8fec1723 Ship portal PC/H5 acceptance, VIP ScrollReader, admin analytics and ops anchors.
Adds /api/health, ntfy notify on config save, /admin/analytics charts, and deploy smoke for miniprogram config/API.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 23:52:00 -05:00

62 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client";
/**
* 门户统一顶栏:logo 回首页 + 右侧操作(主题 / 语言等)
* 视觉对齐 VIP 顶栏:粘性、毛玻璃、移动端友好热区
*/
import Link from "next/link";
import type { ReactNode } from "react";
import styles from "./portal-topbar.module.css";
function LogoMark() {
return (
<svg className={styles.logoMark} viewBox="0 0 40 40" fill="none" aria-hidden>
<circle cx="20" cy="20" r="18" stroke="url(#portalLogoGrad)" strokeWidth="2.5" />
<path
d="M12 22c4-8 12-8 16 0"
stroke="url(#portalLogoGrad)"
strokeWidth="2"
strokeLinecap="round"
/>
<circle cx="28" cy="14" r="3" fill="url(#portalLogoGrad)" />
<defs>
<linearGradient id="portalLogoGrad" x1="0" y1="0" x2="40" y2="40">
<stop offset="0%" stopColor="#FF6B6B" />
<stop offset="50%" stopColor="#FFE66D" />
<stop offset="100%" stopColor="#4ECDC4" />
</linearGradient>
</defs>
</svg>
);
}
export function PortalTopBar({
section,
actions,
tone = "default",
}: {
/** 右侧区块名,如「小册」 */
section?: string;
actions?: ReactNode;
/** cover:叠在电子书封面渐变上 */
tone?: "default" | "cover";
}) {
return (
<header className={`${styles.bar} ${tone === "cover" ? styles.barCover : ""}`}>
<Link href="/" className={styles.logo} aria-label="返回 nomadro 首页">
<LogoMark />
<span className={styles.brand}>nomadro</span>
{section ? (
<>
<span className={styles.sep} aria-hidden>
·
</span>
<span className={styles.section}>{section}</span>
</>
) : null}
</Link>
<div className={styles.actions}>{actions}</div>
</header>
);
}