mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-22 07:48:30 +00:00
40 lines
727 B
JavaScript
40 lines
727 B
JavaScript
// @flow
|
|
import React from 'react';
|
|
import SimpleDropDown from 'components/ui/SimpleDropDown';
|
|
|
|
type UnitDropdownProps = {
|
|
value: string,
|
|
options: string[],
|
|
onChange?: (value: string) => void
|
|
};
|
|
|
|
export default class UnitDropdown extends React.Component {
|
|
props: UnitDropdownProps;
|
|
|
|
state: {
|
|
expanded: boolean
|
|
} = {
|
|
expanded: false
|
|
};
|
|
|
|
render() {
|
|
const { value, options } = this.props;
|
|
|
|
return (
|
|
<div className="input-group-btn">
|
|
<SimpleDropDown
|
|
value={value}
|
|
onChange={this.onChange}
|
|
options={options}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
onChange = (value: string) => {
|
|
if (this.props.onChange) {
|
|
this.props.onChange(value);
|
|
}
|
|
};
|
|
}
|