insomnia/app/components/RequestBodyEditor.js

25 lines
538 B
JavaScript
Raw Normal View History

2016-06-15 03:20:05 +00:00
import React, {PropTypes} from 'react';
2016-04-09 21:41:27 +00:00
import Editor from './base/Editor'
2016-03-22 05:01:58 +00:00
2016-04-29 04:57:03 +00:00
const RequestBodyEditor = ({body, contentType, onChange, className}) => (
<Editor
value={body}
className={className}
onChange={onChange}
mode={contentType}
2016-06-18 21:02:27 +00:00
lineWrapping={true}
2016-04-29 04:57:03 +00:00
placeholder="request body here..."
/>
);
2016-03-22 05:01:58 +00:00
RequestBodyEditor.propTypes = {
// Functions
onChange: PropTypes.func.isRequired,
2016-04-29 01:00:12 +00:00
// Other
body: PropTypes.string.isRequired,
contentType: PropTypes.string.isRequired
2016-03-22 05:01:58 +00:00
};
export default RequestBodyEditor;