From 43dcb3904586093fc8db5dfd6504779388b1183b Mon Sep 17 00:00:00 2001 From: zeppi Date: Wed, 27 Apr 2022 16:09:01 -0400 Subject: [PATCH] more notifications renaming --- .../headerNotificationButton/index.js | 4 +-- .../headerNotificationButton/view.jsx | 6 ++--- ui/component/notification/index.js | 6 ++--- ui/constants/action_types.js | 20 +++++++------- ui/page/notifications/index.js | 10 ++++--- ui/page/notifications/view.jsx | 19 +++++++++----- ui/redux/actions/comments.js | 6 ++--- ui/redux/actions/notifications.js | 26 +++++++++---------- ui/redux/reducers/notifications.js | 14 +++++----- 9 files changed, 60 insertions(+), 51 deletions(-) diff --git a/ui/component/headerNotificationButton/index.js b/ui/component/headerNotificationButton/index.js index 1e139de8b..c69e0b9fc 100644 --- a/ui/component/headerNotificationButton/index.js +++ b/ui/component/headerNotificationButton/index.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; import { selectUnseenNotificationCount } from 'redux/selectors/notifications'; -import { doSeeAllNotifications } from 'redux/actions/notifications'; +import { doLbryioSeeAllNotifications } from 'redux/actions/notifications'; import { selectUser } from 'redux/selectors/user'; import NotificationHeaderButton from './view'; @@ -10,5 +10,5 @@ const select = (state) => ({ }); export default connect(select, { - doSeeAllNotifications, + doLbryioSeeAllNotifications, })(NotificationHeaderButton); diff --git a/ui/component/headerNotificationButton/view.jsx b/ui/component/headerNotificationButton/view.jsx index 40a94f877..d479956e7 100644 --- a/ui/component/headerNotificationButton/view.jsx +++ b/ui/component/headerNotificationButton/view.jsx @@ -14,17 +14,17 @@ import Tooltip from 'component/common/tooltip'; type Props = { unseenCount: number, user: ?User, - doSeeAllNotifications: () => void, + doLbryioSeeAllNotifications: () => void, }; export default function NotificationHeaderButton(props: Props) { - const { unseenCount, user, doSeeAllNotifications } = props; + const { unseenCount, user, doLbryioSeeAllNotifications } = props; const { push } = useHistory(); const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui); function handleMenuClick() { - if (unseenCount > 0) doSeeAllNotifications(); + if (unseenCount > 0) doLbryioSeeAllNotifications(); push(`/$/${PAGES.NOTIFICATIONS}`); } diff --git a/ui/component/notification/index.js b/ui/component/notification/index.js index fd7557aee..5d347f503 100644 --- a/ui/component/notification/index.js +++ b/ui/component/notification/index.js @@ -1,10 +1,10 @@ import { connect } from 'react-redux'; -import { doReadNotifications, doDeleteNotification } from 'redux/actions/notifications'; +import { doLbryioNotificationsMarkRead, doLbryioDeleteNotification } from 'redux/actions/notifications'; import Notification from './view'; const perform = (dispatch, ownProps) => ({ - readNotification: () => dispatch(doReadNotifications([ownProps.notification.id])), - deleteNotification: () => dispatch(doDeleteNotification(ownProps.notification.id)), + readNotification: () => dispatch(doLbryioNotificationsMarkRead([ownProps.notification.id])), + deleteNotification: () => dispatch(doLbryioDeleteNotification(ownProps.notification.id)), }); export default connect(null, perform)(Notification); diff --git a/ui/constants/action_types.js b/ui/constants/action_types.js index 85a443c05..aa651bdbc 100644 --- a/ui/constants/action_types.js +++ b/ui/constants/action_types.js @@ -347,16 +347,16 @@ export const MEDIA_PAUSE = 'MEDIA_PAUSE'; export const LBRYIO_NOTIFICATION_LIST_STARTED = 'NOTIFICATION_LIST_STARTED'; export const LBRYIO_NOTIFICATION_LIST_COMPLETED = 'NOTIFICATION_LIST_COMPLETED'; export const LBRYIO_NOTIFICATION_LIST_FAILED = 'NOTIFICATION_LIST_FAILED'; -export const NOTIFICATION_CATEGORIES_COMPLETED = 'NOTIFICATION_CATEGORIES_COMPLETED'; -export const NOTIFICATION_READ_STARTED = 'NOTIFICATION_READ_STARTED'; -export const NOTIFICATION_READ_COMPLETED = 'NOTIFICATION_READ_COMPLETED'; -export const NOTIFICATION_READ_FAILED = 'NOTIFICATION_READ_FAILED'; -export const NOTIFICATION_SEEN_STARTED = 'NOTIFICATION_SEEN_STARTED'; -export const NOTIFICATION_SEEN_COMPLETED = 'NOTIFICATION_SEEN_COMPLETED'; -export const NOTIFICATION_SEEN_FAILED = 'NOTIFICATION_SEEN_FAILED'; -export const NOTIFICATION_DELETE_STARTED = 'NOTIFICATION_DELETE_STARTED'; -export const NOTIFICATION_DELETE_COMPLETED = 'NOTIFICATION_DELETE_COMPLETED'; -export const NOTIFICATION_DELETE_FAILED = 'NOTIFICATION_DELETE_FAILED'; +export const LBRYIO_NOTIFICATION_CATEGORIES_COMPLETED = 'LBRYIO_NOTIFICATION_CATEGORIES_COMPLETED'; +export const LBRYIO_NOTIFICATION_READ_STARTED = 'LBRYIO_NOTIFICATION_READ_STARTED'; +export const LBRYIO_NOTIFICATION_READ_COMPLETED = 'LBRYIO_NOTIFICATION_READ_COMPLETED'; +export const LBRYIO_NOTIFICATION_READ_FAILED = 'LBRYIO_NOTIFICATION_READ_FAILED'; +export const LBRYIO_NOTIFICATION_SEEN_STARTED = 'LBRYIO_NOTIFICATION_SEEN_STARTED'; +export const LBRYIO_NOTIFICATION_SEEN_COMPLETED = 'LBRYIO_NOTIFICATION_SEEN_COMPLETED'; +export const LBRYIO_NOTIFICATION_SEEN_FAILED = 'LBRYIO_NOTIFICATION_SEEN_FAILED'; +export const LBRYIO_NOTIFICATION_DELETE_STARTED = 'LBRYIO_NOTIFICATION_DELETE_STARTED'; +export const LBRYIO_NOTIFICATION_DELETE_COMPLETED = 'LBRYIO_NOTIFICATION_DELETE_COMPLETED'; +export const LBRYIO_NOTIFICATION_DELETE_FAILED = 'LBRYIO_NOTIFICATION_DELETE_FAILED'; export const CREATE_TOAST = 'CREATE_TOAST'; export const DISMISS_TOAST = 'DISMISS_TOAST'; export const CREATE_ERROR = 'CREATE_ERROR'; diff --git a/ui/page/notifications/index.js b/ui/page/notifications/index.js index 82e2eae00..3b8e16228 100644 --- a/ui/page/notifications/index.js +++ b/ui/page/notifications/index.js @@ -9,7 +9,11 @@ import { } from 'redux/selectors/notifications'; import { doCommentReactList } from 'redux/actions/comments'; import { selectActiveChannelClaim } from 'redux/selectors/app'; -import { doReadNotifications, doLbryioNotificationList, doSeeAllNotifications } from 'redux/actions/notifications'; +import { + doLbryioNotificationsMarkRead, + doLbryioNotificationList, + doLbryioSeeAllNotifications, +} from 'redux/actions/notifications'; import NotificationsPage from './view'; const select = (state) => ({ @@ -23,8 +27,8 @@ const select = (state) => ({ }); export default connect(select, { - doReadNotifications, + doLbryioNotificationsMarkRead, doLbryioNotificationList, - doSeeAllNotifications, + doLbryioSeeAllNotifications, doCommentReactList, })(NotificationsPage); diff --git a/ui/page/notifications/view.jsx b/ui/page/notifications/view.jsx index e7bb20416..cd360b25e 100644 --- a/ui/page/notifications/view.jsx +++ b/ui/page/notifications/view.jsx @@ -19,8 +19,8 @@ type Props = { fetching: boolean, unreadCount: number, unseenCount: number, - doSeeAllNotifications: () => void, - doReadNotifications: () => void, + doLbryioSeeAllNotifications: () => void, + doLbryioNotificationsMarkRead: () => void, doLbryioNotificationList: (?Array) => void, activeChannel: ?ChannelClaim, doCommentReactList: (Array) => Promise, @@ -33,8 +33,8 @@ export default function NotificationsPage(props: Props) { fetching, unreadCount, unseenCount, - doSeeAllNotifications, - doReadNotifications, + doLbryioSeeAllNotifications, + doLbryioNotificationsMarkRead, doLbryioNotificationList, notificationCategories, activeChannel, @@ -81,9 +81,9 @@ export default function NotificationsPage(props: Props) { React.useEffect(() => { if (unseenCount > 0) { - doSeeAllNotifications(); + doLbryioSeeAllNotifications(); } - }, [unseenCount, doSeeAllNotifications]); + }, [unseenCount, doLbryioSeeAllNotifications]); const stringifiedNotificationCategories = JSON.stringify(notificationCategories); React.useEffect(() => { @@ -114,7 +114,12 @@ export default function NotificationsPage(props: Props) { {fetching && } {unreadCount > 0 && ( -