From 281f20ef1e9ac33a7e210ba562eb2914f6d187e6 Mon Sep 17 00:00:00 2001
From: Clemens <cle1000.cb@gmail.com>
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 (
-            <div className="edit-flow-container">
-                {isFlowEditorOpen ?
-                    <a className="edit-flow" onClick={() => {onContentChange(content); closeFlowEditor()}}>
-                        <i className="fa fa-check"/>
-                    </a>
-                    :
-                    <a  className="edit-flow" onClick={() => openFlowEditor()}>
-                        <i className="fa fa-pencil"/>
-                    </a>
-                }
-            </div>
-        )
-    }
+function FlowEditorButton ({ isFlowEditorOpen, closeFlowEditor, openFlowEditor,  onContentChange, content }) {
+    return (
+        <div className="edit-flow-container">
+            {isFlowEditorOpen ?
+                <a className="edit-flow" onClick={() => {onContentChange(content); closeFlowEditor()}}>
+                    <i className="fa fa-check"/>
+                </a>
+                :
+                <a  className="edit-flow" onClick={() => openFlowEditor()}>
+                    <i className="fa fa-pencil"/>
+                </a>
+            }
+        </div>
+    )
 }
 
 export default connect(
     state => ({
         isFlowEditorOpen: state.ui.isFlowEditorOpen,
-        content: state.flows.modifiedFlow.content
+        content: state.ui.modifiedFlow.content
     }),
     {
         closeFlowEditor,
-- 
cgit v1.2.3

