From 540a527a61c2a622eb1d437a0cd41530a9c45ef7 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 14 Dec 2020 13:52:17 -0500 Subject: [PATCH] swap seen & read notification behavior --- ui/component/notification/index.js | 4 ++-- ui/component/notification/view.jsx | 20 +++++++++---------- .../notificationHeaderButton/index.js | 8 ++++---- .../notificationHeaderButton/view.jsx | 12 +++++------ ui/page/notifications/view.jsx | 10 +++++----- ui/scss/component/_notification.scss | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ui/component/notification/index.js b/ui/component/notification/index.js index f5750245b..6a81ea01f 100644 --- a/ui/component/notification/index.js +++ b/ui/component/notification/index.js @@ -1,8 +1,8 @@ import { connect } from 'react-redux'; -import { doSeeNotifications, doDeleteNotification } from 'redux/actions/notifications'; +import { doReadNotifications, doDeleteNotification } from 'redux/actions/notifications'; import Notification from './view'; export default connect(null, { - doSeeNotifications, + doReadNotifications, doDeleteNotification, })(Notification); diff --git a/ui/component/notification/view.jsx b/ui/component/notification/view.jsx index c1c45c339..aa5585440 100644 --- a/ui/component/notification/view.jsx +++ b/ui/component/notification/view.jsx @@ -21,14 +21,14 @@ type Props = { notification: WebNotification, menuButton: boolean, children: any, - doSeeNotifications: ([number]) => void, + doReadNotifications: ([number]) => void, doDeleteNotification: number => void, }; export default function Notification(props: Props) { - const { notification, menuButton = false, doSeeNotifications, doDeleteNotification } = props; + const { notification, menuButton = false, doReadNotifications, doDeleteNotification } = props; const { push } = useHistory(); - const { notification_rule, notification_parameters, is_seen, id } = notification; + const { notification_rule, notification_parameters, is_read, id } = notification; const isCommentNotification = notification_rule === NOTIFICATIONS.NOTIFICATION_COMMENT || notification_rule === NOTIFICATIONS.NOTIFICATION_REPLY; const commentText = isCommentNotification && notification_parameters.dynamic.comment; @@ -83,8 +83,8 @@ export default function Notification(props: Props) { } function handleNotificationClick() { - if (!is_seen) { - doSeeNotifications([id]); + if (!is_read) { + doReadNotifications([id]); } if (notificationLink) { @@ -92,9 +92,9 @@ export default function Notification(props: Props) { } } - function handleSeeNotification(e) { + function handleReadNotification(e) { e.stopPropagation(); - doSeeNotifications([id]); + doReadNotifications([id]); } const Wrapper = menuButton @@ -111,7 +111,7 @@ export default function Notification(props: Props) { ) : (props: { children: any }) => ( {props.children} @@ -122,7 +122,7 @@ export default function Notification(props: Props) {
{icon}
@@ -157,7 +157,7 @@ export default function Notification(props: Props) {
- {!is_seen &&