@@ -9,6 +9,39 @@ import { authorizeUser } from './requests';
99import { useNotifications } from '../../shared/hooks/use-notification' ;
1010import React from 'react' ;
1111import { AuthorizeUserPayload } from './typings' ;
12+ import { Button , Typography } from '@mui/material' ;
13+ import { styled } from '@mui/material/styles' ;
14+
15+ const StyledSection = styled ( 'section' ) ( ( { theme } ) => ( {
16+ paddingTop : theme . spacing ( 4 ) ,
17+ paddingBottom : theme . spacing ( 4 ) ,
18+ paddingLeft : '5vw' ,
19+ paddingRight : '5vw' ,
20+ display : 'flex' ,
21+ alignItems : 'center' ,
22+ justifyContent : 'center' ,
23+ minHeight : `calc(100vh - 80px)` ,
24+ } ) ) ;
25+
26+ const StyledForm = styled ( 'form' ) ( ( ) => ( {
27+ width : '80%' ,
28+ maxWidth : 400 ,
29+ } ) ) ;
30+
31+ const StyledTitle = styled ( Typography ) ( ( { theme } ) => ( {
32+ fontSize : '2.5rem' ,
33+ fontFamily : 'Gelasio, serif' ,
34+ textTransform : 'capitalize' ,
35+ textAlign : 'center' ,
36+ marginBottom : theme . spacing ( 6 ) ,
37+ } ) ) ;
38+
39+ const StyledFooter = styled ( 'p' ) ( ( { theme } ) => ( {
40+ marginTop : theme . spacing ( 2.5 ) ,
41+ color : theme . palette . text . secondary ,
42+ fontSize : '1.125rem' ,
43+ textAlign : 'center' ,
44+ } ) ) ;
1245
1346const UserAuthForm = ( { type } : { type : string } ) => {
1447 const [ userAuth , setUserAuth ] = useAtom ( UserAtom ) ;
@@ -43,7 +76,7 @@ const UserAuthForm = ({ type }: { type: string }) => {
4376
4477 const formRef = React . useRef < HTMLFormElement > ( null ) ;
4578
46- const handleSubmit = ( e : React . MouseEvent < HTMLElement , MouseEvent > ) => {
79+ const handleSubmit = ( e : React . FormEvent < HTMLElement > ) => {
4780 e . preventDefault ( ) ;
4881
4982 const serverRoute =
@@ -101,11 +134,11 @@ const UserAuthForm = ({ type }: { type: string }) => {
101134 < Navigate to = "/" />
102135 ) : (
103136 < AnimationWrapper keyValue = { type } >
104- < section className = "py-4 px-[5vw] md:px-[7vw] lg:px-[10vw] h-cover flex items-center justify-center" >
105- < form id = "formElement" className = "w-[80%] max-w-[400px]" ref = { formRef } >
106- < h1 className = "text-4xl font-gelasio capitalize text-center mb-24" >
137+ < StyledSection >
138+ < StyledForm id = "formElement" onSubmit = { handleSubmit } >
139+ < StyledTitle >
107140 { type === 'login' ? 'Welcome back' : 'Join us today' }
108- </ h1 >
141+ </ StyledTitle >
109142
110143 { type !== 'login' ? (
111144 < InputBox
@@ -132,27 +165,44 @@ const UserAuthForm = ({ type }: { type: string }) => {
132165 icon = "fi-rr-key"
133166 />
134167
135- < button
136- className = "btn-dark center mt-14"
168+ < Button
137169 type = "submit"
138- onClick = { handleSubmit }
170+ variant = "contained"
171+ sx = { theme => ( {
172+ borderRadius : '999px' ,
173+ bgcolor : theme . palette . mode === 'dark' ? '#e4e4e7' : '#1f1f1f' ,
174+ color : theme . palette . mode === 'dark' ? '#1a1a1a' : '#f1f1f1' ,
175+ padding : theme . spacing ( 1.5 , 3 ) ,
176+ fontSize : '1.125rem' ,
177+ textTransform : 'none' ,
178+ '&:hover' : {
179+ opacity : 0.9 ,
180+ } ,
181+ mt : 3.5 ,
182+ mx : 'auto' ,
183+ display : 'block' ,
184+ } ) }
139185 >
140186 { type === 'login' ? 'Login' : 'Sign Up' }
141- </ button >
187+ </ Button >
142188
143- < p className = "mt-10 text-[#a3a3a3] text-xl text-center" >
189+ < StyledFooter >
144190 { type === 'login'
145191 ? "Don't have an account ?"
146192 : 'Already a member ?' }
147193 < Link
148194 to = { type === 'login' ? '/signup' : '/login' }
149- className = "text-black dark:text-[#ededed] text-xl ml-1 underline"
195+ style = { {
196+ marginLeft : 8 ,
197+ textDecoration : 'underline' ,
198+ color : 'inherit' ,
199+ } }
150200 >
151201 { type === 'login' ? 'Join us today' : 'Sign in here' }
152202 </ Link >
153- </ p >
154- </ form >
155- </ section >
203+ </ StyledFooter >
204+ </ StyledForm >
205+ </ StyledSection >
156206 </ AnimationWrapper >
157207 ) ;
158208} ;
0 commit comments