fix links and routes

This commit is contained in:
Eduard Heimbuch
2020-01-08 12:38:21 +01:00
parent 987436e335
commit 15a9a5b09b
6 changed files with 13 additions and 8 deletions

View File

@@ -13,10 +13,15 @@ type Props = {
class DropDown extends React.Component<Props> {
render() {
const { options, optionValues, preselectedOption, className, disabled } = this.props;
if (preselectedOption && !options.includes(preselectedOption)) {
options.unshift(preselectedOption)
}
return (
<div className={classNames(className, "select", disabled ? "disabled" : "")}>
<select value={preselectedOption ? preselectedOption : ""} onChange={this.change} disabled={disabled}>
<option key="" />
<option key={preselectedOption} />
{options.map((option, index) => {
return (
<option key={option} value={optionValues && optionValues[index] ? optionValues[index] : option}>