aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-shared
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-07 03:38:45 +0800
committerFabio Berger <me@fabioberger.com>2018-03-07 03:38:45 +0800
commitf8b8a10b8f914d05edfbc57081a40dccc8f464de (patch)
tree277df02560666e6bdf8a2c3b644ef5b720c5ea54 /packages/react-shared
parent01e505a5f4b514d285eedc6456d819d0649032d4 (diff)
downloaddexon-sol-tools-f8b8a10b8f914d05edfbc57081a40dccc8f464de.tar
dexon-sol-tools-f8b8a10b8f914d05edfbc57081a40dccc8f464de.tar.gz
dexon-sol-tools-f8b8a10b8f914d05edfbc57081a40dccc8f464de.tar.bz2
dexon-sol-tools-f8b8a10b8f914d05edfbc57081a40dccc8f464de.tar.lz
dexon-sol-tools-f8b8a10b8f914d05edfbc57081a40dccc8f464de.tar.xz
dexon-sol-tools-f8b8a10b8f914d05edfbc57081a40dccc8f464de.tar.zst
dexon-sol-tools-f8b8a10b8f914d05edfbc57081a40dccc8f464de.zip
Make sidebar header configurable
Diffstat (limited to 'packages/react-shared')
-rw-r--r--packages/react-shared/src/ts/components/nested_sidebar_menu.tsx36
1 files changed, 2 insertions, 34 deletions
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<NestedSidebarMenuProps, NestedSidebarMenuState> {
public static defaultProps: Partial<NestedSidebarMenuProps> = {
shouldDisplaySectionHeaders: true,
@@ -68,7 +61,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
});
return (
<div>
- {this._renderEmblem()}
+ {this.props.sidebarHeader}
{!_.isUndefined(this.props.versions) &&
!_.isUndefined(this.props.selectedVersion) && (
<VersionDropDown selectedVersion={this.props.selectedVersion} versions={this.props.versions} />
@@ -77,31 +70,6 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
</div>
);
}
- private _renderEmblem() {
- return (
- <div className="pt2 md-px1 sm-px2" style={{ color: colors.black, paddingBottom: 18 }}>
- <div className="flex" style={{ fontSize: 25 }}>
- <div className="robotoMono" style={{ fontWeight: 'bold' }}>
- 0x
- </div>
- <div className="pl2" style={{ lineHeight: 1.4, fontWeight: 300 }}>
- docs
- </div>
- </div>
- <div className="pl1" style={{ color: colors.grey350, paddingBottom: 9, paddingLeft: 10, height: 17 }}>
- |
- </div>
- <div className="flex">
- <div>
- <img src={`/images/doc_icons/${titleToIcon[this.props.title]}`} width="22" />
- </div>
- <div className="pl1" style={{ fontWeight: 600, fontSize: 20, lineHeight: 1.2 }}>
- {this.props.title}
- </div>
- </div>
- </div>
- );
- }
private _renderMenuItems(menuItemNames: string[]): React.ReactNode[] {
const menuItemStyles = this.props.shouldDisplaySectionHeaders
? styles.menuItemWithHeaders