You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
861 B

  1. import { connect } from 'react-redux';
  2. import ComposeForm from '../components/compose_form';
  3. import { changeCompose, submitCompose, cancelReplyCompose } from '../actions/compose';
  4. const mapStateToProps = function (state, props) {
  5. return {
  6. text: state.getIn(['compose', 'text']),
  7. is_submitting: state.getIn(['compose', 'is_submitting']),
  8. in_reply_to: state.getIn(['compose', 'in_reply_to'])
  9. };
  10. };
  11. const mapDispatchToProps = function (dispatch) {
  12. return {
  13. onChange: function (text) {
  14. dispatch(changeCompose(text));
  15. },
  16. onSubmit: function () {
  17. dispatch(submitCompose());
  18. },
  19. onCancelReply: function () {
  20. dispatch(cancelReplyCompose());
  21. }
  22. }
  23. };
  24. export default connect(mapStateToProps, mapDispatchToProps)(ComposeForm);