mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-28 19:51:36 +01:00
50 lines
1 KiB
JavaScript
50 lines
1 KiB
JavaScript
|
/*
|
||
|
|
||
|
`<NotificationOverlayContainer>`
|
||
|
=========================
|
||
|
|
||
|
This container connects `<NotificationOverlay>`s to the Redux store.
|
||
|
|
||
|
*/
|
||
|
|
||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||
|
|
||
|
/*
|
||
|
|
||
|
Imports:
|
||
|
--------
|
||
|
|
||
|
*/
|
||
|
|
||
|
// Package imports //
|
||
|
import { connect } from 'react-redux';
|
||
|
|
||
|
// Our imports //
|
||
|
import NotificationOverlay from './notification_overlay';
|
||
|
import { markNotificationForDelete } from '../../../../mastodon/actions/notifications';
|
||
|
|
||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||
|
|
||
|
/*
|
||
|
|
||
|
Dispatch mapping:
|
||
|
-----------------
|
||
|
|
||
|
The `mapDispatchToProps()` function maps dispatches to our store to the
|
||
|
various props of our component. We only need to provide a dispatch for
|
||
|
deleting notifications.
|
||
|
|
||
|
*/
|
||
|
|
||
|
const mapDispatchToProps = dispatch => ({
|
||
|
onMarkForDelete(id, yes) {
|
||
|
dispatch(markNotificationForDelete(id, yes));
|
||
|
},
|
||
|
});
|
||
|
|
||
|
const mapStateToProps = state => ({
|
||
|
revealed: state.getIn(['notifications', 'cleaningMode']),
|
||
|
});
|
||
|
|
||
|
export default connect(mapStateToProps, mapDispatchToProps)(NotificationOverlay);
|