Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
refactor(web): replace raw HTML with shadcn components on login page
Naiyuan Qinga8e18cc15cf6
diff --git a/apps/web/app/(auth)/login/page.tsx b/apps/web/app/(auth)/login/page.tsxindex 49c50fc57b..673116616b 100644--- a/apps/web/app/(auth)/login/page.tsx+++ b/apps/web/app/(auth)/login/page.tsx@@ -2,6 +2,17 @@import { useState } from "react";import { useAuth } from "../../../lib/auth-context";+import {+ Card,+ CardHeader,+ CardTitle,+ CardDescription,+ CardContent,+ CardFooter,+} from "@multica/ui/components/ui/card";+import { Input } from "@multica/ui/components/ui/input";+import { Button } from "@multica/ui/components/ui/button";+import { Label } from "@multica/ui/components/ui/label";export default function LoginPage() {const { login, isLoading } = useAuth();@@ -28,38 +39,51 @@ export default function LoginPage() {return (<div className="flex min-h-screen items-center justify-center">- <form onSubmit={handleSubmit} className="w-full max-w-sm space-y-4 text-center">- <h1 className="text-2xl font-bold">Multica</h1>- <p className="text-muted-foreground">AI-native task management</p>-- <div className="space-y-3 text-left">- <input- type="text"- placeholder="Name"- value={name}- onChange={(e) => setName(e.target.value)}- className="w-full rounded-md border bg-background px-3 py-2 text-sm"- />- <input- type="email"- placeholder="Email"- value={email}- onChange={(e) => setEmail(e.target.value)}- className="w-full rounded-md border bg-background px-3 py-2 text-sm"- required- />- </div>-- {error && <p className="text-sm text-red-500">{error}</p>}-- <button- type="submit"- disabled={submitting || isLoading}- className="w-full rounded-md bg-primary px-4 py-2 text-primary-foreground disabled:opacity-50"- >- {submitting ? "Signing in..." : "Sign in"}- </button>- </form>+ <Card className="w-full max-w-sm">+ <CardHeader className="text-center">+ <CardTitle className="text-2xl">Multica</CardTitle>+ <CardDescription>AI-native task management</CardDescription>+ </CardHeader>+ <CardContent>+ <form id="login-form" onSubmit={handleSubmit} className="space-y-4">+ <div className="space-y-2">+ <Label htmlFor="name">Name</Label>+ <Input+ id="name"+ type="text"+ placeholder="Your name"+ value={name}+ onChange={(e) => setName(e.target.value)}+ />+ </div>+ <div className="space-y-2">+ <Label htmlFor="email">Email</Label>+ <Input+ id="email"+ type="email"+ placeholder="[email protected]"+ value={email}+ onChange={(e) => setEmail(e.target.value)}+ required+ />+ </div>+ {error && (+ <p className="text-sm text-destructive">{error}</p>+ )}+ </form>+ </CardContent>+ <CardFooter>+ <Button+ type="submit"+ form="login-form"+ disabled={submitting || isLoading}+ className="w-full"+ size="lg"+ >+ {submitting ? "Signing in..." : "Sign in"}+ </Button>+ </CardFooter>+ </Card></div>);}