Resolve minor issues

This commit is contained in:
jaanvi 2025-03-31 10:12:42 +05:30
parent e038428607
commit 1519e2ad93
6 changed files with 28 additions and 28 deletions

View file

@ -3,7 +3,7 @@ import { IconButton, TextField } from "@mui/material";
export const CustomIconButton = styled(IconButton)({
backgroundColor: "transparent",
"&:hover": {
backgroundColor: "#272727",
backgroundColor: "transparent",
},
"*:where([data-mui-color-scheme='dark']) &": {
backgroundColor: "transparent",
@ -20,7 +20,4 @@ export const CustomTextField = styled(TextField)({
"& .MuiInputBase-root.Mui-focused .MuiInputBase-input::placeholder": {
color: "darkgray",
},
});

View file

@ -34,7 +34,7 @@ import { CustomIconButton } from "../AddEditUserModel/styled.css.tsx";
import ManagerViewModal from "../Modals/ViewManagerModal";
import UserViewModal from "../Modals/UserViewModal/index.tsx";
import { deleteUser, userList } from "../../redux/slices/userSlice.ts";
import { deleteStation } from "../../redux/slices/stationSlice.ts";
import { deleteStation, stationList } from "../../redux/slices/stationSlice.ts";
import StationViewModal from "../Modals/StationViewModal/index.tsx";
import {
deleteSlot,
@ -183,6 +183,9 @@ const CustomTable: React.FC<CustomTableProps> = ({
case "slots":
dispatch(fetchAvailableSlots());
break;
case "station":
dispatch(stationList());
break;
default:
console.error("Unknown table type:", tableType);
return;

View file

@ -132,7 +132,7 @@ const EditStationModal: React.FC<EditStationModalProps> = ({
);
handleClose();
reset();
setSelectedBrands([]); // Reset brands after submit
//setSelectedBrands([]); // Reset brands after submit
setSelectedVehicles([]); // Reset selected vehicles
};

View file

@ -8,7 +8,7 @@ type Props = {
open: boolean;
setViewModal: Function;
handleView: (id: string | undefined) => void;
id?: number | undefined;
id?: string | undefined;
};
const style = {

View file

@ -330,9 +330,7 @@ export default function Login(props: { disableCustomTheme?: boolean }) {
? "error"
: "primary"
}
onMouseDown={
togglePasswordVisibility
}
InputProps={{
endAdornment: (
<InputAdornment position="end">

View file

@ -2,7 +2,12 @@ import { Chip } from "@mui/material";
import AddStationModal from "../../components/AddStationModal";
import CustomTable, { Column } from "../../components/CustomTable";
import EditStationModal from "../../components/EditStationModal";
import { createStation, stationList, toggleStatus, updateStation } from "../../redux/slices/stationSlice";
import {
createStation,
stationList,
toggleStatus,
updateStation,
} from "../../redux/slices/stationSlice";
import { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { RootState } from "../../redux/reducers";
@ -20,14 +25,13 @@ export default function StationList() {
const [rowData, setRowData] = useState<any | null>(null);
const [searchTerm, setSearchTerm] = useState("");
const dispatch = useDispatch<AppDispatch>();
const vehicles = useSelector(
(state: RootState) => state.vehicleReducer.vehicles
);
const stations = useSelector(
(state: RootState) => state.stationReducer.stations
);
const vehicles = useSelector(
(state: RootState) => state.vehicleReducer.vehicles
);
useEffect(() => {
dispatch(stationList());
}, [dispatch]);
@ -84,23 +88,21 @@ export default function StationList() {
}
};
const handleStatusToggle = async (id: string, newStatus: number) => {
await dispatch(toggleStatus({ id, status: newStatus }));
};
const filterStations = Array.isArray(stations)
? stations.filter((station) =>
station.name
.toLocaleLowerCase()
.includes(searchTerm.toLowerCase())
)
: [];
// const filterStations = Array.isArray(stations)
// ? stations.filter((station) =>
// station.name
// .toLocaleLowerCase()
// .includes(searchTerm.toLowerCase())
// )
// : [];
// Mapping and formatting vehicles
const categoryRows = filterStations?.length
? filterStations?.map((station: any, index: number) => {
const categoryRows = stations?.length
? stations?.map((station: any, index: number) => {
// Format the selected vehicles from the allowedCars array
const formattedVehicles = station.allowedCars?.map(
(car: any) => car.name
@ -128,7 +130,7 @@ export default function StationList() {
};
})
: [];
console.log("Rowssss",categoryRows)
console.log("Rowssss", categoryRows);
const categoryColumns: Column[] = [
{ id: "srno", label: "Sr No" },