From 9636bddac67f31e777d1b06361a3ce7efe90335d Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Fri, 1 Aug 2025 23:07:47 -0600 Subject: [PATCH] update notification styles --- src/components/overlays/NotificationModal.tsx | 93 +++++++++++++------ 1 file changed, 64 insertions(+), 29 deletions(-) diff --git a/src/components/overlays/NotificationModal.tsx b/src/components/overlays/NotificationModal.tsx index b25f4de5..e9e2bfda 100644 --- a/src/components/overlays/NotificationModal.tsx +++ b/src/components/overlays/NotificationModal.tsx @@ -30,29 +30,47 @@ function DetailView({ getCategoryColor, getCategoryLabel, formatDate, + isRead, + toggleReadStatus, }: { selectedNotification: NotificationItem; goBackToList: () => void; getCategoryColor: (category: string) => string; getCategoryLabel: (category: string) => string; formatDate: (dateString: string) => string; + isRead: boolean; + toggleReadStatus: () => void; }) { return (
- {/* Header with back button */} -
+ {/* Header with back button and toggle read status */} +
+
+ +
{/* Notification content */} -
+
{getCategoryColor(selectedNotification.category) && ( {notifications.length === 0 ? (
@@ -237,17 +255,31 @@ function ListView({ >
-
-

- {notification.title} -

- {!isRead && ( - - )} +
+
+

+ {notification.title} +

+ {!isRead && ( + + )} +
+
+ {getCategoryColor(notification.category) && ( + + )} + + {getCategoryLabel(notification.category)} + +

{notification.description @@ -256,19 +288,6 @@ function ListView({ {notification.description.length > 150 ? "..." : ""}

- -
- {getCategoryColor(notification.category) && ( - - )} - - {getCategoryLabel(notification.category)} - -
@@ -642,6 +661,22 @@ export function NotificationModal({ id }: NotificationModalProps) { getCategoryColor={getCategoryColor} getCategoryLabel={getCategoryLabel} formatDate={formatDate} + isRead={readNotifications.has(selectedNotification.guid)} + toggleReadStatus={() => { + if (readNotifications.has(selectedNotification.guid)) { + // Mark as unread + const newReadSet = new Set(readNotifications); + newReadSet.delete(selectedNotification.guid); + setReadNotifications(newReadSet); + localStorage.setItem( + "read-notifications", + JSON.stringify(Array.from(newReadSet)), + ); + } else { + // Mark as read + markAsRead(selectedNotification.guid); + } + }} /> ) : null}