This commit is contained in:
eric
2026-03-12 03:55:17 -05:00
parent 7e8f0e3e40
commit 2a9bb8330c
18 changed files with 767 additions and 72 deletions

View File

@@ -7,9 +7,10 @@ import styles from "./vip.module.css";
type VipHeaderProps = {
isLoggedIn: boolean;
userName?: string | null;
onLogout?: () => void;
};
export function VipHeader({ isLoggedIn, userName }: VipHeaderProps) {
export function VipHeader({ isLoggedIn, userName, onLogout }: VipHeaderProps) {
return (
<header className={styles.header}>
<Link
@@ -23,7 +24,19 @@ export function VipHeader({ isLoggedIn, userName }: VipHeaderProps) {
<nav className={styles.nav}>
<ThemeToggle />
{isLoggedIn ? (
<span className={styles.userBadge}>{userName || "会员"}</span>
<div className={styles.userBadge} style={{ display: "flex", alignItems: "center", gap: "0.5rem" }}>
<span>{userName || "会员"}</span>
{onLogout && (
<button
type="button"
onClick={onLogout}
className={styles.loginLink}
style={{ background: "none", border: "none", cursor: "pointer", padding: 0, fontSize: "inherit" }}
>
退出
</button>
)}
</div>
) : (
<Link href="/#login" className={styles.loginLink}>
登录