aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-shared
diff options
context:
space:
mode:
Diffstat (limited to 'packages/react-shared')
-rw-r--r--packages/react-shared/src/components/nested_sidebar_menu.tsx16
-rw-r--r--packages/react-shared/src/components/version_drop_down.tsx37
2 files changed, 0 insertions, 53 deletions
diff --git a/packages/react-shared/src/components/nested_sidebar_menu.tsx b/packages/react-shared/src/components/nested_sidebar_menu.tsx
index 85206569c..440db4b16 100644
--- a/packages/react-shared/src/components/nested_sidebar_menu.tsx
+++ b/packages/react-shared/src/components/nested_sidebar_menu.tsx
@@ -8,15 +8,11 @@ import { colors } from '../utils/colors';
import { utils } from '../utils/utils';
import { Link } from './link';
-import { VersionDropDown } from './version_drop_down';
export interface NestedSidebarMenuProps {
sectionNameToLinks: ObjectMap<ALink[]>;
sidebarHeader?: React.ReactNode;
shouldDisplaySectionHeaders?: boolean;
- selectedVersion?: string;
- versions?: string[];
- onVersionSelected?: (semver: string) => void;
shouldReformatMenuItemNames?: boolean;
}
@@ -59,21 +55,9 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
return <div key={`section-${sectionName}`}>{this._renderMenuItems(links)}</div>;
}
});
- const maxWidthWithScrollbar = 307;
return (
<div>
{this.props.sidebarHeader}
- {!_.isUndefined(this.props.versions) &&
- !_.isUndefined(this.props.selectedVersion) &&
- !_.isUndefined(this.props.onVersionSelected) && (
- <div style={{ maxWidth: maxWidthWithScrollbar }}>
- <VersionDropDown
- selectedVersion={this.props.selectedVersion}
- versions={this.props.versions}
- onVersionSelected={this.props.onVersionSelected}
- />
- </div>
- )}
<div className="pl1">{navigation}</div>
</div>
);
diff --git a/packages/react-shared/src/components/version_drop_down.tsx b/packages/react-shared/src/components/version_drop_down.tsx
deleted file mode 100644
index 5ff4bed54..000000000
--- a/packages/react-shared/src/components/version_drop_down.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import MenuItem from '@material-ui/core/MenuItem';
-import Select from '@material-ui/core/Select';
-import * as _ from 'lodash';
-import * as React from 'react';
-
-export interface VersionDropDownProps {
- selectedVersion: string;
- versions: string[];
- onVersionSelected: (semver: string) => void;
-}
-
-export interface VersionDropDownState {}
-
-export class VersionDropDown extends React.Component<VersionDropDownProps, VersionDropDownState> {
- public render(): React.ReactNode {
- return (
- <div className="mx-auto" style={{ width: 120 }}>
- <Select value={this.props.selectedVersion} onChange={this._updateSelectedVersion.bind(this)}>
- {this._renderDropDownItems()}
- </Select>
- </div>
- );
- }
- private _renderDropDownItems(): React.ReactNode[] {
- const items = _.map(this.props.versions, version => {
- return (
- <MenuItem key={version} value={version}>
- v{version}
- </MenuItem>
- );
- });
- return items;
- }
- private _updateSelectedVersion(event: React.ChangeEvent<HTMLSelectElement>): void {
- this.props.onVersionSelected(event.target.value);
- }
-}