about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/compose/containers/reply_indicator_container.js
blob: 395a9aa5bf9ca78b80fd0b743bf699c76824cdb8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { connect } from 'react-redux';
import { cancelReplyCompose } from 'flavours/glitch/actions/compose';
import { makeGetStatus } from 'flavours/glitch/selectors';
import ReplyIndicator from '../components/reply_indicator';

function makeMapStateToProps (state) {
  const inReplyTo = state.getIn(['compose', 'in_reply_to']);

  return {
    status: inReplyTo ? state.getIn(['statuses', inReplyTo]) : null,
  };
};

const mapDispatchToProps = dispatch => ({

  onCancel () {
    dispatch(cancelReplyCompose());
  },

});

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