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<{
|
||||
menu: MenuStore;
|
||||
}> {
|
||||
|
||||
extractActive(menu: MenuStore): IMenuItem[] {
|
||||
const active = menu.flatItems[menu.activeItemIdx];
|
||||
if (!active) {
|
||||
return [menu.flatItems[0]];
|
||||
}
|
||||
if (active.type !== 'operation') {
|
||||
return [
|
||||
{...active, items: []},
|
||||
];
|
||||
return [{ ...active, items: [] }];
|
||||
}
|
||||
return [active];
|
||||
}
|
||||
|
@ -24,8 +21,6 @@ export class SingleContentItem extends React.Component<{
|
|||
render() {
|
||||
const { menu } = this.props;
|
||||
const activeItems = this.extractActive(menu);
|
||||
return (
|
||||
<ContentItems items={activeItems as any} />
|
||||
);
|
||||
return <ContentItems items={activeItems as any} />;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,10 +58,11 @@ export class Redoc extends React.Component<RedocProps> {
|
|||
</StickyResponsiveSidebar>
|
||||
<ApiContentWrap className="api-content">
|
||||
<ApiInfo store={store} />
|
||||
{options.disableInfiniteScroll
|
||||
? <SingleContentItem menu={menu}/>
|
||||
: <ContentItems items={menu.items as any}/>
|
||||
}
|
||||
{options.disableInfiniteScroll ? (
|
||||
<SingleContentItem menu={menu} />
|
||||
) : (
|
||||
<ContentItems items={menu.items as any} />
|
||||
)}
|
||||
</ApiContentWrap>
|
||||
<BackgroundStub />
|
||||
</RedocWrap>
|
||||
|
|
|
@ -387,7 +387,9 @@ describe('Utils', () => {
|
|||
expect(pluralizeType('objects (Pet)')).toEqual('objects (Pet)');
|
||||
expect(pluralizeType('strings <email>')).toEqual('strings <email>');
|
||||
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