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.
30 lines
861 B
30 lines
861 B
8 years ago
|
import { connect } from 'react-redux';
|
||
8 years ago
|
import ComposeForm from '../components/compose_form';
|
||
8 years ago
|
import { changeCompose, submitCompose, cancelReplyCompose } from '../actions/compose';
|
||
8 years ago
|
|
||
|
const mapStateToProps = function (state, props) {
|
||
8 years ago
|
return {
|
||
|
text: state.getIn(['compose', 'text']),
|
||
8 years ago
|
is_submitting: state.getIn(['compose', 'is_submitting']),
|
||
|
in_reply_to: state.getIn(['compose', 'in_reply_to'])
|
||
8 years ago
|
};
|
||
8 years ago
|
};
|
||
|
|
||
|
const mapDispatchToProps = function (dispatch) {
|
||
|
return {
|
||
8 years ago
|
onChange: function (text) {
|
||
|
dispatch(changeCompose(text));
|
||
|
},
|
||
|
|
||
|
onSubmit: function () {
|
||
|
dispatch(submitCompose());
|
||
8 years ago
|
},
|
||
|
|
||
|
onCancelReply: function () {
|
||
|
dispatch(cancelReplyCompose());
|
||
8 years ago
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
8 years ago
|
export default connect(mapStateToProps, mapDispatchToProps)(ComposeForm);
|