From f578bf512248c609296d2ff0ea2007a6feac561f Mon Sep 17 00:00:00 2001
From: Clemens <cle1000.cb@gmail.com>
Date: Fri, 22 Jul 2016 19:07:53 +0200
Subject: file upload updates contentview, editable contentloader, diffs on
 upload

---
 web/src/js/components/common/CodeEditor.jsx | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

(limited to 'web/src/js/components/common/CodeEditor.jsx')

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>
+    )
 }
-- 
cgit v1.2.3

