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
|
@ -1,22 +1,19 @@
|
|||
import {observer} from 'mobx-react';
|
||||
import { observer } from 'mobx-react';
|
||||
import * as React from 'react';
|
||||
import {IMenuItem, MenuStore} from '../../services';
|
||||
import {ContentItems} from './ContentItems';
|
||||
import { IMenuItem, MenuStore } from '../../services';
|
||||
import { ContentItems } from './ContentItems';
|
||||
|
||||
@observer
|
||||
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} />;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import * as React from 'react';
|
|||
import { ThemeProvider } from '../../styled-components';
|
||||
import { OptionsProvider } from '../OptionsProvider';
|
||||
|
||||
import {AppStore} from '../../services';
|
||||
import { AppStore } from '../../services';
|
||||
import { ApiInfo } from '../ApiInfo/';
|
||||
import { ApiLogo } from '../ApiLogo/ApiLogo';
|
||||
import { ContentItems } from '../ContentItems/ContentItems';
|
||||
|
@ -12,7 +12,7 @@ import { SideMenu } from '../SideMenu/SideMenu';
|
|||
import { StickyResponsiveSidebar } from '../StickySidebar/StickyResponsiveSidebar';
|
||||
import { ApiContentWrap, BackgroundStub, RedocWrap } from './styled.elements';
|
||||
|
||||
import {SingleContentItem} from '../ContentItems/SingleContentItem';
|
||||
import { SingleContentItem } from '../ContentItems/SingleContentItem';
|
||||
import { SearchBox } from '../SearchBox/SearchBox';
|
||||
import { StoreProvider } from '../StoreBuilder';
|
||||
|
||||
|
@ -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