From f8b8a10b8f914d05edfbc57081a40dccc8f464de Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 6 Mar 2018 20:38:45 +0100 Subject: Make sidebar header configurable --- .../src/ts/components/nested_sidebar_menu.tsx | 36 ++-------------------- 1 file changed, 2 insertions(+), 34 deletions(-) (limited to 'packages/react-shared/src') diff --git a/packages/react-shared/src/ts/components/nested_sidebar_menu.tsx b/packages/react-shared/src/ts/components/nested_sidebar_menu.tsx index 2506124af..f907022d6 100644 --- a/packages/react-shared/src/ts/components/nested_sidebar_menu.tsx +++ b/packages/react-shared/src/ts/components/nested_sidebar_menu.tsx @@ -13,7 +13,7 @@ import { VersionDropDown } from './version_drop_down'; export interface NestedSidebarMenuProps { topLevelMenu: { [topLevel: string]: string[] }; menuSubsectionsBySection: MenuSubsectionsBySection; - title: string; + sidebarHeader?: React.ReactNode; shouldDisplaySectionHeaders?: boolean; onMenuItemClick?: () => void; selectedVersion?: string; @@ -37,13 +37,6 @@ const styles: Styles = { }, }; -const titleToIcon: { [title: string]: string } = { - '0x.js': 'zeroExJs.png', - '0x Connect': 'connect.png', - '0x Smart Contracts': 'contracts.png', - Wiki: 'wiki.png', -}; - export class NestedSidebarMenu extends React.Component { public static defaultProps: Partial = { shouldDisplaySectionHeaders: true, @@ -68,7 +61,7 @@ export class NestedSidebarMenu extends React.Component - {this._renderEmblem()} + {this.props.sidebarHeader} {!_.isUndefined(this.props.versions) && !_.isUndefined(this.props.selectedVersion) && ( @@ -77,31 +70,6 @@ export class NestedSidebarMenu extends React.Component ); } - private _renderEmblem() { - return ( -
-
-
- 0x -
-
- docs -
-
-
- | -
-
-
- -
-
- {this.props.title} -
-
-
- ); - } private _renderMenuItems(menuItemNames: string[]): React.ReactNode[] { const menuItemStyles = this.props.shouldDisplaySectionHeaders ? styles.menuItemWithHeaders -- cgit v1.2.3