aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-shared
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-12 21:54:44 +0800
committerFabio Berger <me@fabioberger.com>2018-10-12 21:54:44 +0800
commitde20ef1a49966153f25236ee68b186cd49f8dc20 (patch)
tree6313477ff212da20b9d4dbcb27fb39a2dd4ff0d1 /packages/react-shared
parentdcdc411ab73c860d58a47a9b721d8047e68ce738 (diff)
downloaddexon-sol-tools-de20ef1a49966153f25236ee68b186cd49f8dc20.tar
dexon-sol-tools-de20ef1a49966153f25236ee68b186cd49f8dc20.tar.gz
dexon-sol-tools-de20ef1a49966153f25236ee68b186cd49f8dc20.tar.bz2
dexon-sol-tools-de20ef1a49966153f25236ee68b186cd49f8dc20.tar.lz
dexon-sol-tools-de20ef1a49966153f25236ee68b186cd49f8dc20.tar.xz
dexon-sol-tools-de20ef1a49966153f25236ee68b186cd49f8dc20.tar.zst
dexon-sol-tools-de20ef1a49966153f25236ee68b186cd49f8dc20.zip
Refactor Home so that Dev section chrome is reusable across pages
Diffstat (limited to 'packages/react-shared')
-rw-r--r--packages/react-shared/src/components/nested_sidebar_menu.tsx38
1 files changed, 0 insertions, 38 deletions
diff --git a/packages/react-shared/src/components/nested_sidebar_menu.tsx b/packages/react-shared/src/components/nested_sidebar_menu.tsx
index 5b6076df6..f3ce5f5bf 100644
--- a/packages/react-shared/src/components/nested_sidebar_menu.tsx
+++ b/packages/react-shared/src/components/nested_sidebar_menu.tsx
@@ -12,7 +12,6 @@ import { VersionDropDown } from './version_drop_down';
export interface NestedSidebarMenuProps {
sectionNameToLinks: ObjectMap<ALink[]>;
- subsectionNameToLinks?: ObjectMap<ALink[]>;
sidebarHeader?: React.ReactNode;
shouldDisplaySectionHeaders?: boolean;
onMenuItemClick?: () => void;
@@ -44,7 +43,6 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
shouldDisplaySectionHeaders: true,
onMenuItemClick: _.noop.bind(_),
shouldReformatMenuItemNames: true,
- subsectionNameToLinks: {},
};
public render(): React.ReactNode {
const navigation = _.map(this.props.sectionNameToLinks, (links: ALink[], sectionName: string) => {
@@ -108,47 +106,11 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
</span>
</MenuItem>
</Link>
- {this._renderMenuItemSubsections(link.title)}
</div>
);
});
return menuItems;
}
- private _renderMenuItemSubsections(menuItemName: string): React.ReactNode {
- if (
- _.isUndefined(this.props.subsectionNameToLinks) ||
- _.isUndefined(this.props.subsectionNameToLinks[menuItemName])
- ) {
- return null;
- }
- return this._renderSubsectionLinks(menuItemName, this.props.subsectionNameToLinks[menuItemName]);
- }
- private _renderSubsectionLinks(menuItemName: string, links: ALink[]): React.ReactNode {
- return (
- <ul style={{ margin: 0, listStyleType: 'none', paddingLeft: 0 }} key={menuItemName}>
- {_.map(links, link => {
- const name = `${menuItemName}-${link.title}`;
- return (
- <li key={`menuSubsectionItem-${name}`}>
- <Link to={link.to} shouldOpenInNewTab={link.shouldOpenInNewTab}>
- <MenuItem
- style={{ minHeight: 35 }}
- innerDivStyle={{
- paddingLeft: 16,
- fontSize: 14,
- lineHeight: '35px',
- }}
- onClick={this._onMenuItemClick.bind(this)}
- >
- {link.title}
- </MenuItem>
- </Link>
- </li>
- );
- })}
- </ul>
- );
- }
private _onMenuItemClick(): void {
if (!_.isUndefined(this.props.onMenuItemClick)) {
this.props.onMenuItemClick();