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" + />
); }