dev-jaanvi #1

Open
jaanvi wants to merge 155 commits from dev-jaanvi into main
15 changed files with 247 additions and 146 deletions
Showing only changes of commit c90f422423 - Show all commits

View file

@ -5,6 +5,7 @@ import Visibility from "@mui/icons-material/Visibility";
import VisibilityOff from "@mui/icons-material/VisibilityOff"; import VisibilityOff from "@mui/icons-material/VisibilityOff";
import { useForm, Controller } from "react-hook-form"; import { useForm, Controller } from "react-hook-form";
import { CustomIconButton, CustomTextField } from "../AddUserModal/styled.css"; import { CustomIconButton, CustomTextField } from "../AddUserModal/styled.css";
import { autofillFix } from "../../shared-theme/customizations/autoFill";
//By Jaanvi : Edit Model :: 11-feb-25 //By Jaanvi : Edit Model :: 11-feb-25
interface AddEditCategoryModalProps { interface AddEditCategoryModalProps {
@ -202,6 +203,7 @@ const AddEditCategoryModal: React.FC<AddEditCategoryModalProps> = ({
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
width: "50%", width: "50%",
...autofillFix,
}} }}
> >
<Typography variant="body2" fontWeight={500}> <Typography variant="body2" fontWeight={500}>
@ -226,6 +228,7 @@ const AddEditCategoryModal: React.FC<AddEditCategoryModalProps> = ({
id="email" id="email"
type="email" type="email"
placeholder="Email" placeholder="Email"
autoComplete="new-email"
required required
fullWidth fullWidth
color={ color={
@ -247,6 +250,7 @@ const AddEditCategoryModal: React.FC<AddEditCategoryModalProps> = ({
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
width: "50%", width: "50%",
...autofillFix,
}} }}
> >
<Typography <Typography
@ -276,6 +280,7 @@ const AddEditCategoryModal: React.FC<AddEditCategoryModalProps> = ({
{...field} {...field}
required required
placeholder="Enter Password" placeholder="Enter Password"
autoComplete="new-password"
type={ type={
showPassword showPassword
? "text" ? "text"

View file

@ -19,6 +19,7 @@ import { CustomIconButton, CustomTextField } from "../AddUserModal/styled.css";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { RootState } from "../../redux/reducers.ts"; import { RootState } from "../../redux/reducers.ts";
import { stationList } from "../../redux/slices/stationSlice.ts"; import { stationList } from "../../redux/slices/stationSlice.ts";
import { autofillFix } from "../../shared-theme/customizations/autoFill.tsx";
export default function AddManagerModal({ export default function AddManagerModal({
open, open,
@ -197,7 +198,7 @@ export default function AddManagerModal({
{/* Email and Password */} {/* Email and Password */}
<Box sx={{ display: "flex", gap: 2, mb: 2 }}> <Box sx={{ display: "flex", gap: 2, mb: 2 }}>
{/* Email */} {/* Email */}
<Box sx={{ flex: 1 }}> <Box sx={{ flex: 1, ...autofillFix }}>
<Typography variant="body2" fontWeight={500}> <Typography variant="body2" fontWeight={500}>
Email Email
</Typography> </Typography>
@ -205,6 +206,7 @@ export default function AddManagerModal({
fullWidth fullWidth
placeholder="Enter Manager Email" placeholder="Enter Manager Email"
size="small" size="small"
autoComplete="new-email"
error={!!errors.email} error={!!errors.email}
helperText={ helperText={
errors.email ? errors.email.message : "" errors.email ? errors.email.message : ""
@ -220,7 +222,7 @@ export default function AddManagerModal({
</Box> </Box>
{/* Password */} {/* Password */}
<Box sx={{ flex: 1 }}> <Box sx={{ flex: 1, ...autofillFix }}>
<Typography variant="body2" fontWeight={500}> <Typography variant="body2" fontWeight={500}>
Password Password
</Typography> </Typography>
@ -244,6 +246,7 @@ export default function AddManagerModal({
<CustomTextField <CustomTextField
{...field} {...field}
required required
autoComplete="new-password"
placeholder="Enter Password" placeholder="Enter Password"
type={ type={
showPassword ? "text" : "password" showPassword ? "text" : "password"

View file

@ -11,6 +11,7 @@ import {
Checkbox, Checkbox,
ListItemText, ListItemText,
InputLabel, InputLabel,
Chip,
} from "@mui/material"; } from "@mui/material";
import CloseIcon from "@mui/icons-material/Close"; import CloseIcon from "@mui/icons-material/Close";
import { useSelector, useDispatch } from "react-redux"; import { useSelector, useDispatch } from "react-redux";
@ -20,7 +21,7 @@ import {
fetchVehicleBrands, fetchVehicleBrands,
vehicleList, vehicleList,
} from "../../redux/slices/VehicleSlice.ts"; // Adjust this import path accordingly } from "../../redux/slices/VehicleSlice.ts"; // Adjust this import path accordingly
import { CustomIconButton, CustomTextField } from "../AddUserModal/styled.css";// Assuming custom styled components import { CustomIconButton, CustomTextField } from "../AddUserModal/styled.css"; // Assuming custom styled components
export default function AddStationModal({ export default function AddStationModal({
open, open,
@ -258,62 +259,79 @@ export default function AddStationModal({
width: "100%", width: "100%",
}} }}
> >
<Typography variant="body2" fontWeight={500}> <Typography
variant="body2"
fontWeight={500}
sx={{ mb: 1 }}
>
Vehicle Brand Vehicle Brand
</Typography> </Typography>
<FormControl fullWidth> <FormControl fullWidth size="small">
<InputLabel>Choose Brands</InputLabel>
<Select <Select
multiple multiple
displayEmpty
value={selectedBrands} value={selectedBrands}
onChange={handleBrandChange} onChange={handleBrandChange}
renderValue={(selected) => { renderValue={(selected) => {
const selectedArray = if (selected.length === 0) {
selected as string[]; return (
const displayNames = <Typography color="text.secondary">
selectedArray.slice(0, 1); // First 2 brands Choose Brands
</Typography>
);
}
const displayNames = (
selected as string[]
).slice(0, 1);
const moreCount = const moreCount =
selectedArray.length - 1; (selected as string[]).length -
1;
return ( return (
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
alignItems: "center", flexWrap: "wrap",
gap: 1, gap: 0.5,
}} }}
> >
{displayNames.map( {displayNames.map((id) => {
(id, index) => { const brand =
const brand = vehicleBrands.find(
vehicleBrands.find( (b) =>
(b) => b.id === id
b.id ===
id
);
return (
<Typography
key={index}
variant="body2"
>
{brand
? brand.name
: ""}
</Typography>
); );
} return brand ? (
)} <Chip
key={id}
label={
brand.name
}
size="small"
sx={{
height: 24,
}}
/>
) : null;
})}
{moreCount > 0 && ( {moreCount > 0 && (
<Typography <Chip
variant="body2" label={`+${moreCount} more`}
color="textSecondary" size="small"
> sx={{ height: 24 }}
+{moreCount} more />
</Typography>
)} )}
</Box> </Box>
); );
}} }}
MenuProps={{
PaperProps: {
style: {
maxHeight: 224,
},
},
}}
> >
{vehicleBrands.length > 0 ? ( {vehicleBrands.length > 0 ? (
vehicleBrands.map((brand) => ( vehicleBrands.map((brand) => (
@ -345,6 +363,7 @@ export default function AddStationModal({
</FormControl> </FormControl>
</Box> </Box>
{/* Replace the Vehicle Name Dropdown code with this */}
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
@ -352,52 +371,79 @@ export default function AddStationModal({
width: "100%", width: "100%",
}} }}
> >
<Typography variant="body2" fontWeight={500}> <Typography
variant="body2"
fontWeight={500}
sx={{ mb: 1 }}
>
Vehicle Name Vehicle Name
</Typography> </Typography>
<FormControl fullWidth> <FormControl
<InputLabel>Choose Vehicles</InputLabel> fullWidth
size="small"
disabled={selectedBrands.length === 0}
>
<Select <Select
multiple multiple
displayEmpty
value={selectedVehicles} value={selectedVehicles}
onChange={handleVehicleChange} onChange={handleVehicleChange}
renderValue={(selected) => { renderValue={(selected) => {
const selectedArray = if (selected.length === 0) {
selected as string[]; return (
const displayNames = <Typography color="text.secondary">
selectedArray.slice(0, 1); // First 2 vehicles {selectedBrands.length ===
0
? "Select brand first"
: "Choose Vehicles"}
</Typography>
);
}
const displayNames = (
selected as string[]
).slice(0, 1);
const moreCount = const moreCount =
selectedArray.length - 1; (selected as string[]).length -
1;
return ( return (
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
alignItems: "center", flexWrap: "wrap",
gap: 1, gap: 0.5,
}} }}
> >
{displayNames.map( {displayNames.map(
(name, index) => ( (name) => (
<Typography <Chip
key={index} key={name}
variant="body2" label={name}
> size="small"
{name} sx={{
</Typography> height: 24,
}}
/>
) )
)} )}
{moreCount > 0 && ( {moreCount > 0 && (
<Typography <Chip
variant="body2" label={`+${moreCount} more`}
color="textSecondary" size="small"
> sx={{ height: 24 }}
+{moreCount} more />
</Typography>
)} )}
</Box> </Box>
); );
}} }}
MenuProps={{
PaperProps: {
style: {
maxHeight: 224,
},
},
}}
> >
{filteredVehicles.length > 0 ? ( {filteredVehicles.length > 0 ? (
filteredVehicles.map((vehicle) => ( filteredVehicles.map((vehicle) => (

View file

@ -12,6 +12,7 @@ import Visibility from "@mui/icons-material/Visibility";
import VisibilityOff from "@mui/icons-material/VisibilityOff"; import VisibilityOff from "@mui/icons-material/VisibilityOff";
import { useForm, Controller } from "react-hook-form"; import { useForm, Controller } from "react-hook-form";
import { CustomIconButton, CustomTextField } from "./styled.css.tsx"; import { CustomIconButton, CustomTextField } from "./styled.css.tsx";
import { autofillFix } from "../../shared-theme/customizations/autoFill.tsx";
interface FormData { interface FormData {
name: string; name: string;
@ -109,6 +110,7 @@ const AddUserModal: React.FC<AddUserModalProps> = ({
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
flex: 1, flex: 1,
...autofillFix,
}} }}
> >
<Typography variant="body2" fontWeight={500}> <Typography variant="body2" fontWeight={500}>
@ -134,6 +136,7 @@ const AddUserModal: React.FC<AddUserModalProps> = ({
<CustomTextField <CustomTextField
{...field} {...field}
required required
autoComplete="username"
placeholder="Enter User Name" placeholder="Enter User Name"
fullWidth fullWidth
size="small" size="small"
@ -149,6 +152,7 @@ const AddUserModal: React.FC<AddUserModalProps> = ({
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
flex: 1, flex: 1,
...autofillFix,
}} }}
> >
<Typography variant="body2" fontWeight={500}> <Typography variant="body2" fontWeight={500}>
@ -172,6 +176,7 @@ const AddUserModal: React.FC<AddUserModalProps> = ({
helperText={errors.email?.message} helperText={errors.email?.message}
type="email" type="email"
placeholder="Email" placeholder="Email"
autoComplete="new-email"
required required
fullWidth fullWidth
color={ color={
@ -190,6 +195,7 @@ const AddUserModal: React.FC<AddUserModalProps> = ({
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
flex: 1, flex: 1,
...autofillFix,
}} }}
> >
<Typography variant="body2" fontWeight={500}> <Typography variant="body2" fontWeight={500}>
@ -211,6 +217,7 @@ const AddUserModal: React.FC<AddUserModalProps> = ({
{...field} {...field}
required required
placeholder="Enter Password" placeholder="Enter Password"
autoComplete="new-password"
type={ type={
showPassword ? "text" : "password" showPassword ? "text" : "password"
} }

View file

@ -20,10 +20,7 @@ import {
fetchVehicleBrands, fetchVehicleBrands,
vehicleList, vehicleList,
} from "../../redux/slices/VehicleSlice"; } from "../../redux/slices/VehicleSlice";
import { import { CustomIconButton, CustomTextField } from "../AddUserModal/styled.css"; // Assuming custom styled components
CustomIconButton,
CustomTextField,
} from "../AddUserModal/styled.css"; // Assuming custom styled components
interface FormData { interface FormData {
name: string; name: string;
@ -94,7 +91,7 @@ const EditStationModal: React.FC<EditStationModalProps> = ({
); );
const brandId = firstVehicle ? firstVehicle.company : ""; const brandId = firstVehicle ? firstVehicle.company : "";
setSelectedBrand(brandId); setSelectedBrands(brandId);
// Populate selected vehicles // Populate selected vehicles
const vehicleNames = vehicles const vehicleNames = vehicles
@ -116,15 +113,13 @@ const EditStationModal: React.FC<EditStationModalProps> = ({
setSelectedVehicles(editRow.allowedCarIds || []); setSelectedVehicles(editRow.allowedCarIds || []);
// Set selectedBrands based on the vehicles associated with the station // Set selectedBrands based on the vehicles associated with the station
const brands = editRow?.allowedCarIds const brands = editRow?.allowedCarIds
? vehicles ? vehicles
.filter((vehicle) => .filter((vehicle) =>
editRow.allowedCarIds.includes(vehicle.id) editRow.allowedCarIds.includes(vehicle.id)
) )
.map((vehicle) => vehicle.company) .map((vehicle) => vehicle.company)
: []; : [];
setSelectedBrands(brands); setSelectedBrands(brands);
} else { } else {
@ -134,13 +129,11 @@ const EditStationModal: React.FC<EditStationModalProps> = ({
} }
}, [editRow, setValue, reset, vehicles]); }, [editRow, setValue, reset, vehicles]);
// Filter vehicles based on selected brands // Filter vehicles based on selected brands
const filteredVehicles = vehicles.filter((vehicle) => const filteredVehicles = vehicles.filter((vehicle) =>
selectedBrands.includes(vehicle.company) selectedBrands.includes(vehicle.company)
); );
// Handle changes in vehicle brand selection // Handle changes in vehicle brand selection
const handleBrandChange = ( const handleBrandChange = (
event: React.ChangeEvent<{ value: unknown }> event: React.ChangeEvent<{ value: unknown }>
@ -155,7 +148,6 @@ const EditStationModal: React.FC<EditStationModalProps> = ({
setSelectedVehicles(filtered.map((v) => v.name)); // Automatically select vehicles for the selected brands setSelectedVehicles(filtered.map((v) => v.name)); // Automatically select vehicles for the selected brands
}; };
// Handle changes in vehicle selection // Handle changes in vehicle selection
const handleCheckboxChange = ( const handleCheckboxChange = (
event: React.ChangeEvent<{ value: unknown }> event: React.ChangeEvent<{ value: unknown }>
@ -165,27 +157,26 @@ const EditStationModal: React.FC<EditStationModalProps> = ({
setValue("allowedCarIds", value); setValue("allowedCarIds", value);
}; };
const onSubmit = (data: FormData) => { const onSubmit = (data: FormData) => {
const vehicleIds = vehicles const vehicleIds = vehicles
.filter((vehicle) => selectedVehicles.includes(vehicle.name)) .filter((vehicle) => selectedVehicles.includes(vehicle.name))
.map((vehicle) => Number(vehicle.id)); .map((vehicle) => Number(vehicle.id));
handleUpdate( handleUpdate(
editRow.id, editRow.id,
data.name, data.name,
data.registeredAddress, data.registeredAddress,
data.totalSlots, data.totalSlots,
vehicleIds vehicleIds
); );
handleClose(); handleClose();
reset(); reset();
setSelectedBrands([]); // Reset brands after submit setSelectedBrands([]); // Reset brands after submit
setSelectedVehicles([]); // Reset selected vehicles setSelectedVehicles([]); // Reset selected vehicles
}; };
console.log("editRow:", editRow); console.log("editRow:", editRow);
return ( return (
<Modal <Modal
open={open} open={open}

View file

@ -78,10 +78,14 @@ export default function Header() {
spacing={2} spacing={2}
alignItems="center" alignItems="center"
sx={{ sx={{
pointer: "cursor",
display: { xs: "none", sm: "flex" }, // Hide on mobile, show on larger screens display: { xs: "none", sm: "flex" }, // Hide on mobile, show on larger screens
}} }}
> >
<NotificationsNoneIcon onClick={toggleNotifications} /> <NotificationsNoneIcon
sx={{ pointer: "cursor" }}
onClick={toggleNotifications}
/>
<Avatar <Avatar
alt="User Avatar" alt="User Avatar"
src="/avatar.png" src="/avatar.png"

View file

@ -12,43 +12,37 @@ import { fetchDashboardData } from "../../redux/slices/dashboardSlice";
import { useEffect } from "react"; import { useEffect } from "react";
export default function MainGrid() { export default function MainGrid() {
const dispatch = useDispatch<AppDispatch>(); const dispatch = useDispatch<AppDispatch>();
const { const {
totalAdmins, totalAdmins,
totalManagers, totalManagers,
totalUsers, totalUsers,
totalStations, totalStations,
loading, loading,
error, error,
} = useSelector((state: RootState) => state.dashboardReducer); } = useSelector((state: RootState) => state.dashboardReducer);
const staticData = {
const staticData = {
totalAdmins: 86, totalAdmins: 86,
totalManagers: 12, totalManagers: 12,
totalUsers: 24, totalUsers: 24,
totalStations: 8, totalStations: 8,
}; };
useEffect(() => {
dispatch(fetchDashboardData());
useEffect(() => {
dispatch(fetchDashboardData());
}, [dispatch]); }, [dispatch]);
const data = const data = { totalAdmins, totalManagers, totalUsers, totalStations };
{ totalAdmins, totalManagers, totalUsers, totalStations }
const statCards = [
const statCards = [
{ title: "Total Admins", value: data.totalAdmins }, { title: "Total Admins", value: data.totalAdmins },
{ title: "Total Managers", value: data.totalManagers }, { title: "Total Managers", value: data.totalManagers },
{ title: "Total Users", value: data.totalUsers }, { title: "Total Users", value: data.totalUsers },
{ title: "Total Stations", value: data.totalStations }, { title: "Total Stations", value: data.totalStations },
]; ];
return ( return (
<Box <Box
sx={{ sx={{
width: "100%", width: "100%",
@ -86,5 +80,5 @@ export default function MainGrid() {
</Grid> </Grid>
</Grid> </Grid>
</Box> </Box>
); );
} }

View file

@ -17,7 +17,7 @@ export default function MenuButton({
invisible={!showBadge} invisible={!showBadge}
sx={{ [`& .${badgeClasses.badge}`]: { right: 2, top: 2 } }} sx={{ [`& .${badgeClasses.badge}`]: { right: 2, top: 2 } }}
> >
<IconButton size="small" {...props} /> <IconButton sx={{ marginRight: "60px" }} size="small" {...props} />
</Badge> </Badge>
); );
} }

View file

@ -144,7 +144,9 @@ export default function MenuContent({ hidden }: PropType) {
fontSize: "16px", fontSize: "16px",
letterSpacing: "0%", letterSpacing: "0%",
lineHeight: "100%", lineHeight: "100%",
color: "#D9D8D8", whiteSpace: "pre",
color: "#FAFAFA",
marginTop: "5px",
}, },
}} }}
primary={item.text} primary={item.text}

View file

@ -22,6 +22,7 @@ import { Visibility, VisibilityOff } from "@mui/icons-material";
import { Card, SignInContainer } from "./styled.css.tsx"; import { Card, SignInContainer } from "./styled.css.tsx";
import { CustomIconButton } from "../../../components/AddUserModal/styled.css.tsx"; import { CustomIconButton } from "../../../components/AddUserModal/styled.css.tsx";
import { AppDispatch } from "../../../redux/store/store.ts"; import { AppDispatch } from "../../../redux/store/store.ts";
import { autofillFix } from "../../../shared-theme/customizations/autoFill.tsx";
interface ILoginForm { interface ILoginForm {
email: string; email: string;
@ -73,7 +74,6 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
<AppTheme {...props}> <AppTheme {...props}>
<SignInContainer direction="column" justifyContent="space-between"> <SignInContainer direction="column" justifyContent="space-between">
<Grid container sx={{ minHeight: "100vh" }}> <Grid container sx={{ minHeight: "100vh" }}>
<Grid <Grid
item item
xs={0} xs={0}
@ -86,7 +86,6 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
position: "relative", position: "relative",
}} }}
> >
<Box <Box
sx={{ sx={{
position: "absolute", position: "absolute",
@ -122,7 +121,6 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
position: "relative", position: "relative",
}} }}
> >
<Box <Box
sx={{ sx={{
display: { xs: "flex", md: "none" }, display: { xs: "flex", md: "none" },
@ -164,7 +162,12 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
<Card <Card
variant="outlined" variant="outlined"
sx={{ sx={{
width: { xs: "100%", sm: "90%", md: "90%", lg: "408px" }, width: {
xs: "100%",
sm: "90%",
md: "90%",
lg: "408px",
},
maxWidth: "408px", maxWidth: "408px",
minHeight: { xs: "auto", md: "428px" }, minHeight: { xs: "auto", md: "428px" },
padding: { xs: "16px", sm: "20px", md: "24px" }, padding: { xs: "16px", sm: "20px", md: "24px" },
@ -201,7 +204,7 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
variant="subtitle2" variant="subtitle2"
sx={{ sx={{
textAlign: "center", textAlign: "center",
color: "white", color: "#D9D8D8",
fontSize: { xs: "14px", md: "16px" }, fontSize: { xs: "14px", md: "16px" },
mb: 1, mb: 1,
}} }}
@ -214,12 +217,14 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
<FormLabel <FormLabel
htmlFor="email" htmlFor="email"
sx={{ sx={{
borderRadius: "8px",
fontSize: { fontSize: {
xs: "0.875rem", xs: "0.875rem",
sm: "1rem", sm: "1rem",
}, },
color: "white", color: "white",
mb: 0.5, mb: 0.5,
...autofillFix,
}} }}
> >
Email Email
@ -258,7 +263,10 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
} }
InputProps={{ InputProps={{
sx: { sx: {
height: { xs: "45px", md: "50px" }, height: {
xs: "45px",
md: "50px",
},
alignItems: "center", alignItems: "center",
backgroundColor: backgroundColor:
"#1E1F1F", "#1E1F1F",
@ -269,7 +277,7 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
{ {
backgroundColor: backgroundColor:
"#1E1F1F", "#1E1F1F",
borderRadius: "4px", borderRadius: "8px",
"& fieldset": { "& fieldset": {
borderColor: borderColor:
"#4b5255", "#4b5255",
@ -302,6 +310,7 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
fontFamily: fontFamily:
"Gilroy, sans-serif", "Gilroy, sans-serif",
}, },
...autofillFix,
}} }}
/> />
)} )}
@ -313,6 +322,7 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
<FormLabel <FormLabel
htmlFor="password" htmlFor="password"
sx={{ sx={{
borderRadius: "8px",
fontSize: { fontSize: {
xs: "0.875rem", xs: "0.875rem",
sm: "1rem", sm: "1rem",
@ -350,13 +360,13 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
} }
name="password" name="password"
placeholder="Password" placeholder="Password"
autoComplete="current-password"
type={ type={
showPassword showPassword
? "text" ? "text"
: "password" : "password"
} }
id="password" id="password"
autoComplete="current-password"
required required
fullWidth fullWidth
variant="outlined" variant="outlined"
@ -367,8 +377,13 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
} }
InputProps={{ InputProps={{
sx: { sx: {
height: { xs: "45px", md: "50px" }, height: {
xs: "45px",
md: "50px",
},
...autofillFix,
}, },
endAdornment: ( endAdornment: (
<InputAdornment position="end"> <InputAdornment position="end">
<CustomIconButton <CustomIconButton
@ -392,7 +407,7 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
{ {
backgroundColor: backgroundColor:
"#1E1F1F", "#1E1F1F",
borderRadius: "4px", borderRadius: "8px",
"& fieldset": { "& fieldset": {
borderColor: borderColor:
"#4b5255", "#4b5255",
@ -471,8 +486,8 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
fontSize: { fontSize: {
xs: "0.75rem", xs: "0.75rem",
sm: "0.875rem", sm: "0.875rem",
md: "1rem" md: "1rem",
} },
}} }}
> >
Remember me Remember me
@ -492,17 +507,17 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
fontSize: { fontSize: {
xs: "0.75rem", xs: "0.75rem",
sm: "0.875rem", sm: "0.875rem",
md: "1rem" md: "1rem",
}, },
}} }}
> >
Forgot password? Forgot password?
</Link> </Link>
</Box> </Box>
<ForgotPassword {/* <ForgotPassword
open={open} open={open}
handleClose={handleClose} handleClose={handleClose}
/> /> */}
{/* Login Button */} {/* Login Button */}
<Button <Button
@ -518,7 +533,10 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
}, },
padding: { xs: "8px 0", md: "10px 0" }, padding: { xs: "8px 0", md: "10px 0" },
mt: { xs: 2, md: 3 }, mt: { xs: 2, md: 3 },
fontSize: { xs: "0.875rem", md: "1rem" }, fontSize: {
xs: "0.875rem",
md: "1rem",
},
}} }}
> >
Login Login

View file

@ -1,5 +1,5 @@
import { createSlice, createAsyncThunk, PayloadAction } from "@reduxjs/toolkit"; import { createSlice, createAsyncThunk, PayloadAction } from "@reduxjs/toolkit";
import axios from "axios"; // import axios from "axios";
import http from "../../lib/https"; import http from "../../lib/https";
import { toast } from "sonner"; import { toast } from "sonner";

View file

@ -1,5 +1,5 @@
import { createSlice, createAsyncThunk, PayloadAction } from "@reduxjs/toolkit"; import { createSlice, createAsyncThunk, PayloadAction } from "@reduxjs/toolkit";
import axios from "axios"; // import axios from "axios";
import http from "../../lib/https"; import http from "../../lib/https";
import { toast } from "sonner"; import { toast } from "sonner";

View file

@ -0,0 +1,27 @@
export const autofillFix = {
"& input:-webkit-autofill": {
WebkitBoxShadow: "0 0 0 1000px transparent inset !important",
WebkitTextFillColor: "white !important",
transition: "background-color 5000s ease-in-out 0s",
},
"& input:-webkit-autofill:hover": {
WebkitBoxShadow: "0 0 0 1000px transparent inset !important",
},
"& input:-webkit-autofill:focus": {
WebkitBoxShadow: "0 0 0 1000px transparent inset !important",
},
"& input:-webkit-autofill:active": {
WebkitBoxShadow: "0 0 0 1000px transparent inset !important",
},
"& input:-moz-autofill": {
boxShadow: "0 0 0 1000px transparent inset !important",
MozTextFillColor: "white !important",
transition: "background-color 5000s ease-in-out 0s",
},
"& input:autofill": {
boxShadow: "0 0 0 1000px transparent inset !important",
textFillColor: "white !important",
transition: "background-color 5000s ease-in-out 0s",
},
};

View file

@ -8,6 +8,7 @@ import CheckBoxOutlineBlankRoundedIcon from '@mui/icons-material/CheckBoxOutline
import CheckRoundedIcon from '@mui/icons-material/CheckRounded'; import CheckRoundedIcon from '@mui/icons-material/CheckRounded';
import RemoveRoundedIcon from '@mui/icons-material/RemoveRounded'; import RemoveRoundedIcon from '@mui/icons-material/RemoveRounded';
import { gray, brand } from '../themePrimitives'; import { gray, brand } from '../themePrimitives';
import {autofillFix} from './autoFill';
/* eslint-disable import/prefer-default-export */ /* eslint-disable import/prefer-default-export */
export const inputsCustomizations = { export const inputsCustomizations = {
@ -379,6 +380,7 @@ export const inputsCustomizations = {
styleOverrides: { styleOverrides: {
input: { input: {
padding: 0, padding: 0,
...autofillFix,
}, },
root: ({ theme }) => ({ root: ({ theme }) => ({
padding: '8px 12px', padding: '8px 12px',

View file

@ -8,6 +8,7 @@ import CheckBoxOutlineBlankRoundedIcon from "@mui/icons-material/CheckBoxOutline
import CheckRoundedIcon from "@mui/icons-material/CheckRounded"; import CheckRoundedIcon from "@mui/icons-material/CheckRounded";
import RemoveRoundedIcon from "@mui/icons-material/RemoveRounded"; import RemoveRoundedIcon from "@mui/icons-material/RemoveRounded";
import { gray, brand } from "../themePrimitives"; import { gray, brand } from "../themePrimitives";
import { autofillFix } from "./autoFill";
/* eslint-disable import/prefer-default-export */ /* eslint-disable import/prefer-default-export */
export const inputsCustomizations: Components<Theme> = { export const inputsCustomizations: Components<Theme> = {
@ -393,6 +394,7 @@ export const inputsCustomizations: Components<Theme> = {
styleOverrides: { styleOverrides: {
input: { input: {
padding: 0, padding: 0,
...autofillFix,
}, },
root: ({ theme }) => ({ root: ({ theme }) => ({
padding: "8px 12px", padding: "8px 12px",