mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
d04618b28b
* Include fixtures in prettier default pattern * Run all fixtures through Prettier
40 lines
813 B
JavaScript
40 lines
813 B
JavaScript
import React, {Component} from 'react';
|
|
|
|
class Editor extends Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
code: props.code,
|
|
};
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div
|
|
style={{
|
|
height: '100%',
|
|
width: '100%',
|
|
}}>
|
|
<textarea
|
|
value={this.state.code}
|
|
onChange={e => this.setState({code: e.target.value})}
|
|
style={{
|
|
height: '80%',
|
|
width: '100%',
|
|
fontSize: '15px',
|
|
}}
|
|
/>
|
|
<div style={{height: '20%', textAlign: 'center'}}>
|
|
<button
|
|
onClick={() => this.props.onClose(this.state.code)}
|
|
style={{fontSize: 'large'}}>
|
|
Run
|
|
</button>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default Editor;
|