Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Nov 2, 2017
1 parent 67b9a03 commit f0fc306
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/api-explorer-ui/src/CodeSampleResponse.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class CodeSampleResponse extends React.Component {
)}
</div>

{ this.state.selectedTab === 'metadata' && <ResponseMetadata result={result} /> }
{this.state.selectedTab === 'metadata' && <ResponseMetadata result={result} />}
</span>
)}
</div>
Expand Down
5 changes: 3 additions & 2 deletions packages/api-explorer-ui/src/ResponseMetadata.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ const PropTypes = require('prop-types');

function ResponseMetadata({ result }) {
return (
<div className="hub-reference-results-meta tabber-body-metadata tabber-body"
<div
className="hub-reference-results-meta tabber-body-metadata tabber-body"
style={{ display: 'block' }}
>
>
<div className="meta">
{
// eslint-disable-next-line jsx-a11y/label-has-for
Expand Down
32 changes: 17 additions & 15 deletions packages/api-explorer-ui/src/lib/create-code-shower.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@ module.exports = type => {

if (pathOperation._cache[type]) return pathOperation._cache[type];

const codes = Object.keys(pathOperation.responses || {}).map(status => {
const response = pathOperation.responses[status];

const language = getLanguage(response);
if (!language) return false;

const example = getExample(response, language);
if (!example) return false;

return {
code: typeof example === 'object' ? JSON.stringify(example, undefined, 2) : example,
language,
status,
};
}).filter(Boolean);
const codes = Object.keys(pathOperation.responses || {})
.map(status => {
const response = pathOperation.responses[status];

const language = getLanguage(response);
if (!language) return false;

const example = getExample(response, language);
if (!example) return false;

return {
code: typeof example === 'object' ? JSON.stringify(example, undefined, 2) : example,
language,
status,
};
})
.filter(Boolean);

pathOperation._cache[type] = codes;
return codes;
Expand Down

0 comments on commit f0fc306

Please sign in to comment.