@@ -38,8 +38,11 @@ const Card = styled(MuiCard)(({ theme }) => ({
38
38
} ) ) ;
39
39
40
40
const SignInContainer = styled ( Stack ) ( ( { theme } ) => ( {
41
- padding : 20 ,
42
- marginTop : '10vh' ,
41
+ minHeight : '100%' ,
42
+ padding : theme . spacing ( 2 ) ,
43
+ [ theme . breakpoints . up ( 'sm' ) ] : {
44
+ padding : theme . spacing ( 4 ) ,
45
+ } ,
43
46
'&::before' : {
44
47
content : '""' ,
45
48
display : 'block' ,
@@ -72,7 +75,10 @@ export default function SignIn(props: { disableCustomTheme?: boolean }) {
72
75
} ;
73
76
74
77
const handleSubmit = ( event : React . FormEvent < HTMLFormElement > ) => {
75
- event . preventDefault ( ) ;
78
+ if ( emailError || passwordError ) {
79
+ event . preventDefault ( ) ;
80
+ return ;
81
+ }
76
82
const data = new FormData ( event . currentTarget ) ;
77
83
console . log ( {
78
84
email : data . get ( 'email' ) ,
@@ -155,6 +161,7 @@ export default function SignIn(props: { disableCustomTheme?: boolean }) {
155
161
< FormLabel htmlFor = "password" > Password</ FormLabel >
156
162
< Link
157
163
component = "button"
164
+ type = "button"
158
165
onClick = { handleClickOpen }
159
166
variant = "body2"
160
167
sx = { { alignSelf : 'baseline' } }
@@ -206,7 +213,6 @@ export default function SignIn(props: { disableCustomTheme?: boolean }) {
206
213
< Divider > or</ Divider >
207
214
< Box sx = { { display : 'flex' , flexDirection : 'column' , gap : 2 } } >
208
215
< Button
209
- type = "submit"
210
216
fullWidth
211
217
variant = "outlined"
212
218
onClick = { ( ) => alert ( 'Sign in with Google' ) }
@@ -215,7 +221,6 @@ export default function SignIn(props: { disableCustomTheme?: boolean }) {
215
221
Sign in with Google
216
222
</ Button >
217
223
< Button
218
- type = "submit"
219
224
fullWidth
220
225
variant = "outlined"
221
226
onClick = { ( ) => alert ( 'Sign in with Facebook' ) }
0 commit comments