Skip to content

Commit 29e7ecd

Browse files
Merge pull request #111 from tarunkumar2005/login-signup-enhanced
Enhanced the ui design of the login and signup pages.
2 parents 86a3ea8 + 31b8aed commit 29e7ecd

File tree

4 files changed

+153
-201
lines changed

4 files changed

+153
-201
lines changed

app/auth/signin/page.tsx

+42-49
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,21 @@ import { z } from "zod";
88
import { Button } from "@/components/ui/button";
99
import { Input } from "@/components/ui/input";
1010
import Pageloader from "@/components/ui/Pageloader";
11-
import {
12-
Popover,
13-
PopoverContent,
14-
PopoverTrigger,
15-
} from "@/components/ui/popover";
16-
1711
import {
1812
Form,
1913
FormControl,
20-
FormDescription,
2114
FormField,
2215
FormItem,
2316
FormLabel,
2417
FormMessage,
18+
FormDescription,
2519
} from "@/components/ui/form";
2620
import { useToast } from "@/components/ui/use-toast";
2721
import Link from "next/link";
2822
import { useState } from "react";
29-
import loader, { AtSign, Eye, EyeOff } from "lucide-react";
23+
import Image from "next/image";
24+
import { useTheme } from 'next-themes';
25+
import { AtSign, Eye, EyeOff } from "lucide-react";
3026

3127
const signInSchema = z.object({
3228
email: z.string().email("Invalid email address"),
@@ -36,9 +32,9 @@ const signInSchema = z.object({
3632
type SignInFormData = z.infer<typeof signInSchema>;
3733

3834
export default function SignInPage() {
35+
const { theme } = useTheme();
3936
const { toast } = useToast();
40-
const [Loading, setLoading] = useState<boolean>(false);
41-
37+
const [loading, setLoading] = useState<boolean>(false);
4238
const [showPassword, setShowPassword] = useState<boolean>(false);
4339

4440
const form = useForm<SignInFormData>({
@@ -69,7 +65,6 @@ export default function SignInPage() {
6965
toast({
7066
description: "Login successful",
7167
});
72-
7368
setTimeout(() => {
7469
router.refresh();
7570
}, 100);
@@ -78,11 +73,13 @@ export default function SignInPage() {
7873
};
7974

8075
return (
81-
<div className="flex flex-col items-center justify-center min-h-screen">
82-
<div className="w-full max-w-md p-6 bg-white dark:bg-[#141414] border rounded-lg">
83-
<h2 className="text-xl font-bold text-[#5469a2] text- mb-4">
84-
Login into git-trace
85-
</h2>
76+
<div className="flex flex-col items-center justify-center min-h-screen bg-gray-50">
77+
<div className="w-full max-w-md p-8 bg-white rounded-lg shadow-md">
78+
<div className="flex flex-col items-center mb-6">
79+
<Image src={theme === 'dark' ? '/git4.png' : '/git3.png'} alt="Logo" width={60} height={60} />
80+
<h1 className="text-2xl font-bold text-gray-900">Welcome to git-trace</h1>
81+
<p className="text-sm text-gray-600">Track all your github repositories here.</p>
82+
</div>
8683
<div className="border-b border-gray-300 pb-4 mb-4">
8784
<Form {...form}>
8885
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
@@ -91,24 +88,15 @@ export default function SignInPage() {
9188
name="email"
9289
render={({ field }) => (
9390
<FormItem>
94-
<FormLabel className="dark:text-white text-black">
95-
Email
96-
</FormLabel>
91+
<FormLabel>Email</FormLabel>
9792
<FormControl>
9893
<div className="flex items-center">
99-
<Input
100-
placeholder="Email"
101-
{...field}
102-
className="w-full dark:text-black"
103-
/>
94+
<Input placeholder="Enter your email" {...field} className="w-full dark:text-black" />
10495
<div className="ml-2 text-gray-500 focus:outline-none">
10596
<AtSign />
10697
</div>
10798
</div>
10899
</FormControl>
109-
<FormDescription>
110-
This is the email address you will use to sign in.
111-
</FormDescription>
112100
<FormMessage />
113101
</FormItem>
114102
)}
@@ -118,17 +106,12 @@ export default function SignInPage() {
118106
name="password"
119107
render={({ field }) => (
120108
<FormItem>
121-
<FormLabel className="flex justify-between">
122-
<p className="dark:text-white text-black">Password</p>
123-
<Link href="/auth/forgot-password/email">
124-
Forgot Password?
125-
</Link>
126-
</FormLabel>
109+
<FormLabel>Password</FormLabel>
127110
<FormControl>
128111
<div className="flex items-center">
129112
<Input
130113
type={showPassword ? "text" : "password"}
131-
placeholder="Password"
114+
placeholder="Enter your password"
132115
{...field}
133116
className="w-full dark:text-black"
134117
/>
@@ -141,31 +124,41 @@ export default function SignInPage() {
141124
</button>
142125
</div>
143126
</FormControl>
144-
<FormDescription>
145-
Enter your password to log in.
146-
</FormDescription>
147127
<FormMessage />
148128
</FormItem>
149129
)}
150130
/>
151-
<Button
152-
type="submit"
153-
className="w-full bg-[#425893] text-white hover:text-black"
154-
>
155-
{Loading ? <Pageloader /> : "Login"}
131+
<Button type="submit" className="w-full bg-primary text-white hover:bg-blue-700">
132+
{loading ? <Pageloader /> : "Log in"}
156133
</Button>
157134
</form>
158135
</Form>
159136
</div>
160-
<div className="flex justify-end border-gray-300">
161-
<Link
162-
href="/auth/signup"
163-
className="text-sm text-[#425893] hover:text-gray-600 underline"
164-
>
165-
Register
137+
<div className="mt-4 text-center">
138+
<p className="text-sm text-gray-600">Or continue with</p>
139+
<Button variant="outline" className="w-full mt-2">
140+
<svg className="h-5 w-5 mr-2" viewBox="0 0 24 24">
141+
<path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z" fill="#4285F4" />
142+
<path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853" />
143+
<path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05" />
144+
<path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335" />
145+
<path d="M1 1h22v22H1z" fill="none" />
146+
</svg>
147+
Sign in with Google
148+
</Button>
149+
</div>
150+
<div className="mt-6 flex justify-between text-sm">
151+
<Link href="/auth/forgot-password" className="text-primary hover:underline">
152+
Forgot your password?
153+
</Link>
154+
<Link href="/auth/signup" className="text-primary hover:underline">
155+
Sign up for an account
166156
</Link>
167157
</div>
158+
<p className="mt-8 text-xs text-center text-gray-500">
159+
© 2024 git-trace Inc. All rights reserved.
160+
</p>
168161
</div>
169162
</div>
170163
);
171-
}
164+
}

0 commit comments

Comments
 (0)