2016-03-22 05:01:58 +00:00
|
|
|
import React, {Component, PropTypes} from 'react';
|
2016-04-09 21:41:27 +00:00
|
|
|
import Editor from './base/Editor'
|
2016-03-22 05:01:58 +00:00
|
|
|
|
|
|
|
class RequestBodyEditor extends Component {
|
|
|
|
render () {
|
2016-04-28 06:22:50 +00:00
|
|
|
const {body, contentType, onChange, className} = this.props;
|
2016-04-04 07:15:30 +00:00
|
|
|
|
2016-03-22 05:01:58 +00:00
|
|
|
return (
|
2016-04-09 21:41:27 +00:00
|
|
|
<Editor
|
2016-04-26 07:29:24 +00:00
|
|
|
value={body}
|
2016-03-22 05:01:58 +00:00
|
|
|
className={className}
|
2016-04-26 07:29:24 +00:00
|
|
|
debounceMillis={400}
|
2016-03-22 05:01:58 +00:00
|
|
|
onChange={onChange}
|
2016-04-29 01:00:12 +00:00
|
|
|
mode={contentType}
|
|
|
|
placeholder="request body here..."
|
2016-03-22 05:01:58 +00:00
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RequestBodyEditor.propTypes = {
|
2016-04-26 07:29:24 +00:00
|
|
|
// Functions
|
|
|
|
onChange: PropTypes.func.isRequired,
|
2016-04-29 01:00:12 +00:00
|
|
|
|
2016-04-26 07:29:24 +00:00
|
|
|
// Other
|
|
|
|
body: PropTypes.string.isRequired,
|
|
|
|
contentType: PropTypes.string.isRequired
|
2016-03-22 05:01:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default RequestBodyEditor;
|