mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-29 20:13:43 +03:00
chore: prettier all
This commit is contained in:
parent
84e03e2d07
commit
45c0c23c73
|
@ -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<
|
||||||
|
|
|
@ -44,8 +44,7 @@ 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>
|
||||||
|
@ -53,8 +52,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
|
||||||
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>
|
||||||
|
@ -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>
|
||||||
|
|
|
@ -65,8 +65,7 @@ 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>
|
||||||
|
|
|
@ -17,10 +17,7 @@ export class FieldDetail extends React.PureComponent<FieldDetailProps> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<FieldLabel> {this.props.label} </FieldLabel>{' '}
|
<FieldLabel> {this.props.label} </FieldLabel> <ExampleValue>{value}</ExampleValue>
|
||||||
<ExampleValue>
|
|
||||||
{value}
|
|
||||||
</ExampleValue>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ 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 {
|
||||||
|
@ -26,9 +25,7 @@ export function useExternalExample(example: ExampleModel, mimeType: string) {
|
||||||
};
|
};
|
||||||
|
|
||||||
load();
|
load();
|
||||||
},
|
}, [example, mimeType]);
|
||||||
[example, mimeType],
|
|
||||||
);
|
|
||||||
|
|
||||||
return value.current;
|
return value.current;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,7 @@ 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>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user