--- a/client/src/components/NoteInput.js Thu Jul 20 11:23:08 2017 +0200
+++ b/client/src/components/NoteInput.js Thu Jul 20 23:37:58 2017 +0200
@@ -1,12 +1,8 @@
import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
import { Form, FormControl } from 'react-bootstrap';
import PropTypes from 'prop-types';
import SlateEditor from './SlateEditor';
-import * as notesActions from '../actions/notesActions';
-import * as userActions from '../actions/userActions';
import { now } from '../utils';
@@ -34,7 +30,7 @@
const categories = this.refs.editor.asCategories();
const marginComment = this.marginComment.value;
- this.props.notesActions.addNote(this.props.session, {
+ this.props.addNote(this.props.session, {
plain: plain,
raw: raw,
html: html,
@@ -49,7 +45,7 @@
}
onCheckboxChange = (e) => {
- this.props.userActions.setAutoSubmit(e.target.checked);
+ this.props.setAutoSubmit(e.target.checked);
}
componentDidMount() {
@@ -84,21 +80,8 @@
}
}
-function mapStateToProps(state, props) {
- return {
- autoSubmit: state.autoSubmit
- };
-}
-
-function mapDispatchToProps(dispatch) {
- return {
- notesActions: bindActionCreators(notesActions, dispatch),
- userActions: bindActionCreators(userActions, dispatch),
- }
-}
-
NoteInput.propTypes = {
addNote: PropTypes.func.isRequired
};
-export default connect(mapStateToProps, mapDispatchToProps)(NoteInput);
+export default NoteInput;