mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
42 lines
822 B
JavaScript
42 lines
822 B
JavaScript
|
import React, {PropTypes, Component} from 'react';
|
||
|
import Editor from '../../base/Editor';
|
||
|
|
||
|
class RawEditor extends Component {
|
||
|
render () {
|
||
|
const {
|
||
|
contentType,
|
||
|
content,
|
||
|
fontSize,
|
||
|
lineWrapping,
|
||
|
onChange,
|
||
|
className
|
||
|
} = this.props;
|
||
|
|
||
|
return (
|
||
|
<Editor
|
||
|
manualPrettify={true}
|
||
|
fontSize={fontSize}
|
||
|
value={content}
|
||
|
className={className}
|
||
|
onChange={onChange}
|
||
|
mode={contentType}
|
||
|
lineWrapping={lineWrapping}
|
||
|
placeholder="..."
|
||
|
/>
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
RawEditor.propTypes = {
|
||
|
// Required
|
||
|
onChange: PropTypes.func.isRequired,
|
||
|
content: PropTypes.string.isRequired,
|
||
|
contentType: PropTypes.string.isRequired,
|
||
|
|
||
|
// Optional
|
||
|
fontSize: PropTypes.number,
|
||
|
lineWrapping: PropTypes.bool
|
||
|
};
|
||
|
|
||
|
export default RawEditor;
|