mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-08 08:44:27 +00:00
30 lines
861 B
JavaScript
30 lines
861 B
JavaScript
import { connect } from 'react-redux';
|
|
import ComposeForm from '../components/compose_form';
|
|
import { changeCompose, submitCompose, cancelReplyCompose } from '../actions/compose';
|
|
|
|
const mapStateToProps = function (state, props) {
|
|
return {
|
|
text: state.getIn(['compose', 'text']),
|
|
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());
|
|
},
|
|
|
|
onCancelReply: function () {
|
|
dispatch(cancelReplyCompose());
|
|
}
|
|
}
|
|
};
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ComposeForm);
|