From 8d6bffa96ca26e59b0c10f9f46f6f1e03e3518e9 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 3 Oct 2018 17:03:05 +0100 Subject: Use nestedSidebarMenu component for Dev home --- packages/website/ts/pages/documentation/home.tsx | 49 ++++-------------------- 1 file changed, 8 insertions(+), 41 deletions(-) (limited to 'packages/website/ts/pages/documentation') diff --git a/packages/website/ts/pages/documentation/home.tsx b/packages/website/ts/pages/documentation/home.tsx index 72e507a7b..7c0bf433e 100644 --- a/packages/website/ts/pages/documentation/home.tsx +++ b/packages/website/ts/pages/documentation/home.tsx @@ -5,6 +5,7 @@ import { Link, LinkType, MarkdownLinkBlock, + NestedSidebarMenu, utils as sharedUtils, } from '@0xproject/react-shared'; import { ObjectMap } from '@0xproject/types'; @@ -425,6 +426,7 @@ export class Home extends React.Component { pkg => pkg.link, ), }; + console.log('sectionNameToLinks', sectionNameToLinks); return ( { onMouseLeave={this._onSidebarHover.bind(this, false)} onWheel={this._throttledSidebarScrolling} > - {this._renderMenu(sectionNameToLinks)} + + + { ); } - private _renderMenu(sectionNameToLinks: ObjectMap): React.ReactNode { - const navigation = _.map(sectionNameToLinks, (links: ALink[], sectionName: string) => { - // tslint:disable-next-line:no-unused-variable - return ( -
-
- {sectionName.toUpperCase()} -
- {this._renderMenuItems(links)} -
- ); - }); - return ( - - {navigation} - - ); - } - private _renderMenuItems(links: ALink[]): React.ReactNode { - const menuItems = _.map(links, link => { - return ( -
- - - {link.title} - - -
- ); - }); - return menuItems; - } private _renderPackageCategory(category: string, pkgs: Package[]): React.ReactNode { return (
-- cgit v1.2.3