-
-
Notifications
You must be signed in to change notification settings - Fork 320
/
main.js
35 lines (32 loc) · 833 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React, { Component } from 'react';
import Editor from '@monaco-editor/react';
import { RingSpinner as Loader } from './RingSpinner.js';
class MainEditor extends Component {
constructor(props) {
super(props);
this.state = {
isEditorReady: false,
};
this.handleEditorDidMount = this.handleEditorDidMount.bind(this);
}
handleEditorDidMount() {
this.setState({ isEditorReady: true });
}
render() {
return (
<div>
<Editor
height="50rem"
theme={this.props.theme}
language={'css'}
loading={<Loader />}
value={this.props.input}
onChange={this.props.handleOnChange}
onMount={this.handleEditorDidMount}
options={{ lineNumbers: 'on' }}
/>
</div>
);
}
}
export default MainEditor;