about summary refs log tree commit diff
path: root/app/assets/javascripts/components/containers/composer_drawer_container.jsx
blob: 2a7344509673d445cbba1325eda0a42ad76758bd (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
import { connect }                      from 'react-redux';
import ComposerDrawer                   from '../components/composer_drawer';
import { changeCompose, submitCompose } from '../actions/compose';

const mapStateToProps = function (state, props) {
  return {
    text: state.getIn(['compose', 'text']),
    isSubmitting: state.getIn(['compose', 'isSubmitting'])
  };
};

const mapDispatchToProps = function (dispatch) {
  return {
    onChange: function (text) {
      dispatch(changeCompose(text));
    },

    onSubmit: function () {
      dispatch(submitCompose());
    }
  }
};

export default connect(mapStateToProps, mapDispatchToProps)(ComposerDrawer);