removed overkilling stuff

This commit is contained in:
AmitChauhan63390
2024-11-16 23:21:59 +05:30
parent db2f050c4b
commit 459daed60c
2 changed files with 136 additions and 304 deletions

View File

@@ -2,14 +2,7 @@ import axios from "axios";
import { useState, useContext, useEffect, FormEvent } from "react";
import { useNavigate, Link } from "react-router-dom";
import { AuthContext } from "../context/auth";
import {
Box,
Typography,
TextField,
Button,
CircularProgress,
Grid,
} from "@mui/material";
import { Box, Typography, TextField, Button, CircularProgress, Grid } from "@mui/material";
import { useGlobalInfoStore } from "../context/globalInfo";
import { apiUrl } from "../apiConfig";
@@ -33,12 +26,12 @@ const Login = () => {
}
}, [user, navigate]);
const handleChange = (e:any) => {
const handleChange = (e: any) => {
const { name, value } = e.target;
setForm({ ...form, [name]: value });
};
const submitForm = async (e:any) => {
const submitForm = async (e: any) => {
e.preventDefault();
setLoading(true);
try {
@@ -57,36 +50,35 @@ const Login = () => {
};
return (
<Grid container sx={{ height: "calc(100vh - 60px)" }}>
{/* Left Side: Login Form */}
<Grid
item
xs={12}
md={6}
sx={{
display: "flex",
alignItems: "center",
justifyContent: "center",
backgroundColor: "#ffffff", // Light background color
}}
>
<Box
sx={{
display: "flex",
justifyContent: "center",
alignItems: "center",
maxHeight: "100vh",
mt: 6,
padding: 4,
}}
>
<Box
component="form"
onSubmit={submitForm}
sx={{
textAlign: "center",
maxWidth: 400,
width: "100%",
backgroundColor: "#f9f9f9",
backgroundColor: "#ffffff",
padding: 4,
borderRadius: 4,
boxShadow: "0px 0px 20px rgba(0, 0, 0, 0.1)",
border: "2px solid #ff00c3",
boxShadow: "0px 4px 20px rgba(0, 0, 0, 0.1)",
display: "flex",
flexDirection: "column",
alignItems: "center",
maxWidth: 400,
width: "100%",
}}
>
<Typography variant="h4" gutterBottom color="#ff00c3">
<img src="../src/assets/maxunlogo.png" alt="logo" height={55} width={60} style={{ marginBottom: 20, borderRadius: "20%", alignItems: "center" }} />
<Typography variant="h4" gutterBottom>
Welcome Back!
</Typography>
<TextField
@@ -101,26 +93,16 @@ const Login = () => {
sx={{
"& .MuiOutlinedInput-root": {
backgroundColor: email ? "#ffe6f9" : "#ffffff",
"& fieldset": {
borderColor: "#ff33cc",
},
"&:hover fieldset": {
borderColor: "#ff33cc",
},
"&.Mui-focused fieldset": {
borderColor: "#ff33cc",
},
"& fieldset": { borderColor: "#ff33cc" },
"&:hover fieldset": { borderColor: "#ff33cc" },
"&.Mui-focused fieldset": { borderColor: "#ff33cc" },
},
"& input:-webkit-autofill": {
WebkitBoxShadow: "0 0 0 1000px #ffe6f9 inset",
WebkitTextFillColor: "#000",
},
"& .MuiInputLabel-root": {
color: email ? "#ff33cc" : "#000000",
},
"& .MuiInputLabel-root.Mui-focused": {
color: "#ff33cc",
},
"& .MuiInputLabel-root": { color: email ? "#ff33cc" : "#000000" },
"& .MuiInputLabel-root.Mui-focused": { color: "#ff33cc" },
}}
/>
<TextField
@@ -136,29 +118,18 @@ const Login = () => {
sx={{
"& .MuiOutlinedInput-root": {
backgroundColor: password ? "#ffe6f9" : "#ffffff",
"& fieldset": {
borderColor: "#ff33cc",
},
"&:hover fieldset": {
borderColor: "#ff33cc",
},
"&.Mui-focused fieldset": {
borderColor: "#ff33cc",
},
"& fieldset": { borderColor: "#ff33cc" },
"&:hover fieldset": { borderColor: "#ff33cc" },
"&.Mui-focused fieldset": { borderColor: "#ff33cc" },
},
"& input:-webkit-autofill": {
WebkitBoxShadow: "0 0 0 1000px #ffe6f9 inset",
WebkitTextFillColor: "#000",
},
"& .MuiInputLabel-root": {
color: password ? "#ff33cc" : "#000000",
},
"& .MuiInputLabel-root.Mui-focused": {
color: "#ff33cc",
},
"& .MuiInputLabel-root": { color: password ? "#ff33cc" : "#000000" },
"& .MuiInputLabel-root.Mui-focused": { color: "#ff33cc" },
}}
/>
<Button
type="submit"
fullWidth
@@ -176,7 +147,6 @@ const Login = () => {
"Login"
)}
</Button>
<Typography variant="body2" align="center">
Dont have an account?{" "}
<Link to="/register" style={{ textDecoration: "none", color: "#ff33cc" }}>
@@ -184,41 +154,8 @@ const Login = () => {
</Link>
</Typography>
</Box>
</Grid>
{/* Right Side: Aesthetic Info Section */}
<Grid
item
xs={12}
md={6}
sx={{
display: "flex",
alignItems: "center",
justifyContent: "center",
backgroundColor: "#f5f5f5", // Subtle light background
padding: 4,
textAlign: "center",
}}
>
<Box>
<Typography
variant="h3"
gutterBottom
sx={{
fontWeight: "bold",
color: "#ff33cc",
textShadow: "1px 1px 5px rgba(255, 0, 195, 0.2)",
}}
>
Welcome to Maxun
</Typography>
<Typography variant="h6" sx={{ color: "#555" }}>
Maxun is a powerful visual website scraper that makes extracting data from any website as easy as a few clicks.
No more complex code or time-consuming processesMaxun does the heavy lifting for you. Start your data extraction journey with us!
</Typography>
</Box>
</Grid>
</Grid>
);
};