diff --git a/src/components/AddBookingModal/addBookingModal.tsx b/src/components/AddBookingModal/addBookingModal.tsx index 605b1c8..4062a81 100644 --- a/src/components/AddBookingModal/addBookingModal.tsx +++ b/src/components/AddBookingModal/addBookingModal.tsx @@ -23,7 +23,7 @@ import { toast } from "sonner"; import { CustomIconButton, CustomTextField } from "../AddUserModal/styled.css"; import { getAllStations } from "../../redux/slices/stationSlice.ts"; import { fetchAvailableSlots } from "../../redux/slices/slotSlice.ts"; - +import { autofillFix } from "../../shared-theme/customizations/autoFill"; export default function AddBookingModal({ open, handleClose, @@ -108,11 +108,14 @@ export default function AddBookingModal({ top: "50%", left: "50%", transform: "translate(-50%, -50%)", - width: 400, + // width: 400, bgcolor: "background.paper", boxShadow: 24, p: 3, borderRadius: 2, + width: "100%", + maxWidth: 600, + overflow: "auto", }} > {/* Station ID */} - - + + Select Station - - Select Station + {/* Station ID Field */} + + {/* Safely render the error message */} {errors.stationId && ( - {errors.stationName.message} + {errors.stationId.message} )} - - + + Date @@ -198,8 +230,15 @@ export default function AddBookingModal({ {/* Car Port and Date */} {/* Car Name */} - - + + Car Name + {errors.carName && ( {/* Car Port */} - - + + Car Port - Car Port + {errors.carPort && ( - - + + Start Time - - + + End Time - - + + Car Number ); -} \ No newline at end of file +} diff --git a/src/components/AddStationModal/addStationModal.tsx b/src/components/AddStationModal/addStationModal.tsx index a27b518..4b499c7 100644 --- a/src/components/AddStationModal/addStationModal.tsx +++ b/src/components/AddStationModal/addStationModal.tsx @@ -207,7 +207,6 @@ export default function AddStationModal({ placeholder="Enter Charging Station Address" size="small" sx={{ marginTop: 1 }} - error={!!errors.registeredAddress} helperText={ errors.registeredAddress @@ -239,7 +238,6 @@ export default function AddStationModal({ placeholder="Enter Total Slots" size="small" sx={{ marginTop: 1 }} - type="number" error={!!errors.totalSlots} helperText={ @@ -261,120 +259,118 @@ export default function AddStationModal({ {/* Vehicle Brand Dropdown with Checkboxes */} - + - - Vehicle Brand - - - { + if (selected.length === 0) { return ( - - {displayNames.map((id) => { - const brand = - vehicleBrands.find( - (b) => - b.id === id - ); - return brand ? ( - - ) : null; - })} - {moreCount > 0 && ( - - )} - + + Choose Brands + ); - }} - MenuProps={{ - PaperProps: { - style: { - maxHeight: 224, - }, - }, - }} - > - {vehicleBrands.length > 0 ? ( - vehicleBrands.map((brand) => ( - - - - - )) - ) : ( - - No vehicle brands available - - )} - - - {errors.vehicleBrand - ? errors.vehicleBrand.message - : ""} - - - + } + + const displayNames = ( + selected as string[] + ).slice(0, 1); + const moreCount = + (selected as string[]).length - + 1; + + return ( + + {displayNames.map((id,index) => { + const brand = + vehicleBrands.find( + (b) => + b.id === id + ); + return brand ? ( + + {brand + ? brand.name + : ""} + + ) : null; + })} + + {moreCount > 0 && ( + + +{moreCount} more + + )} + + ); + }} + MenuProps={{ + PaperProps: { + style: { + maxHeight: 224, + }, + }, + }} + > + {vehicleBrands.length > 0 ? ( + vehicleBrands.map((brand) => ( + + + + + )) + ) : ( + + No vehicle brands available + + )} + + + {errors.vehicleBrand + ? errors.vehicleBrand.message + : ""} + + + - {/* Replace the Vehicle Name Dropdown code with this */} { @@ -424,28 +419,29 @@ export default function AddStationModal({ {displayNames.map( - (name) => ( - + (name, index) => ( + + {name} + ) )} {moreCount > 0 && ( - + + +{moreCount} more + )} ); diff --git a/src/components/CustomTable/customTable.tsx b/src/components/CustomTable/customTable.tsx index 0d02790..5e1c6f3 100644 --- a/src/components/CustomTable/customTable.tsx +++ b/src/components/CustomTable/customTable.tsx @@ -624,6 +624,8 @@ const CustomTable: React.FC = ({ onClick={(e) => { e.stopPropagation(); setViewModal(true); + + }} color="primary" sx={{ @@ -640,6 +642,7 @@ const CustomTable: React.FC = ({ handleViewButton(selectedRow?.id) + } open={viewModal} setViewModal={setViewModal} @@ -698,6 +701,7 @@ const CustomTable: React.FC = ({ setModalOpen(true); // Only open if a row is selected setRowData(selectedRow); } + handleClose(); }} color="primary" sx={{ @@ -755,6 +759,7 @@ const CustomTable: React.FC = ({ onClick={(e) => { e.stopPropagation(); setDeleteModal(true); + handleClose(); }} color="error" sx={{ diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 9abb2d9..6843b06 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -110,7 +110,7 @@ export default function Header() { - {showNotifications && ( + {/* {showNotifications && ( - {/* - Notifications - */} + No notifications yet - )} + )} */} ); diff --git a/src/components/Modals/ViewModal/index.tsx b/src/components/Modals/ViewModal/index.tsx index 138d34d..ae4a863 100644 --- a/src/components/Modals/ViewModal/index.tsx +++ b/src/components/Modals/ViewModal/index.tsx @@ -78,7 +78,7 @@ export default function ViewModal({ open, setViewModal, id }: Props) { {selectedAdmin ? ( - + Name: diff --git a/src/components/SideMenuMobile/index.tsx b/src/components/SideMenuMobile/index.tsx index b761442..e77a1bf 100644 --- a/src/components/SideMenuMobile/index.tsx +++ b/src/components/SideMenuMobile/index.tsx @@ -66,13 +66,13 @@ export default function SideMenuMobile({ Super Admin - + {/* - + */} - @@ -85,7 +85,7 @@ export default function SideMenuMobile({ e.stopPropagation(); setLogoutModal(true); }} - sx={{ color: "red" }} + > Logout diff --git a/src/pages/LandingPage/index.tsx b/src/pages/LandingPage/index.tsx index 4bd87f7..0c3db36 100644 --- a/src/pages/LandingPage/index.tsx +++ b/src/pages/LandingPage/index.tsx @@ -288,8 +288,8 @@ const LandingPage = () => { spacing={2} textAlign="center" sx={{ - display: { xs: "grid", }, - + display: { xs: "grid" }, + gridTemplateColumns: { xs: "repeat(2, 1fr)", // Two items per row on mobile sm: "repeat(4, 1fr)", @@ -670,7 +670,7 @@ const LandingPage = () => { borderRadius: "16px", mt: { xs: 6, md: 10 }, - fontFamily: "Neue Montreal", + fontFamily: "Gilory", }} > Key Features @@ -690,7 +690,7 @@ const LandingPage = () => { py: { xs: 2, md: 5 }, px: { xs: 2, md: 3 }, mt: { xs: 6, md: 5 }, - fontFamily: "Neue Montreal", + fontFamily: "Gilory", }} > { px: { xs: 2, sm: 3, md: 4 }, mt: { xs: 6, sm: 8, md: 10 }, // height: { xs: "auto", lg: "261px", sm: "208px" }, - fontFamily: "Neue Montreal", + fontFamily: "Gilory", borderRadius: "12px", }} > @@ -1271,7 +1271,7 @@ const LandingPage = () => { lg: "54px", md: "44px", }, - fontFamily: "Neue Montreal", + fontFamily: "Gilory", textTransform: "none", fontWeight: 500, fontSize: { @@ -1306,7 +1306,7 @@ const LandingPage = () => { px: { xs: 2, sm: 3, md: 4 }, mt: { xs: 6, sm: 8, md: 10 }, mb: { xs: 6, sm: 8, md: 10 }, - fontFamily: "Neue Montreal", + fontFamily: "Gilory", height: "auto", borderRadius: { xs: "8px", lg: "12px" }, }} @@ -1317,7 +1317,7 @@ const LandingPage = () => { py: 4, px: 3, mt: 2, - fontFamily: "Neue Montreal", + fontFamily: "Gilory", }} > { variant="body2" sx={{ my: { xs: 2, sm: 3 }, - fontFamily: "Inter", + fontFamily: "Gilory", fontWeight: 400, fontSize: { xs: "14px", sm: "18px", md: "20px" }, color: "#FFFFFF",