Replies in the compose form
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import ComposerDrawer from '../components/composer_drawer';
|
||||
import { changeCompose, submitCompose } from '../actions/compose';
|
||||
import { connect } from 'react-redux';
|
||||
import ComposerDrawer from '../components/composer_drawer';
|
||||
import { changeCompose, submitCompose, cancelReplyCompose } from '../actions/compose';
|
||||
|
||||
const mapStateToProps = function (state, props) {
|
||||
return {
|
||||
text: state.getIn(['compose', 'text']),
|
||||
isSubmitting: state.getIn(['compose', 'isSubmitting'])
|
||||
is_submitting: state.getIn(['compose', 'is_submitting']),
|
||||
in_reply_to: state.getIn(['compose', 'in_reply_to'])
|
||||
};
|
||||
};
|
||||
|
||||
@ -17,6 +18,10 @@ const mapDispatchToProps = function (dispatch) {
|
||||
|
||||
onSubmit: function () {
|
||||
dispatch(submitCompose());
|
||||
},
|
||||
|
||||
onCancelReply: function () {
|
||||
dispatch(cancelReplyCompose());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import StatusList from '../components/status_list';
|
||||
import { connect } from 'react-redux';
|
||||
import StatusList from '../components/status_list';
|
||||
import { replyCompose } from '../actions/compose';
|
||||
|
||||
const mapStateToProps = function (state, props) {
|
||||
return {
|
||||
@ -7,4 +8,12 @@ const mapStateToProps = function (state, props) {
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(StatusList);
|
||||
const mapDispatchToProps = function (dispatch) {
|
||||
return {
|
||||
onReply: function (status) {
|
||||
dispatch(replyCompose(status));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(StatusList);
|
||||
|
Reference in New Issue
Block a user