frontend: redesign homepage with magic dock and login dialog
- Replace top login/register buttons with magic dock navigation - Add dock items: home, downloads, blog, and conditional login/logout - Show dashboard icon in dock when authenticated - Extract HomePageClient for client-side dialog state
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
import { BlurFade } from "@/components/magicui/blur-fade";
|
||||
import { Suspense } from "react";
|
||||
import { auth } from "@/auth";
|
||||
import { HomePageClient } from "./home-page-client";
|
||||
|
||||
const SERVER_API_URL = process.env.SERVER_API_URL || "http://backend:8080";
|
||||
const hasKeycloak = !!process.env.AUTH_KEYCLOAK_ISSUER;
|
||||
|
||||
export default async function HomePage() {
|
||||
const session = await auth();
|
||||
const isAuthenticated = !!session?.user;
|
||||
|
||||
let healthText = "无法连接到后端服务";
|
||||
|
||||
try {
|
||||
@@ -19,46 +25,12 @@ export default async function HomePage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-br from-slate-50 to-slate-100 p-4">
|
||||
<BlurFade inView delay={0.1}>
|
||||
<h1 className="mb-4 text-center text-4xl font-extrabold tracking-tight text-slate-900">
|
||||
EvanPage
|
||||
</h1>
|
||||
</BlurFade>
|
||||
|
||||
<BlurFade inView delay={0.2}>
|
||||
<p className="mb-8 max-w-md text-center text-lg text-slate-600">
|
||||
全栈基础框架
|
||||
</p>
|
||||
</BlurFade>
|
||||
|
||||
<BlurFade inView delay={0.3}>
|
||||
<div className="rounded-2xl border bg-white/80 px-8 py-6 shadow-lg backdrop-blur">
|
||||
<p className="text-center text-sm font-medium text-slate-500">
|
||||
后端状态
|
||||
</p>
|
||||
<p className="mt-2 text-center text-xl font-semibold text-slate-800">
|
||||
{healthText}
|
||||
</p>
|
||||
</div>
|
||||
</BlurFade>
|
||||
|
||||
<BlurFade inView delay={0.4}>
|
||||
<div className="mt-8 flex gap-4">
|
||||
<a
|
||||
href="/login"
|
||||
className="rounded-lg bg-slate-900 px-5 py-2.5 text-sm font-medium text-white hover:bg-slate-800"
|
||||
>
|
||||
登录
|
||||
</a>
|
||||
<a
|
||||
href="/register"
|
||||
className="rounded-lg border border-slate-300 bg-white px-5 py-2.5 text-sm font-medium text-slate-700 hover:bg-slate-50"
|
||||
>
|
||||
注册
|
||||
</a>
|
||||
</div>
|
||||
</BlurFade>
|
||||
</div>
|
||||
<Suspense>
|
||||
<HomePageClient
|
||||
isAuthenticated={isAuthenticated}
|
||||
healthText={healthText}
|
||||
hasKeycloak={hasKeycloak}
|
||||
/>
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user