2016-08-31 21:58:10 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import ComposerDrawer from '../components/composer_drawer';
|
|
|
|
import { changeCompose, submitCompose, cancelReplyCompose } from '../actions/compose';
|
2016-08-25 18:52:55 +01:00
|
|
|
|
|
|
|
const mapStateToProps = function (state, props) {
|
2016-08-31 15:15:12 +01:00
|
|
|
return {
|
|
|
|
text: state.getIn(['compose', 'text']),
|
2016-08-31 21:58:10 +01:00
|
|
|
is_submitting: state.getIn(['compose', 'is_submitting']),
|
|
|
|
in_reply_to: state.getIn(['compose', 'in_reply_to'])
|
2016-08-31 15:15:12 +01:00
|
|
|
};
|
2016-08-25 18:52:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const mapDispatchToProps = function (dispatch) {
|
|
|
|
return {
|
2016-08-31 15:15:12 +01:00
|
|
|
onChange: function (text) {
|
|
|
|
dispatch(changeCompose(text));
|
|
|
|
},
|
|
|
|
|
|
|
|
onSubmit: function () {
|
|
|
|
dispatch(submitCompose());
|
2016-08-31 21:58:10 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
onCancelReply: function () {
|
|
|
|
dispatch(cancelReplyCompose());
|
2016-08-25 18:52:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ComposerDrawer);
|