diff --git a/web/components/notifications/notification-card.tsx b/web/components/notifications/notification-card.tsx index 4089e9108..c98772f9b 100644 --- a/web/components/notifications/notification-card.tsx +++ b/web/components/notifications/notification-card.tsx @@ -7,7 +7,7 @@ import { Menu } from "@headlessui/react"; // type import type { IUserNotification, NotificationType } from "@plane/types"; // ui -import { ArchiveIcon, CustomMenu, Tooltip, TOAST_TYPE, setToast } from "@plane/ui"; +import { ArchiveIcon, CustomMenu, Tooltip, TOAST_TYPE, setToast } from "@plane/ui"; // constants import { ISSUE_OPENED, @@ -23,7 +23,6 @@ import { replaceUnderscoreIfSnakeCase, truncateText, stripAndTruncateHTML } from import { useEventTracker } from "@/hooks/store"; import { usePlatformOS } from "@/hooks/use-platform-os"; - type NotificationCardProps = { selectedTab: NotificationType; notification: IUserNotification; @@ -184,12 +183,12 @@ export const NotificationCard: React.FC = (props) => { {notificationField === "comment" ? "commented" : notificationField === "archived_at" - ? notification.data.issue_activity.new_value === "restore" - ? "restored the issue" - : "archived the issue" - : notificationField === "None" - ? null - : replaceUnderscoreIfSnakeCase(notificationField)}{" "} + ? notification.data.issue_activity.new_value === "restore" + ? "restored the issue" + : "archived the issue" + : notificationField === "None" + ? null + : replaceUnderscoreIfSnakeCase(notificationField)}{" "} {!["comment", "archived_at", "None"].includes(notificationField) ? "to" : ""} {" "} @@ -381,46 +380,46 @@ export const NotificationCard: React.FC = (props) => { ))} - -
- } - optionsClassName="!z-20" - > - {snoozeOptions.map((item) => ( - { - e.stopPropagation(); - e.preventDefault(); +
+ } + optionsClassName="!z-20" + > + {snoozeOptions.map((item) => ( + { + e.stopPropagation(); + e.preventDefault(); - if (!item.value) { - setSelectedNotificationForSnooze(notification.id); - return; - } + if (!item.value) { + setSelectedNotificationForSnooze(notification.id); + return; + } - markSnoozeNotification(notification.id, item.value).then(() => { - captureEvent(NOTIFICATION_SNOOZED, { - issue_id: notification.data.issue.id, - tab: selectedTab, - state: "SUCCESS", - }); - setToast({ - title: `Notification snoozed till ${renderFormattedDate(item.value)}`, - type: TOAST_TYPE.SUCCESS, - }); + markSnoozeNotification(notification.id, item.value).then(() => { + captureEvent(NOTIFICATION_SNOOZED, { + issue_id: notification.data.issue.id, + tab: selectedTab, + state: "SUCCESS", }); - }} - > - {item.label} - - ))} - - + setToast({ + title: `Notification snoozed till ${renderFormattedDate(item.value)}`, + type: TOAST_TYPE.SUCCESS, + }); + }); + }} + > + {item.label} + + ))} + );