diff --git a/src/Components/HeaderMain.jsx b/src/Components/HeaderMain.jsx index ecf352e..e6c73cd 100644 --- a/src/Components/HeaderMain.jsx +++ b/src/Components/HeaderMain.jsx @@ -10,10 +10,14 @@ import { Box, Button, HStack, + Icon, Image, Input, InputGroup, InputLeftElement, + Menu, + MenuButton, + MenuList, Popover, PopoverArrow, PopoverBody, @@ -33,6 +37,9 @@ import mainLogo from "../assets/optifii_logo.svg"; import { MdNotificationsNone } from "react-icons/md"; import womenpfp from "../assets/womenpfp1.png"; import { MdLogout } from "react-icons/md"; +import { IoFilterSharp } from "react-icons/io5"; +import { MdDeleteOutline, MdOutlineDelete } from "react-icons/md"; +import { IoIosCheckmark } from "react-icons/io"; const users = [ { id: 1, user: "Jenny Wilson", role: "Admin" }, @@ -49,6 +56,34 @@ const HeaderMain = ({ const navigate = useNavigate(); const { colorMode, toggleColorMode } = useContext(GlobalStateContext); const [searchTerm, setSearchTerm] = useState(""); + const [notifications, setNotifications] = useState([ + { + id: 1, + avatar: "https://bit.ly/dan-abramov", + sender: "Admin", + time: "1 Min ago", + message: "Lorem ipsum dolor sit amet, consectetur", + }, + { + id: 2, + avatar: "https://bit.ly/code-beast", + sender: "Support", + time: "5 Min ago", + message: "Your ticket has been updated.", + }, + ]); + + // Handler to delete a notification + const handleDelete = (id) => { + setNotifications( + notifications.filter((notification) => notification.id !== id) + ); + }; + + // Handler to delete all notifications + const handleDeleteAll = () => { + setNotifications([]); + }; const openDrawerOnClick = () => {}; @@ -126,14 +161,192 @@ const HeaderMain = ({ justifyContent={"space-between"} > - + {/* - + */} + + + + + + + + Notification + + + Clear all + + + + + + Today + + + {notifications.map((notification) => ( + + + + {notification.sender} + + + + + {notification.sender} + + + {notification.time} + + + + {notification.message} + + + + handleDelete(notification.id)} + cursor="pointer" + > + + + + ))} + + + + + + Yesterday + + + {notifications.map((notification) => ( + + + + {notification.sender} + + + + + {notification.sender} + + + {notification.time} + + + + {notification.message} + + + + handleDelete(notification.id)} + cursor="pointer" + > + + + + ))} + + + + + + navigate("/notification")} cursor="pointer" fontSize="small" color="#6311CB" fontWeight={600}> + View All + + + + @@ -155,8 +368,13 @@ const HeaderMain = ({ */} - - + + Switch Accounts {users.map((val) => { @@ -168,34 +386,34 @@ const HeaderMain = ({ // key={val.id} // w="100%" // > - + Profile Picture + - Profile Picture + {val.user} - {val.user} - - {val.role} - + {val.role} - + + // ); })}