From 7587fea6d5b0eab4fd4c5fdd7bb6c3b0735a582a Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 10 Jun 2025 14:03:49 +0800 Subject: [PATCH] Add row click handling to notificaitons table --- client/src/Hooks/useNotifications.js | 3 ++- client/src/Pages/Notifications/index.jsx | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/client/src/Hooks/useNotifications.js b/client/src/Hooks/useNotifications.js index 8e7f896e9..54e3d1bd9 100644 --- a/client/src/Hooks/useNotifications.js +++ b/client/src/Hooks/useNotifications.js @@ -131,7 +131,7 @@ const useEditNotification = () => { const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); const { t } = useTranslation(); - + const navigate = useNavigate(); const editNotification = async (id, notification) => { try { setIsLoading(true); @@ -139,6 +139,7 @@ const useEditNotification = () => { createToast({ body: t("notifications.edit.success"), }); + navigate(`/notifications`); } catch (error) { setError(error); createToast({ diff --git a/client/src/Pages/Notifications/index.jsx b/client/src/Pages/Notifications/index.jsx index 2694a3fea..9ad5f1578 100644 --- a/client/src/Pages/Notifications/index.jsx +++ b/client/src/Pages/Notifications/index.jsx @@ -119,6 +119,16 @@ const Notifications = () => { {t("notifications.createTitle")} navigate(`/notifications/${row._id}`), + rowSX: { + cursor: "pointer", + "&:hover td": { + backgroundColor: theme.palette.tertiary.main, + transition: "background-color .3s ease", + }, + }, + }} headers={headers} data={notifications} />