about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/notifications/containers/notification_container.js
blob: c60e72e1c20ffc12f9409794f94ddc5c2cf1df17 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//  Package imports.
import { connect } from 'react-redux';

//  Our imports.
import { makeGetNotification } from 'flavours/glitch/selectors';
import Notification from '../components/notification';
import { mentionCompose } from 'flavours/glitch/actions/compose';

const makeMapStateToProps = () => {
  const getNotification = makeGetNotification();

  const mapStateToProps = (state, props) => ({
    notification: getNotification(state, props.notification, props.accountId),
    settings: state.get('local_settings'),
    notifCleaning: state.getIn(['notifications', 'cleaningMode']),
  });

  return mapStateToProps;
};

const mapDispatchToProps = dispatch => ({
  onMention: (account, router) => {
    dispatch(mentionCompose(account, router));
  },
});

export default connect(makeMapStateToProps, mapDispatchToProps)(Notification);