diff -r 4b780ebbedc6 -r 0e6703cd0968 client/src/components/SlateEditor/ToolbarButtons.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/components/SlateEditor/ToolbarButtons.js Fri Nov 16 11:19:13 2018 +0100 @@ -0,0 +1,41 @@ +import React from 'react'; +import { Trans } from 'react-i18next'; +import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; + +import { getAutoSubmit } from '../../selectors/authSelectors'; +import * as userActions from '../../actions/userActions'; + +function mapStateToProps(state, props) { + + const autoSubmit = getAutoSubmit(state); + + return { + autoSubmit, + }; +} + +function mapDispatchToProps(dispatch) { + return { + userActions: bindActionCreators(userActions, dispatch) + } +} + +// see https://github.com/facebook/react/issues/3005 for explanation about the timeout. +const ToolbarCheckbox = connect(mapStateToProps, mapDispatchToProps)(({ autoSubmit, userActions }) => ( +
+ +
+)); + +export default ({ hasNote, isButtonDisabled, submitNote }) => ( +
+ + { !hasNote && } +
+); +