diff --git a/src/pages/Auth/Login/index.tsx b/src/pages/Auth/Login/index.tsx index a205d50..f4f878a 100644 --- a/src/pages/Auth/Login/index.tsx +++ b/src/pages/Auth/Login/index.tsx @@ -3,14 +3,11 @@ import { Box, Button, Checkbox, - CssBaseline, FormControlLabel, FormLabel, FormControl, TextField, Typography, - Stack, - Card as MuiCard, Grid, IconButton, Link, @@ -25,56 +22,10 @@ import ForgotPassword from "./ForgotPassword.tsx"; import { toast } from "sonner"; import { useNavigate } from "react-router-dom"; import { Visibility, VisibilityOff } from "@mui/icons-material"; -import RemoveRedEyeOutlinedIcon from "@mui/icons-material/RemoveRedEyeOutlined"; -import { createTheme, ThemeProvider } from "@mui/material/styles"; -import { lime, purple } from "@mui/material/colors"; -const Card = styled(MuiCard)(({ theme }) => ({ - display: "flex", - flexDirection: "column", - alignSelf: "center", - width: "100%", - padding: theme.spacing(4), - gap: theme.spacing(2), - margin: "16px", - backgroundColor: "#1E1F1F", - [theme.breakpoints.up("sm")]: { - maxWidth: "450px", - }, - // boxShadow: - // "hsla(220, 30%, 5%, 0.05) 0px 5px 15px 0px, hsla(220, 25%, 10%, 0.05) 0px 15px 35px -5px", - // ...theme.applyStyles("dark", { - // boxShadow: - // "hsla(220, 30%, 5%, 0.5) 0px 5px 15px 0px, hsla(220, 25%, 10%, 0.08) 0px 15px 35px -5px", - // }), -})); -const theme = createTheme({ - palette: { - primary: lime, - secondary: purple, - }, -}); -const SignInContainer = styled(Stack)(({ theme }) => ({ - height: "calc((1 - var(--template-frame-height, 0)) * 100dvh)", - minHeight: "100%", - // padding: theme.spacing(2), - // [theme.breakpoints.up("sm")]: { - // padding: theme.spacing(4), - // }, - "&::before": { - content: '""', - display: "block", - position: "absolute", - zIndex: -1, - inset: 0, - backgroundImage: - "radial-gradient(ellipse at 50% 50%, hsl(210, 100%, 97%), hsl(0, 0%, 100%))", - backgroundRepeat: "no-repeat", - ...theme.applyStyles("dark", { - backgroundImage: - "radial-gradient(at 50% 50%, hsla(210, 100%, 16%, 0.5), hsl(220, 30%, 5%))", - }), - }, -})); +import { Card, SignInContainer } from "./styled.css.tsx"; + + + interface ILoginForm { email: string; password: string; @@ -82,7 +33,6 @@ interface ILoginForm { export default function Login(props: { disableCustomTheme?: boolean }) { const [open, setOpen] = React.useState(false); - console.log("theme", theme.palette.background); const [showPassword, setShowPassword] = React.useState(false); const { control, @@ -113,249 +63,261 @@ export default function Login(props: { disableCustomTheme?: boolean }) { }; return ( - - - - - {/* + {/* */} + + {/* */} - - + + - + - + + {/* */} - textAlign: "center", + - Welcome Back! - - - {/* */} - - - + + Log in with your email and password + + + - Login - - + ( + + )} + /> + + + + - Log in with your email and password - - - - Email - - ( + Password + + ( + - )} - /> - - - - - Password - - ( - - - - setShowPassword( - (prev) => !prev - ) - } - > - {showPassword ? ( - - ) : ( - - )} - - - )} - /> - - + setShowPassword( + (prev) => !prev + ) + } + > + {showPassword ? ( + + ) : ( + + )} + + + )} + /> + + + + } + label="Remember me" + /> + + - - } - label="Remember me" - /> + Forgot password? + + + + - - Forgot your password? - - - - - - {/* or + {/* or */} - - - + + - - - + + + ); } diff --git a/src/pages/Auth/Login/styled.css.tsx b/src/pages/Auth/Login/styled.css.tsx new file mode 100644 index 0000000..69a203e --- /dev/null +++ b/src/pages/Auth/Login/styled.css.tsx @@ -0,0 +1,31 @@ +import { styled} from "@mui/material/styles"; +import { + Stack, + Card as MuiCard +} from "@mui/material"; +// eslint-disable-next-line @typescript-eslint/no-redeclare, @typescript-eslint/no-unused-vars +export const Card = styled(MuiCard)(({ theme }) => ({ + display: "flex", + flexDirection: "column", + alignSelf: "center", + width: "100%", + padding: theme.spacing(4), + gap: theme.spacing(2), + margin: "16px", + backgroundColor: "#1E1F1F", + [theme.breakpoints.up("sm")]: { + maxWidth: "450px", + }, +})); + +export const SignInContainer = styled(Stack)(() => ({ + height: "calc((1 - var(--template-frame-height, 0)) * 100dvh)", + minHeight: "100%", + "&::before": { + content: '""', + display: "block", + position: "absolute", + zIndex: -1, + inset: 0, + }, +}));