From 4c768804b20ef789b77451aafef04d9b4076bfea Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 27 Apr 2016 23:22:50 -0700 Subject: [PATCH] Hooked up content type selection dropdown (#14) --- app/components/ContentTypeDropdown.js | 31 +++++++++++++++++++++++++++ app/components/RequestBodyEditor.js | 4 +--- app/components/RequestPane.js | 22 +++++++++---------- app/components/ResponsePane.js | 8 ++++++- app/components/base/Editor.js | 31 +++++++++++---------------- app/containers/App.js | 1 + app/css/layout/base.scss | 8 +++++++ app/lib/contentTypes.js | 24 +++++++++++++++++++++ 8 files changed, 95 insertions(+), 34 deletions(-) create mode 100644 app/components/ContentTypeDropdown.js create mode 100644 app/lib/contentTypes.js diff --git a/app/components/ContentTypeDropdown.js b/app/components/ContentTypeDropdown.js new file mode 100644 index 0000000000..13f9dbabe9 --- /dev/null +++ b/app/components/ContentTypeDropdown.js @@ -0,0 +1,31 @@ +import React, {Component, PropTypes} from 'react' + +import Dropdown from '../components/base/Dropdown' +import * as contentTypes from '../lib/contentTypes' + +class ContentTypeDropdown extends Component { + render () { + const {updateRequestContentType} = this.props; + + return ( + + + + + ) + } +} + +ContentTypeDropdown.propTypes = { + updateRequestContentType: PropTypes.func.isRequired +}; + +export default ContentTypeDropdown; diff --git a/app/components/RequestBodyEditor.js b/app/components/RequestBodyEditor.js index a3e7165933..bf3826a1dd 100644 --- a/app/components/RequestBodyEditor.js +++ b/app/components/RequestBodyEditor.js @@ -3,7 +3,7 @@ import Editor from './base/Editor' class RequestBodyEditor extends Component { render () { - const {body, contentType, requestId, onChange, className} = this.props; + const {body, contentType, onChange, className} = this.props; return ( - - - -
    - {/*
  • */} -
  • -
  • -
  • -
-
+ +