Notification: handle "creator_comment" (#6069)

## Issue
Closes 6022 Notifications: Creator Commented

## Changes
- Beautify - show creator icon instead of generic bell.
- Link to comment directly instead of the claim.
This commit is contained in:
infinite-persistence 2021-05-14 22:59:36 +08:00 committed by GitHub
parent 420f2c957e
commit ee1825f5f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -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 = <Icon icon={ICONS.SUBSCRIBE} sectionIcon />;
break;
case NOTIFICATIONS.NOTIFICATION_COMMENT:
case NOTIFICATIONS.CREATOR_COMMENT:
icon = <ChannelThumbnail small uri={notification_parameters.dynamic.comment_author} />;
break;
case NOTIFICATIONS.NOTIFICATION_REPLY:

View file

@ -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';