From 1701dae273fcfc81b3a6c68bc2ecda9a879f05f4 Mon Sep 17 00:00:00 2001 From: priyanshuvish Date: Thu, 10 Oct 2024 13:45:41 +0530 Subject: [PATCH] notification page done --- src/Components/HeaderMain.jsx | 5 +- src/Pages/Dashboard/Dashbaord.jsx | 5 +- src/Pages/Notification/Notification.jsx | 151 ++++++++++++++++++++++++ src/Routes/Routes.js | 7 ++ 4 files changed, 164 insertions(+), 4 deletions(-) create mode 100644 src/Pages/Notification/Notification.jsx diff --git a/src/Components/HeaderMain.jsx b/src/Components/HeaderMain.jsx index 1ae1e69..d227ea0 100644 --- a/src/Components/HeaderMain.jsx +++ b/src/Components/HeaderMain.jsx @@ -127,7 +127,10 @@ const HeaderMain = ({ > - diff --git a/src/Pages/Dashboard/Dashbaord.jsx b/src/Pages/Dashboard/Dashbaord.jsx index 40db544..a80baf4 100644 --- a/src/Pages/Dashboard/Dashbaord.jsx +++ b/src/Pages/Dashboard/Dashbaord.jsx @@ -604,7 +604,7 @@ const Dashbaord = () => { - + Total report amount @@ -643,14 +643,13 @@ const Dashbaord = () => { style={{ float: "right", marginRight: "4px", - marginBottom: "8px", }} to="/reimbursement-request" > { + // Define an array of notification objects with unique data + 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.', + }, + { + id: 3, + avatar: 'https://bit.ly/ryan-florence', + sender: 'System', + time: '10 Min ago', + message: 'System maintenance scheduled for tonight.', + }, + { + id: 4, + avatar: 'https://bit.ly/kent-c-dodds', + sender: 'John Doe', + time: '20 Min ago', + message: 'Your profile has been viewed 10 times.', + }, + { + id: 5, + avatar: 'https://bit.ly/sage-adebayo', + sender: 'Jane Smith', + time: '30 Min ago', + message: 'New comment on your post.', + }, + ]); + + // Handler to delete a notification + const handleDelete = (id) => { + setNotifications(notifications.filter(notification => notification.id !== id)); + }; + + return ( + + + + + + + Mark as read + + + + Mark as read + + + + + + {/* Wrap all notifications inside a single VStack */} + + {notifications.map((notification) => ( + + + + {notification.sender} + + + + + {notification.sender} + + + {notification.time} + + + + {notification.message} + + + + handleDelete(notification.id)} + cursor="pointer" + > + + + + ))} + + + + ); +}; + +export default Notification; diff --git a/src/Routes/Routes.js b/src/Routes/Routes.js index cdeaa0d..1a887a0 100644 --- a/src/Routes/Routes.js +++ b/src/Routes/Routes.js @@ -42,6 +42,7 @@ import ApplyForGiftCard from "../Pages/OptiFiiGifsAndVouchers/ApplyForGiftCard/A import ApplyForDigitalCard from "../Pages/OptiFiiGifsAndVouchers/ApplyForGiftCard/ApplyForDigitalCard"; import BenifitOverView from "../Pages/OptiFiiTaxBenefit/BeinifitOverView"; import ViewTicket from "../Pages/SupportAndTicket/ViewTicket"; +import Notification from "../Pages/Notification/Notification"; export const RouteLink = [ { path: "/", Component: Dashbaord }, @@ -55,6 +56,12 @@ export const RouteLink = [ { path: "/reimbursement-request", Component: ReimbursementRequest }, { path: "/reimbursement-request-view", Component: ReimbursementRequestView }, { path: "/advance-expense-request", Component: AdvanceExpenseRequest }, + + // Notification + + { path: "/notification", Component: Notification }, + + { path: "/advance-expense-request-view", Component: AdvanceExpenseRequestView,