From 8e3689b71d58e8934d8b188b1ee1a2fa3dda934c Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Fri, 14 May 2021 16:43:49 +0800 Subject: [PATCH] Notification: handle "creator_comment" ## Issue Closes 6022 Notifications: Creator Commented ## Changes - Beautify - show creator icon instead of generic bell. - Link to comment directly instead of the claim. --- ui/component/notification/view.jsx | 5 ++++- ui/constants/notifications.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/component/notification/view.jsx b/ui/component/notification/view.jsx index 7ca1acc6e..13d1a060e 100644 --- a/ui/component/notification/view.jsx +++ b/ui/component/notification/view.jsx @@ -31,7 +31,9 @@ export default function Notification(props: Props) { const { push } = useHistory(); const { notification_rule, notification_parameters, is_read, id } = notification; const isCommentNotification = - notification_rule === NOTIFICATIONS.NOTIFICATION_COMMENT || notification_rule === NOTIFICATIONS.NOTIFICATION_REPLY; + notification_rule === NOTIFICATIONS.NOTIFICATION_COMMENT || + notification_rule === NOTIFICATIONS.NOTIFICATION_REPLY || + notification_rule === NOTIFICATIONS.CREATOR_COMMENT; const commentText = isCommentNotification && notification_parameters.dynamic.comment; const channelUrl = (notification_rule === NOTIFICATIONS.NEW_CONTENT && notification.notification_parameters.dynamic.channel_url) || ''; @@ -70,6 +72,7 @@ export default function Notification(props: Props) { icon = ; break; case NOTIFICATIONS.NOTIFICATION_COMMENT: + case NOTIFICATIONS.CREATOR_COMMENT: icon = ; break; case NOTIFICATIONS.NOTIFICATION_REPLY: diff --git a/ui/constants/notifications.js b/ui/constants/notifications.js index f7cfdc608..b76e419f7 100644 --- a/ui/constants/notifications.js +++ b/ui/constants/notifications.js @@ -6,6 +6,7 @@ export const DAILY_WATCH_AVAILABLE = 'daily_watch_available'; export const DAILY_WATCH_REMIND = 'daily_watch_remind'; export const NEW_CONTENT = 'new_content'; export const NEW_LIVESTREAM = 'new_livestream'; +export const CREATOR_COMMENT = 'creator_comment'; export const NOTIFICATION_NAME_ALL = 'All'; export const NOTIFICATION_RULE_COMMENTS = 'comments'; -- 2.45.2