diff --git a/client/src/modules/user-auth-form/index.tsx b/client/src/modules/user-auth-form/index.tsx index 60a4e342..d6fd2e17 100644 --- a/client/src/modules/user-auth-form/index.tsx +++ b/client/src/modules/user-auth-form/index.tsx @@ -9,6 +9,39 @@ import { authorizeUser } from './requests'; import { useNotifications } from '../../shared/hooks/use-notification'; import React from 'react'; import { AuthorizeUserPayload } from './typings'; +import { Button, Typography } from '@mui/material'; +import { styled } from '@mui/material/styles'; + +const StyledSection = styled('section')(({ theme }) => ({ + paddingTop: theme.spacing(4), + paddingBottom: theme.spacing(4), + paddingLeft: '5vw', + paddingRight: '5vw', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + minHeight: `calc(100vh - 80px)`, +})); + +const StyledForm = styled('form')(() => ({ + width: '80%', + maxWidth: 400, +})); + +const StyledTitle = styled(Typography)(({ theme }) => ({ + fontSize: '2.5rem', + fontFamily: 'Gelasio, serif', + textTransform: 'capitalize', + textAlign: 'center', + marginBottom: theme.spacing(6), +})); + +const StyledFooter = styled('p')(({ theme }) => ({ + marginTop: theme.spacing(2.5), + color: theme.palette.text.secondary, + fontSize: '1.125rem', + textAlign: 'center', +})); const UserAuthForm = ({ type }: { type: string }) => { const [userAuth, setUserAuth] = useAtom(UserAtom); @@ -43,7 +76,7 @@ const UserAuthForm = ({ type }: { type: string }) => { const formRef = React.useRef(null); - const handleSubmit = (e: React.MouseEvent) => { + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); const serverRoute = @@ -101,11 +134,11 @@ const UserAuthForm = ({ type }: { type: string }) => { ) : ( -
-
-

+ + + {type === 'login' ? 'Welcome back' : 'Join us today'} -

+ {type !== 'login' ? ( { icon="fi-rr-key" /> - + -

+ {type === 'login' ? "Don't have an account ?" : 'Already a member ?'} {type === 'login' ? 'Join us today' : 'Sign in here'} -

- -
+ + +
); }; diff --git a/client/src/shared/components/atoms/input-box/index.tsx b/client/src/shared/components/atoms/input-box/index.tsx index dac2c77e..c3b24205 100644 --- a/client/src/shared/components/atoms/input-box/index.tsx +++ b/client/src/shared/components/atoms/input-box/index.tsx @@ -1,4 +1,43 @@ import { Dispatch, SetStateAction, useState } from 'react'; +import { TextField, InputAdornment, IconButton } from '@mui/material'; +import { Visibility, VisibilityOff } from '@mui/icons-material'; +import { styled } from '@mui/material/styles'; + +const StyledTextField = styled(TextField)(({ theme }) => ({ + width: '100%', + '& .MuiOutlinedInput-root': { + borderRadius: '0.375rem', + backgroundColor: theme.palette.mode === 'dark' ? '#09090b' : '#fafafa', + paddingLeft: 0, + '& .input-icon': { + color: theme.palette.mode === 'dark' ? '#a3a3a3' : '#444444', + fontSize: '1.125rem', + lineHeight: 1, + }, + border: `1px solid ${theme.palette.divider}`, + color: theme.palette.text.primary, + '& fieldset': { + border: 'none', + }, + '&.Mui-focused': { + backgroundColor: 'transparent', + borderColor: theme.palette.primary.main, + }, + '& input::placeholder': { + color: theme.palette.mode === 'dark' ? '#fff' : '#000', + opacity: 1, + }, + '&.Mui-disabled': { + backgroundColor: theme.palette.action.disabledBackground, + }, + }, + '& .MuiInputBase-input': { + paddingLeft: '3rem', + }, + '& .MuiInputAdornment-root': { + marginLeft: 0, + }, +})); interface InputBoxProps { name: string; @@ -28,35 +67,40 @@ const InputBox = ({ const [passwordVisible, setPasswordVisible] = useState(false); return ( -
- + setValue?.(e.target.value)} placeholder={placeholder} - defaultValue={value} - id={id} disabled={disable} - className="input-box" - onChange={e => setValue?.(e.target.value)} autoComplete={autoComplete} + fullWidth + variant="outlined" + InputProps={{ + startAdornment: icon ? ( + + + + ) : undefined, + endAdornment: + type === 'password' ? ( + + setPasswordVisible(!passwordVisible)} + edge="end" + tabIndex={-1} + > + {passwordVisible ? : } + + + ) : undefined, + }} /> - - - - {type == 'password' ? ( - setPasswordVisible(!passwordVisible)} - > - ) : ( - '' - )}
); };