Files
swagger-ui/src/core/containers/schemes.jsx
kyle 004f107ec4 fix: repair schemes servers rendering (via #4913)
* create AuthorizeBtnContainer

* remove Servers and AuthorizeBtn from Schemes' concern

* add AuthorizeBtnContainer to base

* strengthen OAS3 definitionsToAuthorize

* drop obsolete tests

* linter fixes
2018-10-01 20:27:52 -05:00

31 lines
763 B
JavaScript

import React from "react"
import PropTypes from "prop-types"
export default class SchemesContainer extends React.Component {
static propTypes = {
specActions: PropTypes.object.isRequired,
specSelectors: PropTypes.object.isRequired,
getComponent: PropTypes.func.isRequired
}
render () {
const {specActions, specSelectors, getComponent} = this.props
const currentScheme = specSelectors.operationScheme()
const schemes = specSelectors.schemes()
const Schemes = getComponent("schemes")
const schemesArePresent = schemes && schemes.size
return schemesArePresent ? (
<Schemes
currentScheme={currentScheme}
schemes={schemes}
specActions={specActions}
/>
) : null
}
}