about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/notifications/containers/notification_container.js
blob: be007f30bb0f44feeb0e1403b163287d265aa371 (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
//  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),
    notifCleaning: state.getIn(['notifications', 'cleaningMode']),
  });

  return mapStateToProps;
};

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

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