Added disabled attribute to DropDown

This commit is contained in:
Philipp Czora
2019-01-09 09:34:15 +01:00
parent a03d038309
commit 51f3bc3f73

View File

@@ -7,17 +7,19 @@ type Props = {
options: string[], options: string[],
optionSelected: string => void, optionSelected: string => void,
preselectedOption?: string, preselectedOption?: string,
className: any className: any,
disabled?: boolean
}; };
class DropDown extends React.Component<Props> { class DropDown extends React.Component<Props> {
render() { render() {
const { options, preselectedOption, className } = this.props; const { options, preselectedOption, className, disabled } = this.props;
return ( return (
<div className={classNames(className, "select")}> <div className={classNames(className, "select")}>
<select <select
value={preselectedOption ? preselectedOption : ""} value={preselectedOption ? preselectedOption : ""}
onChange={this.change} onChange={this.change}
disabled={disabled}
> >
<option key="" /> <option key="" />
{options.map(option => { {options.map(option => {