run prettier just in case

This commit is contained in:
Braden Napier 2019-03-18 20:50:05 -07:00
parent cc781aba91
commit 04264f9efe
7 changed files with 52 additions and 68 deletions

View File

@ -5,11 +5,7 @@ import { ClipboardService } from '../services/ClipboardService';
export interface CopyButtonWrapperProps { export interface CopyButtonWrapperProps {
data: any; data: any;
children: ( children: (props: { renderCopyButton: () => React.ReactNode }) => React.ReactNode;
props: {
renderCopyButton: (() => React.ReactNode);
},
) => React.ReactNode;
} }
export class CopyButtonWrapper extends React.PureComponent< export class CopyButtonWrapper extends React.PureComponent<

View File

@ -44,22 +44,20 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
null; null;
const website = const website =
(info.contact && (info.contact && info.contact.url && (
info.contact.url && ( <InfoSpan>
<InfoSpan> URL: <a href={info.contact.url}>{info.contact.url}</a>
URL: <a href={info.contact.url}>{info.contact.url}</a> </InfoSpan>
</InfoSpan> )) ||
)) ||
null; null;
const email = const email =
(info.contact && (info.contact && info.contact.email && (
info.contact.email && ( <InfoSpan>
<InfoSpan> {info.contact.name || 'E-mail'}:{' '}
{info.contact.name || 'E-mail'}:{' '} <a href={'mailto:' + info.contact.email}>{info.contact.email}</a>
<a href={'mailto:' + info.contact.email}>{info.contact.email}</a> </InfoSpan>
</InfoSpan> )) ||
)) ||
null; null;
const terms = const terms =
@ -70,11 +68,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
)) || )) ||
null; null;
const version = const version = (info.version && <span>({info.version})</span>) || null;
(info.version && (
<span>({info.version})</span>
)) ||
null;
return ( return (
<Section> <Section>

View File

@ -65,21 +65,20 @@ export class Field extends React.Component<FieldProps> {
<FieldDetails {...this.props} /> <FieldDetails {...this.props} />
</PropertyDetailsCell> </PropertyDetailsCell>
</tr> </tr>
{field.expanded && {field.expanded && withSubSchema && (
withSubSchema && ( <tr key={field.name + 'inner'}>
<tr key={field.name + 'inner'}> <PropertyCellWithInner colSpan={2}>
<PropertyCellWithInner colSpan={2}> <InnerPropertiesWrap>
<InnerPropertiesWrap> <Schema
<Schema schema={field.schema}
schema={field.schema} skipReadOnly={this.props.skipReadOnly}
skipReadOnly={this.props.skipReadOnly} skipWriteOnly={this.props.skipWriteOnly}
skipWriteOnly={this.props.skipWriteOnly} showTitle={this.props.showTitle}
showTitle={this.props.showTitle} />
/> </InnerPropertiesWrap>
</InnerPropertiesWrap> </PropertyCellWithInner>
</PropertyCellWithInner> </tr>
</tr> )}
)}
</> </>
); );
} }

View File

@ -13,22 +13,19 @@ export function useExternalExample(example: ExampleModel, mimeType: string) {
prevRef.current = example; prevRef.current = example;
useEffect( useEffect(() => {
() => { const load = async () => {
const load = async () => { setIsLoading(true);
setIsLoading(true); try {
try { value.current = await example.getExternalValue(mimeType);
value.current = await example.getExternalValue(mimeType); } catch (e) {
} catch (e) { value.current = e;
value.current = e; }
} setIsLoading(false);
setIsLoading(false); };
};
load(); load();
}, }, [example, mimeType]);
[example, mimeType],
);
return value.current; return value.current;
} }

View File

@ -28,12 +28,11 @@ export class ResponseView extends React.Component<{ response: ResponseModel }> {
code={code} code={code}
opened={expanded} opened={expanded}
/> />
{expanded && {expanded && !empty && (
!empty && ( <ResponseDetailsWrap>
<ResponseDetailsWrap> <ResponseDetails response={this.props.response} />
<ResponseDetails response={this.props.response} /> </ResponseDetailsWrap>
</ResponseDetailsWrap> )}
)}
</div> </div>
); );
} }

View File

@ -93,13 +93,12 @@ export class SecurityDefs extends React.PureComponent<SecurityDefsProps> {
<th> HTTP Authorization Scheme </th> <th> HTTP Authorization Scheme </th>
<td> {scheme.http.scheme} </td> <td> {scheme.http.scheme} </td>
</tr>, </tr>,
scheme.http.scheme === 'bearer' && scheme.http.scheme === 'bearer' && scheme.http.bearerFormat && (
scheme.http.bearerFormat && ( <tr key="bearer">
<tr key="bearer"> <th> Bearer format </th>
<th> Bearer format </th> <td> "{scheme.http.bearerFormat}" </td>
<td> "{scheme.http.bearerFormat}" </td> </tr>
</tr> ),
),
] ]
) : scheme.openId ? ( ) : scheme.openId ? (
<tr> <tr>

View File

@ -77,8 +77,8 @@ export class OperationModel implements IMenuItem {
operationSpec.operationId !== undefined operationSpec.operationId !== undefined
? 'operation/' + operationSpec.operationId ? 'operation/' + operationSpec.operationId
: parent !== undefined : parent !== undefined
? parent.id + this.pointer ? parent.id + this.pointer
: this.pointer; : this.pointer;
this.name = getOperationSummary(operationSpec); this.name = getOperationSummary(operationSpec);
this.description = operationSpec.description; this.description = operationSpec.description;