@@ -8,25 +8,21 @@ import { z } from "zod";
8
8
import { Button } from "@/components/ui/button" ;
9
9
import { Input } from "@/components/ui/input" ;
10
10
import Pageloader from "@/components/ui/Pageloader" ;
11
- import {
12
- Popover ,
13
- PopoverContent ,
14
- PopoverTrigger ,
15
- } from "@/components/ui/popover" ;
16
-
17
11
import {
18
12
Form ,
19
13
FormControl ,
20
- FormDescription ,
21
14
FormField ,
22
15
FormItem ,
23
16
FormLabel ,
24
17
FormMessage ,
18
+ FormDescription ,
25
19
} from "@/components/ui/form" ;
26
20
import { useToast } from "@/components/ui/use-toast" ;
27
21
import Link from "next/link" ;
28
22
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" ;
30
26
31
27
const signInSchema = z . object ( {
32
28
email : z . string ( ) . email ( "Invalid email address" ) ,
@@ -36,9 +32,9 @@ const signInSchema = z.object({
36
32
type SignInFormData = z . infer < typeof signInSchema > ;
37
33
38
34
export default function SignInPage ( ) {
35
+ const { theme } = useTheme ( ) ;
39
36
const { toast } = useToast ( ) ;
40
- const [ Loading , setLoading ] = useState < boolean > ( false ) ;
41
-
37
+ const [ loading , setLoading ] = useState < boolean > ( false ) ;
42
38
const [ showPassword , setShowPassword ] = useState < boolean > ( false ) ;
43
39
44
40
const form = useForm < SignInFormData > ( {
@@ -69,7 +65,6 @@ export default function SignInPage() {
69
65
toast ( {
70
66
description : "Login successful" ,
71
67
} ) ;
72
-
73
68
setTimeout ( ( ) => {
74
69
router . refresh ( ) ;
75
70
} , 100 ) ;
@@ -78,11 +73,13 @@ export default function SignInPage() {
78
73
} ;
79
74
80
75
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 >
86
83
< div className = "border-b border-gray-300 pb-4 mb-4" >
87
84
< Form { ...form } >
88
85
< form onSubmit = { form . handleSubmit ( onSubmit ) } className = "space-y-4" >
@@ -91,24 +88,15 @@ export default function SignInPage() {
91
88
name = "email"
92
89
render = { ( { field } ) => (
93
90
< FormItem >
94
- < FormLabel className = "dark:text-white text-black" >
95
- Email
96
- </ FormLabel >
91
+ < FormLabel > Email</ FormLabel >
97
92
< FormControl >
98
93
< 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" />
104
95
< div className = "ml-2 text-gray-500 focus:outline-none" >
105
96
< AtSign />
106
97
</ div >
107
98
</ div >
108
99
</ FormControl >
109
- < FormDescription >
110
- This is the email address you will use to sign in.
111
- </ FormDescription >
112
100
< FormMessage />
113
101
</ FormItem >
114
102
) }
@@ -118,17 +106,12 @@ export default function SignInPage() {
118
106
name = "password"
119
107
render = { ( { field } ) => (
120
108
< 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 >
127
110
< FormControl >
128
111
< div className = "flex items-center" >
129
112
< Input
130
113
type = { showPassword ? "text" : "password" }
131
- placeholder = "Password "
114
+ placeholder = "Enter your password "
132
115
{ ...field }
133
116
className = "w-full dark:text-black"
134
117
/>
@@ -141,31 +124,41 @@ export default function SignInPage() {
141
124
</ button >
142
125
</ div >
143
126
</ FormControl >
144
- < FormDescription >
145
- Enter your password to log in.
146
- </ FormDescription >
147
127
< FormMessage />
148
128
</ FormItem >
149
129
) }
150
130
/>
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" }
156
133
</ Button >
157
134
</ form >
158
135
</ Form >
159
136
</ 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
166
156
</ Link >
167
157
</ div >
158
+ < p className = "mt-8 text-xs text-center text-gray-500" >
159
+ © 2024 git-trace Inc. All rights reserved.
160
+ </ p >
168
161
</ div >
169
162
</ div >
170
163
) ;
171
- }
164
+ }
0 commit comments