Fix linter
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ALink, LinkType, MenuSubsectionsBySection, utils as sharedUtils } from '@0xproject/react-shared';
|
||||
import { ALink, LinkType, utils as sharedUtils } from '@0xproject/react-shared';
|
||||
import { DocAgnosticFormat, ObjectMap, TypeDefinitionByName } from '@0xproject/types';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
|
@@ -3,7 +3,7 @@ import * as _ from 'lodash';
|
||||
import MenuItem from 'material-ui/MenuItem';
|
||||
import * as React from 'react';
|
||||
|
||||
import { ALink, LinkType, Styles } from '../types';
|
||||
import { ALink, Styles } from '../types';
|
||||
import { colors } from '../utils/colors';
|
||||
import { constants } from '../utils/constants';
|
||||
import { utils } from '../utils/utils';
|
||||
@@ -127,9 +127,9 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
return this._renderMenuSubsectionsBySection(menuItemName, this.props.subsectionNameToLinks[menuItemName]);
|
||||
return this._renderSubsectionsLinks(menuItemName, this.props.subsectionNameToLinks[menuItemName]);
|
||||
}
|
||||
private _renderMenuSubsectionsBySection(menuItemName: string, links: ALink[]): React.ReactNode {
|
||||
private _renderSubsectionsLinks(menuItemName: string, links: ALink[]): React.ReactNode {
|
||||
return (
|
||||
<ul style={{ margin: 0, listStyleType: 'none', paddingLeft: 0 }} key={menuItemName}>
|
||||
{_.map(links, link => {
|
||||
|
@@ -6,15 +6,7 @@ export { NestedSidebarMenu } from './components/nested_sidebar_menu';
|
||||
export { SectionHeader } from './components/section_header';
|
||||
export { Link } from './components/link';
|
||||
|
||||
export {
|
||||
HeaderSizes,
|
||||
Styles,
|
||||
MenuSubsectionsBySection,
|
||||
EtherscanLinkSuffixes,
|
||||
Networks,
|
||||
LinkType,
|
||||
ALink,
|
||||
} from './types';
|
||||
export { HeaderSizes, Styles, EtherscanLinkSuffixes, Networks, LinkType, ALink } from './types';
|
||||
|
||||
export { utils } from './utils/utils';
|
||||
export { constants } from './utils/constants';
|
||||
|
@@ -8,10 +8,6 @@ export enum HeaderSizes {
|
||||
H3 = 'h3',
|
||||
}
|
||||
|
||||
export interface MenuSubsectionsBySection {
|
||||
[section: string]: string[];
|
||||
}
|
||||
|
||||
export enum EtherscanLinkSuffixes {
|
||||
Address = 'address',
|
||||
Tx = 'tx',
|
||||
|
@@ -9,13 +9,13 @@ import { Deco, Key, WebsitePaths } from 'ts/types';
|
||||
import { constants } from 'ts/utils/constants';
|
||||
import { Translate } from 'ts/utils/translate';
|
||||
|
||||
export interface DocsContentTopBarProps {
|
||||
export interface DocsTopBarProps {
|
||||
location: Location;
|
||||
translate: Translate;
|
||||
sectionNameToLinks?: ObjectMap<ALink[]>;
|
||||
}
|
||||
|
||||
interface DocsContentTopBarState {
|
||||
interface DocsTopBarState {
|
||||
isDrawerOpen: boolean;
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ interface MenuItemInfo {
|
||||
textStyle: React.CSSProperties;
|
||||
}
|
||||
|
||||
export class DocsContentTopBar extends React.Component<DocsContentTopBarProps, DocsContentTopBarState> {
|
||||
constructor(props: DocsContentTopBarProps) {
|
||||
export class DocsTopBar extends React.Component<DocsTopBarProps, DocsTopBarState> {
|
||||
constructor(props: DocsTopBarProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
isDrawerOpen: false,
|
||||
};
|
||||
}
|
||||
public componentWillReceiveProps(nextProps: DocsContentTopBarProps): void {
|
||||
public componentWillReceiveProps(nextProps: DocsTopBarProps): void {
|
||||
if (nextProps.location.pathname !== this.props.location.pathname) {
|
||||
this.setState({
|
||||
isDrawerOpen: false,
|
@@ -10,13 +10,12 @@ import {
|
||||
} from '@0xproject/react-shared';
|
||||
import { ObjectMap } from '@0xproject/types';
|
||||
import * as _ from 'lodash';
|
||||
import MenuItem from 'material-ui/MenuItem';
|
||||
import * as React from 'react';
|
||||
import DocumentTitle = require('react-document-title');
|
||||
import * as ReactMarkdown from 'react-markdown';
|
||||
import { Element as ScrollElement } from 'react-scroll';
|
||||
import { DocsContentTopBar } from 'ts/components/documentation/docs_content_top_bar';
|
||||
import { DocsLogo } from 'ts/components/documentation/docs_logo';
|
||||
import { DocsTopBar } from 'ts/components/documentation/docs_top_bar';
|
||||
import { TutorialButton } from 'ts/components/documentation/tutorial_button';
|
||||
import { Container } from 'ts/components/ui/container';
|
||||
import { Text } from 'ts/components/ui/text';
|
||||
@@ -475,7 +474,7 @@ export class Home extends React.Component<HomeProps, HomeState> {
|
||||
backgroundColor={colors.white}
|
||||
>
|
||||
<Container paddingLeft={mainContentPadding} paddingRight={mainContentPadding}>
|
||||
<DocsContentTopBar
|
||||
<DocsTopBar
|
||||
location={this.props.location}
|
||||
translate={this.props.translate}
|
||||
sectionNameToLinks={sectionNameToLinks}
|
||||
|
Reference in New Issue
Block a user