From 7f4914c695aabb7a22dfbc08ba8882fa0b71ea50 Mon Sep 17 00:00:00 2001 From: jaanvi Date: Thu, 24 Apr 2025 11:41:34 +0530 Subject: [PATCH] Updation of Modals Ui for Manager and User panel --- .../addmanagerStationModal.tsx | 179 ++++---- src/components/AddSlotModal/addSlotModal.tsx | 402 ++++++++++-------- .../AddStationLocation/addStationLocation.tsx | 2 +- src/components/CustomTable/customTable.tsx | 60 +-- .../editManagerStationModal.tsx | 260 ++++++----- .../EditSlotModal/editSlotModal.tsx | 182 ++++---- src/components/OptionsMenu/index.tsx | 24 +- src/pages/LandingPage/index.tsx | 84 ++-- 8 files changed, 695 insertions(+), 498 deletions(-) diff --git a/src/components/AddManagerStationModal/addmanagerStationModal.tsx b/src/components/AddManagerStationModal/addmanagerStationModal.tsx index ece8e23..92ab622 100644 --- a/src/components/AddManagerStationModal/addmanagerStationModal.tsx +++ b/src/components/AddManagerStationModal/addmanagerStationModal.tsx @@ -30,7 +30,7 @@ const AddManagerStationModal = ({ open, handleClose }: any) => { const payload = { connectorType, - power, + power, price, available, }; @@ -57,10 +57,9 @@ const AddManagerStationModal = ({ open, handleClose }: any) => { top: "50%", left: "50%", transform: "translate(-50%, -50%)", - width: 400, - bgcolor: "background.paper", + width: 500, boxShadow: 24, - p: 3, + p: 0, borderRadius: 2, }} > @@ -70,6 +69,10 @@ const AddManagerStationModal = ({ open, handleClose }: any) => { display: "flex", justifyContent: "space-between", alignItems: "center", + backgroundColor: "#000000", + color: "#D0E1E9", + padding: "20px 24px", + borderRadius: "10px 10px 0 0", }} > @@ -81,78 +84,112 @@ const AddManagerStationModal = ({ open, handleClose }: any) => { {/* Divider */} - - - {/* Connector Type */} - - Connector Type - - - - {/* Power */} - - Power (kW) - - - - {/* Price */} - - Price (₹) - - - - {/* Availability Switch */} - setavailable((prev) => !prev)} - /> - } - label={available ? "Available" : "Not Available"} - sx={{ mt: 2 }} - /> - - {/* Submit */} + {/* */} - + + diff --git a/src/components/AddSlotModal/addSlotModal.tsx b/src/components/AddSlotModal/addSlotModal.tsx index f2d3fc1..6a910f4 100644 --- a/src/components/AddSlotModal/addSlotModal.tsx +++ b/src/components/AddSlotModal/addSlotModal.tsx @@ -98,10 +98,10 @@ const AddSlotModal = ({ open, handleClose }: any) => { top: "50%", left: "50%", transform: "translate(-50%, -50%)", - width: 400, - bgcolor: "background.paper", + width: 500, + boxShadow: 24, - p: 3, + p: 0, borderRadius: 2, }} > @@ -111,6 +111,11 @@ const AddSlotModal = ({ open, handleClose }: any) => { display: "flex", justifyContent: "space-between", alignItems: "center", + backgroundColor: "#000000", + color: "#D0E1E9", + + padding: "16px 24px", + borderRadius: "10px 10px 0 0", }} > @@ -122,182 +127,245 @@ const AddSlotModal = ({ open, handleClose }: any) => { {/* Horizontal Line */} - + {/* */} - {/* Date Range Toggle */} - setIsDateRange(!isDateRange)} - /> - } - label="Select Date Range" + - - {/* Date Input Fields */} - {isDateRange ? ( - <> - - Start Date - - - value >= today || - "Start date cannot be in the past", - })} - type="date" - fullWidth - error={!!errors.startingDate} - helperText={errors.startingDate?.message} - inputProps={{ min: today }} - /> - - End Date - - - value >= today || - "End date cannot be in the past", - })} - type="date" - fullWidth - error={!!errors.endingDate} - helperText={errors.endingDate?.message} - inputProps={{ min: today }} - /> - - ) : ( - <> - - Date - - - value >= today || - "Date cannot be in the past", - })} - type="date" - fullWidth - error={!!errors.date} - helperText={errors.date?.message} - inputProps={{ min: today }} - /> - - )} - - {/* Start Hour */} - - Start Hour - - - - {/* End Hour */} - - End Hour - - - value > startHour || - "End hour must be after start hour", - })} - type="time" - fullWidth - error={!!errors.endHour} - helperText={errors.endHour?.message} - inputProps={{ min: minEndTime }} - /> - - {/* Duration and Duration Unit */} - - Slot Duration - - - + {/* Date Range Toggle */} + setIsDateRange(!isDateRange)} + /> + } + label="Select Date Range" + sx={{ + fontWeight: 500, + fontSize: "16px", + margin: 0, + color: "#000000", + mb: 1, + }} /> - {/* Dropdown for selecting Minutes/Hours */} - - Unit - - - + {/* Date Input Fields */} + {isDateRange ? ( + <> + + Start Date + + + value >= today || + "Start date cannot be in the past", + })} + type="date" + fullWidth + error={!!errors.startingDate} + helperText={errors.startingDate?.message} + inputProps={{ min: today }} + /> + + End Date + + + value >= today || + "End date cannot be in the past", + })} + type="date" + fullWidth + error={!!errors.endingDate} + helperText={errors.endingDate?.message} + inputProps={{ min: today }} + /> + + ) : ( + <> + + Date + + + value >= today || + "Date cannot be in the past", + })} + type="date" + fullWidth + error={!!errors.date} + helperText={errors.date?.message} + inputProps={{ min: today }} + /> + + )} - {/* Availability Toggle */} - - - - {isAvailable ? "Available" : "Not Available"} + Start Hour - + - {/* Submit Button */} - - + + {isAvailable ? "Available" : "Not Available"} + + + + {/* Submit Button */} + - Add Slot - + + diff --git a/src/components/AddStationLocation/addStationLocation.tsx b/src/components/AddStationLocation/addStationLocation.tsx index cce3240..5028724 100644 --- a/src/components/AddStationLocation/addStationLocation.tsx +++ b/src/components/AddStationLocation/addStationLocation.tsx @@ -31,7 +31,7 @@ const AddStationLocationModal = ({ }; return ( - + Search Near By Stations
diff --git a/src/components/CustomTable/customTable.tsx b/src/components/CustomTable/customTable.tsx index 4b92b86..e13cebc 100644 --- a/src/components/CustomTable/customTable.tsx +++ b/src/components/CustomTable/customTable.tsx @@ -648,31 +648,39 @@ const CustomTable: React.FC = ({ }, }} > - - handleMenuAction( - "view" - ) - } - sx={{ - color: "#000000", - fontSize: - "16px", - display: "flex", - alignItems: - "center", - gap: 1, - }} - > - - View - + {user?.userType !== + "manager" && + user?.userType !== + "user" && ( + + handleMenuAction( + "view" + ) + } + sx={{ + color: "#000000", + fontSize: + "16px", + display: + "flex", + alignItems: + "center", + gap: 1, + }} + > + + View + + )} + { user?.userType !== + "user" && ( handleMenuAction( @@ -697,7 +705,7 @@ const CustomTable: React.FC = ({ }} /> Edit - + )} handleMenuAction( diff --git a/src/components/EditManagerStationModal/editManagerStationModal.tsx b/src/components/EditManagerStationModal/editManagerStationModal.tsx index 9e8976b..7050e60 100644 --- a/src/components/EditManagerStationModal/editManagerStationModal.tsx +++ b/src/components/EditManagerStationModal/editManagerStationModal.tsx @@ -128,7 +128,7 @@ const EditManagerStationModal: React.FC = ({ width: 400, bgcolor: "background.paper", boxShadow: 24, - p: 3, + p: 0, borderRadius: 2, }} > @@ -138,6 +138,10 @@ const EditManagerStationModal: React.FC = ({ display: "flex", justifyContent: "space-between", alignItems: "center", + backgroundColor: "#000000", + color: "#D0E1E9", + padding: "20px 24px", + borderRadius: "10px 10px 0 0", }} > @@ -148,121 +152,157 @@ const EditManagerStationModal: React.FC = ({ - + {/* */} - {/* Input Fields */} - - {/* Connector Type */} - - - Connector Type - - ( - - )} - /> - - - {/* Power */} - - - Power - - ( - - )} - /> - - - {/* Price */} - - - Price - - ( - - )} - /> - - - {/* Available Toggle */} - - { - const toggle = !available; - setAvailable(toggle); - setValue("available", toggle); - }} - /> - } - label={available ? "Available" : "Not Available"} - sx={{ mt: 1 }} - /> - - - - {/* Submit Button */} - + + diff --git a/src/components/EditSlotModal/editSlotModal.tsx b/src/components/EditSlotModal/editSlotModal.tsx index 6300345..851483e 100644 --- a/src/components/EditSlotModal/editSlotModal.tsx +++ b/src/components/EditSlotModal/editSlotModal.tsx @@ -73,21 +73,20 @@ const EditSlotModal: React.FC = ({ setLoading(true); try { - await dispatch( updateSlot({ - id: editRow.id, + id: editRow.id, startTime: data.startTime, endTime: data.endTime, }) ).unwrap(); dispatch(fetchManagersSlots()); - handleClose(); - reset(); + handleClose(); + reset(); } catch (error) { console.error("Error updating slot:", error); } finally { - setLoading(false); + setLoading(false); } } }; @@ -112,9 +111,9 @@ const EditSlotModal: React.FC = ({ left: "50%", transform: "translate(-50%, -50%)", width: 400, - bgcolor: "#000000", + boxShadow: 24, - p: 3, + p: 0, borderRadius: 2, }} > @@ -124,6 +123,10 @@ const EditSlotModal: React.FC = ({ display: "flex", justifyContent: "space-between", alignItems: "center", + backgroundColor: "#000000", + color: "#D0E1E9", + padding: "20px 24px", + borderRadius: "10px 10px 0 0", }} > = ({ {/* Horizontal Line */} - - - {/* Input Fields */} - - {/* Start Time */} - - - Start Time - - ( - - )} - /> - - - {/* End Time */} - - - End Time - - ( - - )} - /> - - - - {/* Submit Button */} + {/* */} - + + diff --git a/src/components/OptionsMenu/index.tsx b/src/components/OptionsMenu/index.tsx index 29b6c01..3714ee6 100644 --- a/src/components/OptionsMenu/index.tsx +++ b/src/components/OptionsMenu/index.tsx @@ -11,9 +11,9 @@ const MenuItem = styled(MuiMenuItem)({ margin: "2px 10px", borderBottom: "none", - "& .MuiButtonBase-root-MuiButton-root":{ - fontSize:"16px", - } + "& .MuiButtonBase-root-MuiButton-root": { + fontSize: "16px", + }, }); export default function OptionsMenu({ @@ -48,20 +48,21 @@ export default function OptionsMenu({ paper: { elevation: 0, sx: { + borderRadius: "12px", overflow: "visible", - //filter: "drop-shadow(0px 2px 8px rgba(0,0,0,0.32))", - mt: 1.5, - - "& .MuiList-root": { - background: "#D0E1E9", - - }, + // filter: "drop-shadow(0px 2px 8px rgba(0,0,0,0.32))", + mt: 1, + backgroundColor: "#000000", + // "& .MuiList-root": { + // background: "#000000", + // }, "& .MuiMenuItem-root": { - borderBottom: "none", // Remove any divider under menu items + borderBottom: "none", }, }, }, }} + transformOrigin={{ horizontal: "right", vertical: "top" }} anchorOrigin={{ horizontal: "right", vertical: "bottom" }} > @@ -72,6 +73,7 @@ export default function OptionsMenu({ "&::before": { display: "none", }, + color: "#D0E1E9", }} > Profile diff --git a/src/pages/LandingPage/index.tsx b/src/pages/LandingPage/index.tsx index 0c3db36..ebb9dff 100644 --- a/src/pages/LandingPage/index.tsx +++ b/src/pages/LandingPage/index.tsx @@ -56,7 +56,7 @@ const LandingPage = () => { xs: " #000000", }, color: "white", - fontFamily: "Gilory", + fontFamily: '"Publica Sans Round Medium", sans-serif', display: "flex", flexDirection: "column", }} @@ -79,7 +79,7 @@ const LandingPage = () => { // "linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(30, 44, 47, 0.2) 100%)", background: "#141615", boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.2)", - fontFamily: "Gilory", + fontFamily: '"Publica Sans Round Medium", sans-serif', }} > { color: "#FFFFFF", borderRadius: "6px", width: { xs: "90px", sm: "117px" }, - fontFamily: "Gilory", + fontFamily: + '"Publica Sans Round Medium", sans-serif', textTransform: "none", "&:hover": { backgroundColor: "#439BC1" }, fontWeight: 500, @@ -129,7 +130,7 @@ const LandingPage = () => { sx={{ py: 8, justifyContent: "space-between", - fontFamily: "Gilory", + fontFamily: '"Publica Sans Round Medium", sans-serif', backgroundImage: { lg: 'url("/bgev.svg")', sm: 'url("/bgev.svg")', @@ -146,7 +147,7 @@ const LandingPage = () => { sx={{ py: { xs: 4, sm: 6, md: 8 }, justifyContent: "space-between", - fontFamily: "Gilory", + fontFamily: '"Publica Sans Round Medium", sans-serif', width: { lg: "100%", md: "90%", sm: "90%", xs: "90%" }, }} > @@ -176,7 +177,8 @@ const LandingPage = () => { > { { width: { xs: "120px", md: "140px" }, height: "48px", textTransform: "none", - fontFamily: "Gilory", + fontFamily: + '"Publica Sans Round Medium", sans-serif', "&:hover": { backgroundColor: "#439BC1" }, fontSize: { xs: "14px", md: "16px" }, fontWeight: 500, @@ -332,14 +336,18 @@ const LandingPage = () => { sm: "80px", md: "100px", }} - fontFamily={"Gilory"} + fontFamily={ + '"Publica Sans Round Medium", sans-serif' + } > 50+ { sm: "80px", md: "100px", }} - fontFamily={"Gilory"} + fontFamily={ + '"Publica Sans Round Medium", sans-serif' + } > 100% { sm: "80px", md: "100px", }} - fontFamily={"Gilory"} + fontFamily={ + '"Publica Sans Round Medium", sans-serif' + } > 20+ { sm: "80px", md: "100px", }} - fontFamily={"Gilory"} + fontFamily={ + '"Publica Sans Round Medium", sans-serif' + } > 10+ { { mt={2} maxWidth="600px" mx="auto" - fontFamily={"Gilory"} + fontFamily={'"Publica Sans Round Medium", sans-serif'} fontSize={{ xs: "14px", sm: "16px", md: "20px" }} fontWeight={400} lineHeight={"140%"} @@ -626,7 +646,8 @@ const LandingPage = () => { variant="h6" sx={{ color: "#52ACDF", - fontFamily: "Gilory", + fontFamily: + '"Publica Sans Round Medium", sans-serif', fontWeight: 600, fontSize: { xs: "16px", @@ -641,7 +662,8 @@ const LandingPage = () => { variant="body2" sx={{ color: "#D9D8D8", - fontFamily: "Gilory", + fontFamily: + '"Publica Sans Round Medium", sans-serif', fontWeight: 400, fontSize: { xs: "12px", @@ -670,7 +692,7 @@ const LandingPage = () => { borderRadius: "16px", mt: { xs: 6, md: 10 }, - fontFamily: "Gilory", + fontFamily: '"Publica Sans Round Medium", sans-serif', }} > Key Features @@ -690,7 +712,7 @@ const LandingPage = () => { py: { xs: 2, md: 5 }, px: { xs: 2, md: 3 }, mt: { xs: 6, md: 5 }, - fontFamily: "Gilory", + fontFamily: '"Publica Sans Round Medium", sans-serif', }} > { px: { xs: 2, sm: 3, md: 4 }, mt: { xs: 6, sm: 8, md: 10 }, // height: { xs: "auto", lg: "261px", sm: "208px" }, - fontFamily: "Gilory", + fontFamily: '"Publica Sans Round Medium", sans-serif', borderRadius: "12px", }} > @@ -1239,7 +1261,9 @@ const LandingPage = () => { {/* Text */} { lg: "54px", md: "44px", }, - fontFamily: "Gilory", + fontFamily: + '"Publica Sans Round Medium", sans-serif', textTransform: "none", fontWeight: 500, fontSize: { @@ -1306,7 +1331,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: "Gilory", + fontFamily: '"Publica Sans Round Medium", sans-serif', height: "auto", borderRadius: { xs: "8px", lg: "12px" }, }} @@ -1317,13 +1342,13 @@ const LandingPage = () => { py: 4, px: 3, mt: 2, - fontFamily: "Gilory", + fontFamily: '"Publica Sans Round Medium", sans-serif', }} > @@ -1338,7 +1363,8 @@ const LandingPage = () => { variant="body2" sx={{ my: { xs: 2, sm: 3 }, - fontFamily: "Gilory", + fontFamily: + '"Publica Sans Round Medium", sans-serif', fontWeight: 400, fontSize: { xs: "14px", sm: "18px", md: "20px" }, color: "#FFFFFF",