aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-shared
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-13 02:44:51 +0800
committerFabio Berger <me@fabioberger.com>2018-10-13 02:44:51 +0800
commita5eb346dd18f81b171280291f3d01b900a4aff1d (patch)
treebc35a1c6fe13f87c01dfbaffd6bf82789cea2c01 /packages/react-shared
parenta4604cb2f294f08318aa432b233571ae4e205fd5 (diff)
downloaddexon-sol-tools-a5eb346dd18f81b171280291f3d01b900a4aff1d.tar
dexon-sol-tools-a5eb346dd18f81b171280291f3d01b900a4aff1d.tar.gz
dexon-sol-tools-a5eb346dd18f81b171280291f3d01b900a4aff1d.tar.bz2
dexon-sol-tools-a5eb346dd18f81b171280291f3d01b900a4aff1d.tar.lz
dexon-sol-tools-a5eb346dd18f81b171280291f3d01b900a4aff1d.tar.xz
dexon-sol-tools-a5eb346dd18f81b171280291f3d01b900a4aff1d.tar.zst
dexon-sol-tools-a5eb346dd18f81b171280291f3d01b900a4aff1d.zip
fix: Remove unnecessary onClick prop from NestedSidebar, since one can listen to container element onClick
Diffstat (limited to 'packages/react-shared')
-rw-r--r--packages/react-shared/src/components/nested_sidebar_menu.tsx13
1 files changed, 1 insertions, 12 deletions
diff --git a/packages/react-shared/src/components/nested_sidebar_menu.tsx b/packages/react-shared/src/components/nested_sidebar_menu.tsx
index f3ce5f5bf..85206569c 100644
--- a/packages/react-shared/src/components/nested_sidebar_menu.tsx
+++ b/packages/react-shared/src/components/nested_sidebar_menu.tsx
@@ -14,7 +14,6 @@ export interface NestedSidebarMenuProps {
sectionNameToLinks: ObjectMap<ALink[]>;
sidebarHeader?: React.ReactNode;
shouldDisplaySectionHeaders?: boolean;
- onMenuItemClick?: () => void;
selectedVersion?: string;
versions?: string[];
onVersionSelected?: (semver: string) => void;
@@ -41,7 +40,6 @@ const styles: Styles = {
export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, NestedSidebarMenuState> {
public static defaultProps: Partial<NestedSidebarMenuProps> = {
shouldDisplaySectionHeaders: true,
- onMenuItemClick: _.noop.bind(_),
shouldReformatMenuItemNames: true,
};
public render(): React.ReactNode {
@@ -92,11 +90,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
return (
<div key={`menuItem-${finalMenuItemName}`}>
<Link to={link.to} shouldOpenInNewTab={link.shouldOpenInNewTab}>
- <MenuItem
- style={menuItemStyles}
- innerDivStyle={menuItemInnerDivStyles}
- onClick={this._onMenuItemClick.bind(this)}
- >
+ <MenuItem style={menuItemStyles} innerDivStyle={menuItemInnerDivStyles}>
<span
style={{
textTransform: this.props.shouldReformatMenuItemNames ? 'capitalize' : 'none',
@@ -111,9 +105,4 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
});
return menuItems;
}
- private _onMenuItemClick(): void {
- if (!_.isUndefined(this.props.onMenuItemClick)) {
- this.props.onMenuItemClick();
- }
- }
}