lbry-desktop/ui/component/headerNotificationButton/index.js
Rave | 図書館猫 86fcd87f53
Notification Menu Upgrade (#1713)
* Mark notification as seen on hover

* Clean code

* Mark notifications as seen on button click

* Clean code

* Animate bubble
2022-06-21 20:59:37 -04:00

26 lines
991 B
JavaScript

import { connect } from 'react-redux';
import { selectNotifications, selectUnseenNotificationCount } from 'redux/selectors/notifications';
import {
doReadNotifications,
doSeeNotifications,
doDeleteNotification,
doSeeAllNotifications,
} from 'redux/actions/notifications';
import { selectUser, selectUserVerifiedEmail } from 'redux/selectors/user';
import NotificationHeaderButton from './view';
const select = (state) => ({
notifications: selectNotifications(state),
unseenCount: selectUnseenNotificationCount(state),
user: selectUser(state),
authenticated: selectUserVerifiedEmail(state),
});
const perform = (dispatch, ownProps) => ({
readNotification: ([id]) => dispatch(doReadNotifications([id])),
seeNotification: ([id]) => dispatch(doSeeNotifications([id])),
deleteNotification: (id) => dispatch(doDeleteNotification(id)),
doSeeAllNotifications: () => dispatch(doSeeAllNotifications()),
});
export default connect(select, perform)(NotificationHeaderButton);