insomnia/app/ui/components/editors/body/RawEditor.js
Gregory Schier 5d5d6eecc4 Switch Request body to be object instead of string (#47)
* Basic import summary

* Started (broken)
2016-11-22 11:42:10 -08:00

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;