diff options
author | Clemens <cle1000.cb@gmail.com> | 2016-07-19 16:13:26 +0200 |
---|---|---|
committer | Clemens <cle1000.cb@gmail.com> | 2016-07-19 16:13:26 +0200 |
commit | 281f20ef1e9ac33a7e210ba562eb2914f6d187e6 (patch) | |
tree | 282dc25fc6020a6a773c5d517a2ec7f34c26c255 /web/src/js/components/FlowView/FlowEditorButton.jsx | |
parent | 698fb11132598a38851383f805dde5ca4d2a046d (diff) | |
download | mitmproxy-281f20ef1e9ac33a7e210ba562eb2914f6d187e6.tar.gz mitmproxy-281f20ef1e9ac33a7e210ba562eb2914f6d187e6.tar.bz2 mitmproxy-281f20ef1e9ac33a7e210ba562eb2914f6d187e6.zip |
added flow_content update
Diffstat (limited to 'web/src/js/components/FlowView/FlowEditorButton.jsx')
-rw-r--r-- | web/src/js/components/FlowView/FlowEditorButton.jsx | 49 |
1 files changed, 20 insertions, 29 deletions
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, |