aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-13 02:44:18 +0800
committerFabio Berger <me@fabioberger.com>2018-10-13 02:44:18 +0800
commita4604cb2f294f08318aa432b233571ae4e205fd5 (patch)
treebed045a9018342ec3f45ffa17aa3f5396cb6b7bf
parent3ca943948184bf8d891dddb423e5b285d2463e7b (diff)
downloaddexon-sol-tools-a4604cb2f294f08318aa432b233571ae4e205fd5.tar
dexon-sol-tools-a4604cb2f294f08318aa432b233571ae4e205fd5.tar.gz
dexon-sol-tools-a4604cb2f294f08318aa432b233571ae4e205fd5.tar.bz2
dexon-sol-tools-a4604cb2f294f08318aa432b233571ae4e205fd5.tar.lz
dexon-sol-tools-a4604cb2f294f08318aa432b233571ae4e205fd5.tar.xz
dexon-sol-tools-a4604cb2f294f08318aa432b233571ae4e205fd5.tar.zst
dexon-sol-tools-a4604cb2f294f08318aa432b233571ae4e205fd5.zip
Pass down sidebar instead of sectionNameToLinks
-rw-r--r--packages/website/ts/components/documentation/docs_top_bar.tsx11
-rw-r--r--packages/website/ts/pages/documentation/developers_page.tsx12
-rw-r--r--packages/website/ts/pages/documentation/doc_page.tsx6
-rw-r--r--packages/website/ts/pages/documentation/docs_home.tsx7
4 files changed, 17 insertions, 19 deletions
diff --git a/packages/website/ts/components/documentation/docs_top_bar.tsx b/packages/website/ts/components/documentation/docs_top_bar.tsx
index 9a2146f9c..41273eb30 100644
--- a/packages/website/ts/components/documentation/docs_top_bar.tsx
+++ b/packages/website/ts/components/documentation/docs_top_bar.tsx
@@ -13,7 +13,7 @@ import { Translate } from 'ts/utils/translate';
export interface DocsTopBarProps {
location: Location;
translate: Translate;
- sectionNameToLinks?: ObjectMap<ALink[]>;
+ sidebar?: React.ReactNode;
}
interface DocsTopBarState {
@@ -143,13 +143,8 @@ export class DocsTopBar extends React.Component<DocsTopBarProps, DocsTopBarState
openSecondary={true}
onRequestChange={this._onMenuButtonClick.bind(this)}
>
- <Container className="clearfix pl1">
- <NestedSidebarMenu
- sectionNameToLinks={this.props.sectionNameToLinks}
- shouldDisplaySectionHeaders={true}
- shouldReformatMenuItemNames={false}
- onMenuItemClick={this._onMenuButtonClick.bind(this)}
- />
+ <Container className="clearfix pl1" onClick={this._onMenuButtonClick.bind(this)}>
+ {this.props.sidebar}
</Container>
</Drawer>
);
diff --git a/packages/website/ts/pages/documentation/developers_page.tsx b/packages/website/ts/pages/documentation/developers_page.tsx
index 7172a7c66..c924fb460 100644
--- a/packages/website/ts/pages/documentation/developers_page.tsx
+++ b/packages/website/ts/pages/documentation/developers_page.tsx
@@ -1,5 +1,4 @@
-import { ALink, colors, constants as sharedConstants, NestedSidebarMenu } from '@0xproject/react-shared';
-import { ObjectMap } from '@0xproject/types';
+import { colors, constants as sharedConstants } from '@0xproject/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
import DocumentTitle = require('react-document-title');
@@ -21,7 +20,7 @@ export interface DevelopersPageProps {
screenWidth: ScreenWidths;
dispatcher: Dispatcher;
mainContent: React.ReactNode;
- sectionNameToLinks: ObjectMap<ALink[]>;
+ sidebar: React.ReactNode;
}
export interface DevelopersPageState {
@@ -107,10 +106,7 @@ export class DevelopersPage extends React.Component<DevelopersPageProps, Develop
onWheel={this._throttledSidebarScrolling}
>
<Container paddingLeft="22px" paddingRight="22px" paddingBottom="100px">
- <NestedSidebarMenu
- sectionNameToLinks={this.props.sectionNameToLinks}
- shouldReformatMenuItemNames={false}
- />
+ {this.props.sidebar}
</Container>
</div>
</Container>
@@ -124,7 +120,7 @@ export class DevelopersPage extends React.Component<DevelopersPageProps, Develop
<DocsTopBar
location={this.props.location}
translate={this.props.translate}
- sectionNameToLinks={this.props.sectionNameToLinks}
+ sidebar={this.props.sidebar}
/>
</Container>
<div
diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx
index 58b6f076d..bc0dc7b6a 100644
--- a/packages/website/ts/pages/documentation/doc_page.tsx
+++ b/packages/website/ts/pages/documentation/doc_page.tsx
@@ -6,6 +6,7 @@ import {
SupportedDocJson,
TypeDocUtils,
} from '@0xproject/react-docs';
+import { NestedSidebarMenu } from '@0xproject/react-shared';
import findVersions = require('find-versions');
import * as _ from 'lodash';
import CircularProgress from 'material-ui/CircularProgress';
@@ -87,10 +88,13 @@ export class DocPage extends React.Component<DocPageProps, DocPageState> {
sourceUrl={sourceUrl}
/>
);
+ const sidebar = (
+ <NestedSidebarMenu sectionNameToLinks={sectionNameToLinks} shouldReformatMenuItemNames={false} />
+ );
return (
<DevelopersPage
+ sidebar={sidebar}
mainContent={mainContent}
- sectionNameToLinks={sectionNameToLinks}
location={this.props.location}
screenWidth={this.props.screenWidth}
translate={this.props.translate}
diff --git a/packages/website/ts/pages/documentation/docs_home.tsx b/packages/website/ts/pages/documentation/docs_home.tsx
index c5b4ed318..1059bb844 100644
--- a/packages/website/ts/pages/documentation/docs_home.tsx
+++ b/packages/website/ts/pages/documentation/docs_home.tsx
@@ -1,4 +1,4 @@
-import { ALink } from '@0xproject/react-shared';
+import { ALink, NestedSidebarMenu } from '@0xproject/react-shared';
import { ObjectMap } from '@0xproject/types';
import * as _ from 'lodash';
import * as React from 'react';
@@ -330,10 +330,13 @@ export class DocsHome extends React.Component<DocsHomeProps, DocsHomeState> {
categoryToPackages={CATEGORY_TO_PACKAGES}
/>
);
+ const sidebar = (
+ <NestedSidebarMenu sectionNameToLinks={sectionNameToLinks} shouldReformatMenuItemNames={false} />
+ );
return (
<DevelopersPage
mainContent={mainContent}
- sectionNameToLinks={sectionNameToLinks}
+ sidebar={sidebar}
location={this.props.location}
screenWidth={this.props.screenWidth}
translate={this.props.translate}