1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
mastodon/app/assets/javascripts/components/containers/compose_form_container.jsx

30 lines
861 B
React
Raw Normal View History

2016-08-31 13:58:10 -07:00
import { connect } from 'react-redux';
import ComposeForm from '../components/compose_form';
2016-08-31 13:58:10 -07:00
import { changeCompose, submitCompose, cancelReplyCompose } from '../actions/compose';
const mapStateToProps = function (state, props) {
return {
text: state.getIn(['compose', 'text']),
2016-08-31 13:58:10 -07:00
is_submitting: state.getIn(['compose', 'is_submitting']),
in_reply_to: state.getIn(['compose', 'in_reply_to'])
};
};
const mapDispatchToProps = function (dispatch) {
return {
onChange: function (text) {
dispatch(changeCompose(text));
},
onSubmit: function () {
dispatch(submitCompose());
2016-08-31 13:58:10 -07:00
},
onCancelReply: function () {
dispatch(cancelReplyCompose());
}
}
};
export default connect(mapStateToProps, mapDispatchToProps)(ComposeForm);