aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/common
diff options
context:
space:
mode:
authorClemens <cle1000.cb@gmail.com>2016-07-22 19:07:53 +0200
committerClemens <cle1000.cb@gmail.com>2016-07-22 19:07:53 +0200
commitf578bf512248c609296d2ff0ea2007a6feac561f (patch)
tree7c58f14f09df0699cc788cde84e60b76d5f863e3 /web/src/js/components/common
parent70ca10b423de4a57a395798aa94189ba4da7840f (diff)
downloadmitmproxy-f578bf512248c609296d2ff0ea2007a6feac561f.tar.gz
mitmproxy-f578bf512248c609296d2ff0ea2007a6feac561f.tar.bz2
mitmproxy-f578bf512248c609296d2ff0ea2007a6feac561f.zip
file upload updates contentview, editable contentloader, diffs on upload
Diffstat (limited to 'web/src/js/components/common')
-rw-r--r--web/src/js/components/common/CodeEditor.jsx27
1 files changed, 11 insertions, 16 deletions
diff --git a/web/src/js/components/common/CodeEditor.jsx b/web/src/js/components/common/CodeEditor.jsx
index ad7af39d..95f1b98b 100644
--- a/web/src/js/components/common/CodeEditor.jsx
+++ b/web/src/js/components/common/CodeEditor.jsx
@@ -3,24 +3,19 @@ import { render } from 'react-dom';
import Codemirror from 'react-codemirror';
-export default class CodeEditor extends Component{
- static propTypes = {
+CodeEditor.propTypes = {
content: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired,
- }
+}
- constructor(props){
- super(props)
- }
+export default function CodeEditor ( { content, onChange} ){
- render() {
- let options = {
- lineNumbers: true
- };
- return (
- <div onKeyDown={e => e.stopPropagation()}>
- <Codemirror value={this.props.content} onChange={this.props.onChange} options={options}/>
- </div>
- )
- }
+ let options = {
+ lineNumbers: true
+ };
+ return (
+ <div onKeyDown={e => e.stopPropagation()}>
+ <Codemirror value={content} onChange={onChange} options={options}/>
+ </div>
+ )
}