From d9e9e95ecec62018a3d1389dd7d7ec6f5f47ae69 Mon Sep 17 00:00:00 2001 From: XingfenD Date: Tue, 8 Sep 2026 17:47:17 +0800 Subject: [PATCH] feat(ui): login rebuilt on shadcn card/label/input, theme toggle available pre-auth --- frontend/src/pages/Login.tsx | 88 +++++++++++++++--------------------- 1 file changed, 36 insertions(+), 52 deletions(-) diff --git a/frontend/src/pages/Login.tsx b/frontend/src/pages/Login.tsx index 5396009..2e9d018 100644 --- a/frontend/src/pages/Login.tsx +++ b/frontend/src/pages/Login.tsx @@ -1,20 +1,13 @@ -import { useState, type FormEvent, type ReactNode } from "react"; +import { useState, type FormEvent } from "react"; import { Navigate, useLocation } from "react-router-dom"; -import { useAuth } from "../auth/AuthContext"; -import { IconBooks, IconLock, IconUser } from "../components/icons"; -import { toast } from "../components/Toaster"; -import { btnPrimary, card, input } from "../components/ui"; - -function Field({ icon, children }: { icon: ReactNode; children: ReactNode }) { - return ( - - ); -} +import { BookMarked } from "lucide-react"; +import { useAuth } from "@/auth/AuthContext"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { ThemeToggle } from "@/components/theme-toggle"; +import { toast } from "@/components/Toaster"; export default function Login() { const { login, user } = useAuth(); @@ -38,42 +31,33 @@ export default function Login() { } return ( -
-
-
- - - -

- BookLib -

-

你的漫画与书籍藏书馆

-
- }> - setU(e.target.value)} - aria-label="用户名" - placeholder="用户名" - autoFocus - autoComplete="username" - /> - - }> - setP(e.target.value)} - aria-label="密码" - placeholder="密码" - autoComplete="current-password" - /> - - +
+
+ +
+ + + + + + + BookLib + 你的漫画与书籍藏书馆 + + +
+ + setU(e.target.value)} autoFocus autoComplete="username" /> +
+
+ + setP(e.target.value)} autoComplete="current-password" /> +
+ +
+
);