mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 14:14:56 +03:00
Yarn prettier
This commit is contained in:
parent
10c5662b64
commit
8a99f59ba5
|
@ -7,16 +7,13 @@ import {ContentItems} from './ContentItems';
|
||||||
export class SingleContentItem extends React.Component<{
|
export class SingleContentItem extends React.Component<{
|
||||||
menu: MenuStore;
|
menu: MenuStore;
|
||||||
}> {
|
}> {
|
||||||
|
|
||||||
extractActive(menu: MenuStore): IMenuItem[] {
|
extractActive(menu: MenuStore): IMenuItem[] {
|
||||||
const active = menu.flatItems[menu.activeItemIdx];
|
const active = menu.flatItems[menu.activeItemIdx];
|
||||||
if (!active) {
|
if (!active) {
|
||||||
return [menu.flatItems[0]];
|
return [menu.flatItems[0]];
|
||||||
}
|
}
|
||||||
if (active.type !== 'operation') {
|
if (active.type !== 'operation') {
|
||||||
return [
|
return [{ ...active, items: [] }];
|
||||||
{...active, items: []},
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
return [active];
|
return [active];
|
||||||
}
|
}
|
||||||
|
@ -24,8 +21,6 @@ export class SingleContentItem extends React.Component<{
|
||||||
render() {
|
render() {
|
||||||
const { menu } = this.props;
|
const { menu } = this.props;
|
||||||
const activeItems = this.extractActive(menu);
|
const activeItems = this.extractActive(menu);
|
||||||
return (
|
return <ContentItems items={activeItems as any} />;
|
||||||
<ContentItems items={activeItems as any} />
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,10 +58,11 @@ export class Redoc extends React.Component<RedocProps> {
|
||||||
</StickyResponsiveSidebar>
|
</StickyResponsiveSidebar>
|
||||||
<ApiContentWrap className="api-content">
|
<ApiContentWrap className="api-content">
|
||||||
<ApiInfo store={store} />
|
<ApiInfo store={store} />
|
||||||
{options.disableInfiniteScroll
|
{options.disableInfiniteScroll ? (
|
||||||
? <SingleContentItem menu={menu}/>
|
<SingleContentItem menu={menu} />
|
||||||
: <ContentItems items={menu.items as any}/>
|
) : (
|
||||||
}
|
<ContentItems items={menu.items as any} />
|
||||||
|
)}
|
||||||
</ApiContentWrap>
|
</ApiContentWrap>
|
||||||
<BackgroundStub />
|
<BackgroundStub />
|
||||||
</RedocWrap>
|
</RedocWrap>
|
||||||
|
|
|
@ -387,7 +387,9 @@ describe('Utils', () => {
|
||||||
expect(pluralizeType('objects (Pet)')).toEqual('objects (Pet)');
|
expect(pluralizeType('objects (Pet)')).toEqual('objects (Pet)');
|
||||||
expect(pluralizeType('strings <email>')).toEqual('strings <email>');
|
expect(pluralizeType('strings <email>')).toEqual('strings <email>');
|
||||||
expect(pluralizeType('objects or strings')).toEqual('objects or strings');
|
expect(pluralizeType('objects or strings')).toEqual('objects or strings');
|
||||||
expect(pluralizeType('objects (Pet) or numbers <int64>')).toEqual('objects (Pet) or numbers <int64>');
|
expect(pluralizeType('objects (Pet) or numbers <int64>')).toEqual(
|
||||||
|
'objects (Pet) or numbers <int64>',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user