From 281f20ef1e9ac33a7e210ba562eb2914f6d187e6 Mon Sep 17 00:00:00 2001 From: Clemens Date: Tue, 19 Jul 2016 16:13:26 +0200 Subject: added flow_content update --- .../js/components/FlowView/FlowEditorButton.jsx | 49 +++++++++------------- 1 file changed, 20 insertions(+), 29 deletions(-) (limited to 'web/src/js/components/FlowView/FlowEditorButton.jsx') diff --git a/web/src/js/components/FlowView/FlowEditorButton.jsx b/web/src/js/components/FlowView/FlowEditorButton.jsx index e9c75535..3d0d1d16 100644 --- a/web/src/js/components/FlowView/FlowEditorButton.jsx +++ b/web/src/js/components/FlowView/FlowEditorButton.jsx @@ -4,41 +4,32 @@ import { connect } from 'react-redux' import {closeFlowEditor} from '../../ducks/ui.js' import {openFlowEditor} from '../../ducks/ui.js' -// FlowEditorButton.propTypes = { -// isFlowEditorOpen: PropTypes.bool.isRequired, -// content: PropTypes.string.isRequired, -// onContentChange: PropTypes.func.isRequired -// } - -class FlowEditorButton extends Component{ - static propTypes = { - isFlowEditorOpen: PropTypes.bool.isRequired, - content: PropTypes.string.isRequired, - onContentChange: PropTypes.func.isRequired - } +FlowEditorButton.propTypes = { + isFlowEditorOpen: PropTypes.bool.isRequired, + content: PropTypes.string.isRequired, + onContentChange: PropTypes.func.isRequired +} - render(){ - let { isFlowEditorOpen, closeFlowEditor, openFlowEditor, onContentChange, content } = this.props - return ( -
- {isFlowEditorOpen ? - {onContentChange(content); closeFlowEditor()}}> - - - : - openFlowEditor()}> - - - } -
- ) - } +function FlowEditorButton ({ isFlowEditorOpen, closeFlowEditor, openFlowEditor, onContentChange, content }) { + return ( +
+ {isFlowEditorOpen ? + {onContentChange(content); closeFlowEditor()}}> + + + : + openFlowEditor()}> + + + } +
+ ) } export default connect( state => ({ isFlowEditorOpen: state.ui.isFlowEditorOpen, - content: state.flows.modifiedFlow.content + content: state.ui.modifiedFlow.content }), { closeFlowEditor, -- cgit v1.2.3