diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-08-29 09:08:06 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-08-29 09:08:06 +0800 |
commit | 68af0e9eb70151704098350f99437f92639de753 (patch) | |
tree | c2ee9574e635acec39f9157e2ea7219eb9a94a3a /packages | |
parent | a18d0f62298de76a2c6cd503e457123221d6bf9a (diff) | |
download | dexon-sol-tools-68af0e9eb70151704098350f99437f92639de753.tar dexon-sol-tools-68af0e9eb70151704098350f99437f92639de753.tar.gz dexon-sol-tools-68af0e9eb70151704098350f99437f92639de753.tar.bz2 dexon-sol-tools-68af0e9eb70151704098350f99437f92639de753.tar.lz dexon-sol-tools-68af0e9eb70151704098350f99437f92639de753.tar.xz dexon-sol-tools-68af0e9eb70151704098350f99437f92639de753.tar.zst dexon-sol-tools-68af0e9eb70151704098350f99437f92639de753.zip |
Change VersionDropDown to use material-ui 3
Diffstat (limited to 'packages')
-rw-r--r-- | packages/react-shared/package.json | 1 | ||||
-rw-r--r-- | packages/react-shared/src/components/version_drop_down.tsx | 15 |
2 files changed, 8 insertions, 8 deletions
diff --git a/packages/react-shared/package.json b/packages/react-shared/package.json index f341619d2..57aa9d51d 100644 --- a/packages/react-shared/package.json +++ b/packages/react-shared/package.json @@ -33,6 +33,7 @@ "typescript": "3.0.1" }, "dependencies": { + "@material-ui/core": "^3.0.1", "@types/is-mobile": "0.3.0", "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", diff --git a/packages/react-shared/src/components/version_drop_down.tsx b/packages/react-shared/src/components/version_drop_down.tsx index e41590957..e4a2798ab 100644 --- a/packages/react-shared/src/components/version_drop_down.tsx +++ b/packages/react-shared/src/components/version_drop_down.tsx @@ -1,6 +1,6 @@ +import MenuItem from '@material-ui/core/MenuItem'; +import Select from '@material-ui/core/Select'; import * as _ from 'lodash'; -import DropDownMenu from 'material-ui/DropDownMenu'; -import MenuItem from 'material-ui/MenuItem'; import * as React from 'react'; export interface VersionDropDownProps { @@ -15,23 +15,22 @@ export class VersionDropDown extends React.Component<VersionDropDownProps, Versi public render(): React.ReactNode { return ( <div className="mx-auto" style={{ width: 120 }}> - <DropDownMenu - maxHeight={300} + <Select value={this.props.selectedVersion} onChange={this._updateSelectedVersion.bind(this)} > {this._renderDropDownItems()} - </DropDownMenu> + </Select> </div> ); } private _renderDropDownItems(): React.ReactNode[] { const items = _.map(this.props.versions, version => { - return <MenuItem key={version} value={version} primaryText={`v${version}`} />; + return <MenuItem key={version} value={version}>v{version}</MenuItem>; }); return items; } - private _updateSelectedVersion(_e: any, _index: number, semver: string): void { - this.props.onVersionSelected(semver); + private _updateSelectedVersion(event: React.ChangeEvent<HTMLSelectElement>): void { + this.props.onVersionSelected(event.target.value); } } |