diff options
author | Fabio Berger <me@fabioberger.com> | 2018-10-13 23:29:14 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-10-13 23:29:14 +0800 |
commit | 6baadc746e35724ec4193e9afa01cd17e836372c (patch) | |
tree | 16e53b4fda0413a59d002b61d828e29a42b05128 /packages/react-shared | |
parent | e0e011eb668a13c25cb5dc64256f89d07e9cbe15 (diff) | |
download | dexon-0x-contracts-6baadc746e35724ec4193e9afa01cd17e836372c.tar dexon-0x-contracts-6baadc746e35724ec4193e9afa01cd17e836372c.tar.gz dexon-0x-contracts-6baadc746e35724ec4193e9afa01cd17e836372c.tar.bz2 dexon-0x-contracts-6baadc746e35724ec4193e9afa01cd17e836372c.tar.lz dexon-0x-contracts-6baadc746e35724ec4193e9afa01cd17e836372c.tar.xz dexon-0x-contracts-6baadc746e35724ec4193e9afa01cd17e836372c.tar.zst dexon-0x-contracts-6baadc746e35724ec4193e9afa01cd17e836372c.zip |
Implement new version dropdown and remove it from nestedTopBar
Diffstat (limited to 'packages/react-shared')
-rw-r--r-- | packages/react-shared/src/components/nested_sidebar_menu.tsx | 16 | ||||
-rw-r--r-- | packages/react-shared/src/components/version_drop_down.tsx | 37 |
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); - } -} |