insomnia/app/ui/components/editors/body/RawEditor.js
Gregory Schier c1e9e718e9 Perf/one line input hybrid (#100)
* Fixed duplication kve bug

* one-line-input now defaults to <input>

* Fixed urlbar width

* Removed all boolean flags

* Fixed some edge cases

* I think it's good

* A bunch more fixes too

* Fixed querystring with hashes
2017-03-01 13:15:56 -08:00

48 lines
1000 B
JavaScript

import React, {PropTypes, PureComponent} from 'react';
import Editor from '../../codemirror/Editor';
class RawEditor extends PureComponent {
render () {
const {
contentType,
content,
fontSize,
keyMap,
render,
lineWrapping,
onChange,
className
} = this.props;
return (
<Editor
manualPrettify
fontSize={fontSize}
keyMap={keyMap}
defaultValue={content}
className={className}
render={render}
onChange={onChange}
mode={contentType}
lineWrapping={lineWrapping}
placeholder="..."
/>
)
}
}
RawEditor.propTypes = {
// Required
onChange: PropTypes.func.isRequired,
content: PropTypes.string.isRequired,
contentType: PropTypes.string.isRequired,
fontSize: PropTypes.number.isRequired,
keyMap: PropTypes.string.isRequired,
lineWrapping: PropTypes.bool.isRequired,
// Optional
render: PropTypes.func,
};
export default RawEditor;