catstodon/app/javascript/mastodon/features/ui/containers/notifications_container.js

21 lines
545 B
JavaScript
Raw Normal View History

import { injectIntl } from 'react-intl';
2016-11-20 19:39:18 +01:00
import { connect } from 'react-redux';
2016-11-20 19:39:18 +01:00
import { NotificationStack } from 'react-notification';
import { dismissAlert } from 'mastodon/actions/alerts';
import { getAlerts } from 'mastodon/selectors';
const mapStateToProps = (state, { intl }) => ({
notifications: getAlerts(state, { intl }),
});
const mapDispatchToProps = (dispatch) => ({
onDismiss (alert) {
dispatch(dismissAlert(alert));
},
});
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(NotificationStack));