@@ -10,7 +10,7 @@ import { signIn, useSession } from "next-auth/client";
10
10
import { toast } from "react-toastify" ;
11
11
import { useRouter } from "next/router" ;
12
12
import { useToggle } from "react-use" ;
13
- import HeadSection from "@/components/HeadSection " ;
13
+ import AuthLayout from "@/components/AuthLayout " ;
14
14
import Image from "next/image" ;
15
15
import Link from "next/link" ;
16
16
import React , { useEffect , useState } from "react" ;
@@ -54,100 +54,105 @@ export default function SignIn() {
54
54
} ;
55
55
56
56
useEffect ( ( ) => {
57
- if ( router . query . email ) setEmail ( router . query . email as string ) ;
58
- } , [ router ] )
57
+ if ( router . query . email ) setEmail ( router . query . email as string ) ;
58
+ } , [ router ] ) ;
59
59
60
60
return (
61
61
< >
62
- < HeadSection />
63
- < div className = "min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8" >
64
- < div className = "sm:mx-auto sm:w-full sm:max-w-md" >
65
- < div className = "relative mx-auto w-[200px] h-[54px] my-2" >
66
- < Image src = "/img/logo_text_black.png" layout = "fill" alt = "Basetool Logo" />
62
+ < AuthLayout >
63
+ < div className = "min-h-screen bg-white flex flex-col justify-center py-12 sm:px-6 lg:px-8" >
64
+ < div className = "sm:mx-auto sm:w-full sm:max-w-md" >
65
+ < div className = "relative mx-auto w-[200px] h-[54px] my-2" >
66
+ < Image
67
+ src = "/img/logo_text_black.png"
68
+ layout = "fill"
69
+ alt = "Basetool Logo"
70
+ />
71
+ </ div >
72
+ < h2 className = "mt-6 text-center text-3xl font-extrabold text-gray-900" >
73
+ Sign in to your account
74
+ </ h2 >
67
75
</ div >
68
- < h2 className = "mt-6 text-center text-3xl font-extrabold text-gray-900" >
69
- Sign in to your account
70
- </ h2 >
71
- </ div >
72
-
73
- < div className = "mt-8 sm:mx-auto sm:w-full sm:max-w-md" >
74
- < div className = "bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10" >
75
- < form
76
- className = "space-y-6"
77
- onSubmit = { ( e ) => {
78
- e . preventDefault ( ) ;
79
- handleSubmit ( ) ;
80
- } }
81
- >
82
- < FormControl id = "email" >
83
- < FormLabel > Email address</ FormLabel >
84
- < Input
85
- type = "email"
86
- name = "email"
87
-
88
- required = { true }
89
- value = { email }
90
- onChange = { ( e ) => setEmail ( e . currentTarget . value ) }
91
- autoFocus
92
- />
93
- < FormHelperText > We'll never share your email.</ FormHelperText >
94
- </ FormControl >
95
76
96
- < FormControl id = "password" >
97
- < FormLabel > Password</ FormLabel >
98
- < Input
99
- type = "password"
100
- name = "password"
101
- placeholder = "your strong password"
102
- required = { true }
103
- value = { password }
104
- onChange = { ( e ) => setPassword ( e . currentTarget . value ) }
105
- />
106
- < FormHelperText > Something strong.</ FormHelperText >
107
- </ FormControl >
77
+ < div className = "mt-8 sm:mx-auto sm:w-full sm:max-w-md" >
78
+ < div className = "py-8 px-4 sm:rounded-lg sm:px-10" >
79
+ < form
80
+ className = "space-y-6"
81
+ onSubmit = { ( e ) => {
82
+ e . preventDefault ( ) ;
83
+ handleSubmit ( ) ;
84
+ } }
85
+ >
86
+ < FormControl id = "email" >
87
+ < FormLabel > Email address</ FormLabel >
88
+ < Input
89
+ type = "email"
90
+ name = "email"
91
+
92
+ required = { true }
93
+ value = { email }
94
+ onChange = { ( e ) => setEmail ( e . currentTarget . value ) }
95
+ autoFocus
96
+ />
97
+ < FormHelperText > We'll never share your email.</ FormHelperText >
98
+ </ FormControl >
108
99
109
- < div className = "flex items-center justify-between" >
110
- < div className = "flex items-center" >
111
- < input
112
- id = "rememberMe"
113
- name = "rememberMe"
114
- type = "checkbox"
115
- className = "h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded"
100
+ < FormControl id = "password" >
101
+ < FormLabel > Password</ FormLabel >
102
+ < Input
103
+ type = "password"
104
+ name = "password"
105
+ placeholder = "your strong password"
106
+ required = { true }
107
+ value = { password }
108
+ onChange = { ( e ) => setPassword ( e . currentTarget . value ) }
116
109
/>
117
- < label
118
- htmlFor = "rememberMe"
119
- className = "ml-2 block text-sm text-gray-900"
120
- >
121
- Remember me
122
- </ label >
123
- </ div >
110
+ < FormHelperText > Something strong.</ FormHelperText >
111
+ </ FormControl >
112
+
113
+ < div className = "flex items-center justify-between" >
114
+ < div className = "flex items-center" >
115
+ < input
116
+ id = "rememberMe"
117
+ name = "rememberMe"
118
+ type = "checkbox"
119
+ className = "h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded"
120
+ />
121
+ < label
122
+ htmlFor = "rememberMe"
123
+ className = "ml-2 block text-sm text-gray-900"
124
+ >
125
+ Remember me
126
+ </ label >
127
+ </ div >
124
128
125
- < div className = "text-sm" >
126
- No account?{ " " }
127
- < Link href = "/auth/register" >
128
- < a className = "font-medium text-indigo-600 hover:text-indigo-500" >
129
- Register
130
- </ a >
131
- </ Link >
129
+ < div className = "text-sm" >
130
+ No account?{ " " }
131
+ < Link href = "/auth/register" >
132
+ < a className = "font-medium text-indigo-600 hover:text-indigo-500" >
133
+ Register
134
+ </ a >
135
+ </ Link >
136
+ </ div >
132
137
</ div >
133
- </ div >
134
138
135
- < div >
136
- < Button
137
- type = "submit"
138
- disabled = { isDisabled }
139
- isLoading = { isDisabled }
140
- colorScheme = "blue"
141
- width = "100%"
142
- className = "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
143
- >
144
- Sign in
145
- </ Button >
146
- </ div >
147
- </ form >
139
+ < div >
140
+ < Button
141
+ type = "submit"
142
+ disabled = { isDisabled }
143
+ isLoading = { isDisabled }
144
+ colorScheme = "blue"
145
+ width = "100%"
146
+ className = "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
147
+ >
148
+ Sign in
149
+ </ Button >
150
+ </ div >
151
+ </ form >
152
+ </ div >
148
153
</ div >
149
154
</ div >
150
- </ div >
155
+ </ AuthLayout >
151
156
</ >
152
157
) ;
153
158
}
0 commit comments