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:
38
frontend/app/login-dialog.tsx
Normal file
38
frontend/app/login-dialog.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
import { LoginForm } from "./login/login-form";
|
||||
import { ReactNode, useState } from "react";
|
||||
|
||||
export function LoginDialog({
|
||||
hasKeycloak,
|
||||
children,
|
||||
}: {
|
||||
hasKeycloak: boolean;
|
||||
children?: ReactNode;
|
||||
}) {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogTrigger className="rounded-lg bg-slate-900 px-5 py-2.5 text-sm font-medium text-white hover:bg-slate-800">
|
||||
{children ?? "登录"}
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-center">登录</DialogTitle>
|
||||
</DialogHeader>
|
||||
<LoginForm
|
||||
hasKeycloak={hasKeycloak}
|
||||
onSuccess={() => setOpen(false)}
|
||||
/>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user