Skip to content

An AI-powered search engine with a generative UI

style: update login and sign-up form styles with logo in title

Yoshiki Miurafecb1c8e624d
diff --git a/components/login-form.tsx b/components/login-form.tsx
index 3c06856d..85c84e5a 100644
--- a/components/login-form.tsx
+++ b/components/login-form.tsx
@@ -8,6 +8,7 @@ import {
CardHeader,
CardTitle
} from '@/components/ui/card'
+import { IconLogo } from '@/components/ui/icons'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { createClient } from '@/lib/supabase/client'
@@ -71,23 +72,46 @@ export function LoginForm({
}
return (
- <div className={cn('flex flex-col gap-6', className)} {...props}>
- <Card>
- <CardHeader>
- <CardTitle className="text-2xl">Login</CardTitle>
- <CardDescription>
- Enter your email below to login to your account
- </CardDescription>
+ <div
+ className={cn('flex flex-col items-center gap-6', className)}
+ {...props}
+ >
+ <Card className="w-full max-w-sm">
+ <CardHeader className="text-center">
+ <CardTitle className="text-2xl flex flex-col items-center justify-center gap-4">
+ <IconLogo className="size-12" />
+ Welcome back
+ </CardTitle>
+ <CardDescription>Sign in to your account</CardDescription>
</CardHeader>
<CardContent>
- <form onSubmit={handleLogin}>
- <div className="flex flex-col gap-6">
+ <div className="flex flex-col gap-4">
+ <Button
+ variant="outline"
+ type="button"
+ className="w-full"
+ onClick={handleSocialLogin}
+ disabled={isLoading}
+ >
+ Sign In with Google
+ </Button>
+
+ <div className="relative my-2">
+ <div className="absolute inset-0 flex items-center">
+ <span className="w-full border-t" />
+ </div>
+ <div className="relative flex justify-center text-xs uppercase">
+ <span className="bg-muted px-2 text-muted-foreground">Or</span>
+ </div>
+ </div>
+
+ <form onSubmit={handleLogin} className="flex flex-col gap-4">
<div className="grid gap-2">
<Label htmlFor="email">Email</Label>
<Input
id="email"
type="email"
- placeholder="[email protected]"
+ placeholder="[email protected]"
required
value={email}
onChange={e => setEmail(e.target.value)}
@@ -100,12 +124,13 @@ export function LoginForm({
href="/auth/forgot-password"
className="ml-auto inline-block text-sm underline-offset-4 hover:underline"
>
- Forgot your password?
+ Forgot password?
</Link>
</div>
<Input
id="password"
type="password"
+ placeholder="********"
required
value={password}
onChange={e => setPassword(e.target.value)}
@@ -113,42 +138,16 @@ export function LoginForm({
</div>
{error && <p className="text-sm text-red-500">{error}</p>}
<Button type="submit" className="w-full" disabled={isLoading}>
- {isLoading ? 'Logging in...' : 'Login'}
+ {isLoading ? 'Logging in...' : 'Sign In'}
</Button>
-
- {/* Divider and Social Login */}
- <div className="relative my-4">
- <div className="absolute inset-0 flex items-center">
- <span className="w-full border-t" />
- </div>
- <div className="relative flex justify-center text-xs uppercase">
- <span className="bg-background px-2 text-muted-foreground">
- Or continue with
- </span>
- </div>
- </div>
-
- <Button
- variant="outline"
- type="button"
- className="w-full"
- onClick={handleSocialLogin}
- disabled={isLoading}
- >
- {/* TODO: Add Google Icon */}
- Google
- </Button>
- </div>
- <div className="mt-4 text-center text-sm">
- Don&apos;t have an account?{' '}
- <Link
- href="/auth/sign-up"
- className="underline underline-offset-4"
- >
- Sign up
- </Link>
- </div>
- </form>
+ </form>
+ </div>
+ <div className="mt-6 text-center text-sm">
+ Don&apos;t have an account?{' '}
+ <Link href="/auth/sign-up" className="underline underline-offset-4">
+ Sign Up
+ </Link>
+ </div>
</CardContent>
</Card>
</div>
diff --git a/components/sign-up-form.tsx b/components/sign-up-form.tsx
index 351c6e50..1dbf1400 100644
--- a/components/sign-up-form.tsx
+++ b/components/sign-up-form.tsx
@@ -8,6 +8,7 @@ import {
CardHeader,
CardTitle
} from '@/components/ui/card'
+import { IconLogo } from '@/components/ui/icons'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { createClient } from '@/lib/supabase/client'
@@ -57,21 +58,29 @@ export function SignUpForm({
}
return (
- <div className={cn('flex flex-col gap-6', className)} {...props}>
- <Card>
- <CardHeader>
- <CardTitle className="text-2xl">Sign up</CardTitle>
- <CardDescription>Create a new account</CardDescription>
+ <div
+ className={cn('flex flex-col items-center gap-6', className)}
+ {...props}
+ >
+ <Card className="w-full max-w-sm">
+ <CardHeader className="text-center">
+ <CardTitle className="text-2xl flex flex-col items-center justify-center gap-4">
+ <IconLogo className="size-12" />
+ Create an account
+ </CardTitle>
+ <CardDescription>
+ Enter your details below to get started
+ </CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleSignUp}>
- <div className="flex flex-col gap-6">
+ <div className="flex flex-col gap-4">
<div className="grid gap-2">
<Label htmlFor="email">Email</Label>
<Input
id="email"
type="email"
- placeholder="[email protected]"
+ placeholder="[email protected]"
required
value={email}
onChange={e => setEmail(e.target.value)}
@@ -84,6 +93,7 @@ export function SignUpForm({
<Input
id="password"
type="password"
+ placeholder="********"
required
value={password}
onChange={e => setPassword(e.target.value)}
@@ -96,6 +106,7 @@ export function SignUpForm({
<Input
id="repeat-password"
type="password"
+ placeholder="********"
required
value={repeatPassword}
onChange={e => setRepeatPassword(e.target.value)}
@@ -103,13 +114,13 @@ export function SignUpForm({
</div>
{error && <p className="text-sm text-red-500">{error}</p>}
<Button type="submit" className="w-full" disabled={isLoading}>
- {isLoading ? 'Creating an account...' : 'Sign up'}
+ {isLoading ? 'Creating account...' : 'Sign Up'}
</Button>
</div>
- <div className="mt-4 text-center text-sm">
+ <div className="mt-6 text-center text-sm">
Already have an account?{' '}
<Link href="/auth/login" className="underline underline-offset-4">
- Login
+ Sign In
</Link>
</div>
</form>