about summary refs log tree commit diff
path: root/app/assets/javascripts/components/containers/follow_form_container.jsx
blob: b5f787aba9c59c621a1fbdc2ab595e6740d3d643 (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 FollowForm                     from '../components/follow_form';
import { changeFollow, submitFollow } from '../actions/follow';

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

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

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

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