Move loadingStatus code into StandaloneLayout (where it belongs!)

This commit is contained in:
Kyle Shockey
2017-04-14 19:01:57 -07:00
parent 208694e9a8
commit 81f74d9d51
7 changed files with 32 additions and 27 deletions

View File

@@ -32,27 +32,15 @@ export default class BaseLayout extends React.Component {
let Errors = getComponent("errors", true)
const Schemes = getComponent("schemes")
const loadingStatus = specSelectors.loadingStatus()
const isSpecEmpty = !specSelectors.specStr()
if(isSpecEmpty) {
return <h4>No spec provided.</h4>
}
return (
<div className='swagger-ui'>
{ loadingStatus === "loading" &&
<div className="info">
<h4 className="title">Loading...</h4>
</div>
}
{ loadingStatus === "failed" &&
<div className="info">
<h4 className="title">Failed to load spec.</h4>
</div>
}
{ loadingStatus === "failedConfig" &&
<div className="info" style={{ maxWidth: "880px", marginLeft: "auto", marginRight: "auto", textAlign: "center" }}>
<h4 className="title">Failed to load config.</h4>
</div>
}
{ loadingStatus === "success" &&
<div>
<Errors/>
<Row className="information-container">
@@ -85,8 +73,8 @@ export default class BaseLayout extends React.Component {
<Models/>
</Col>
</Row>
</div> }
</div>
</div>
)
}
}
}