From 1e7851fdb53ce2e9f4890c23bddf11e0fe50d69b Mon Sep 17 00:00:00 2001 From: kurihada Date: Thu, 26 Feb 2026 14:22:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A6=96=E9=A1=B5=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E7=8A=B6=E6=80=81=E6=8C=87?= =?UTF-8?q?=E7=A4=BA=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 已登录:右上角显示头像 + 用户名,点击进入个人中心 - 未登录:右上角显示"登录"按钮,点击弹出注册/登录弹窗 --- src/app/page.tsx | 50 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index eff6e0b..b98f426 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,12 +1,27 @@ "use client"; +import { useState, useEffect, useCallback } from "react"; import { useRouter } from "next/navigation"; import { motion } from "framer-motion"; -import { Zap, Gift, Clock, ChevronRight } from "lucide-react"; +import { Zap, Gift, Clock, ChevronRight, User } from "lucide-react"; import BrandLogo from "@/components/BrandLogo"; +import { getCachedProfile } from "@/lib/userId"; +import AuthModal from "@/components/AuthModal"; +import type { UserProfile } from "@/types"; export default function LandingPage() { const router = useRouter(); + const [profile, setProfile] = useState(null); + const [showAuth, setShowAuth] = useState(false); + + useEffect(() => { + setProfile(getCachedProfile()); + }, []); + + const handleAuth = useCallback((p: UserProfile) => { + setProfile(p); + setShowAuth(false); + }, []); return (
@@ -14,6 +29,32 @@ export default function LandingPage() {
+ {/* User indicator */} + + {profile ? ( + + ) : ( + + )} + + {/* Header */} NOWHATEVER — 拒绝随便,从今天开始 + + setShowAuth(false)} + onAuth={handleAuth} + defaultTab="register" + />
); }