2016-08-31 16:15:12 +02:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import ComposerDrawer from '../components/composer_drawer';
|
|
|
|
import { changeCompose, submitCompose } from '../actions/compose';
|
2016-08-25 19:52:55 +02:00
|
|
|
|
|
|
|
const mapStateToProps = function (state, props) {
|
2016-08-31 16:15:12 +02:00
|
|
|
return {
|
|
|
|
text: state.getIn(['compose', 'text']),
|
|
|
|
isSubmitting: state.getIn(['compose', 'isSubmitting'])
|
|
|
|
};
|
2016-08-25 19:52:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
const mapDispatchToProps = function (dispatch) {
|
|
|
|
return {
|
2016-08-31 16:15:12 +02:00
|
|
|
onChange: function (text) {
|
|
|
|
dispatch(changeCompose(text));
|
|
|
|
},
|
|
|
|
|
|
|
|
onSubmit: function () {
|
|
|
|
dispatch(submitCompose());
|
2016-08-25 19:52:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ComposerDrawer);
|