Introduced dumb BranchSelector; moved fetching of branches to BranchRoot

This commit is contained in:
Philipp Czora
2018-10-16 17:04:28 +02:00
parent 53fe671a27
commit e6fb2a8de7
7 changed files with 275 additions and 125 deletions

View File

@@ -5,7 +5,7 @@ import React from "react";
type Props = {
options: string[],
optionSelected: string => void,
preselectedOption: string
preselectedOption?: string
};
class DropDown extends React.Component<Props> {
@@ -13,7 +13,10 @@ class DropDown extends React.Component<Props> {
const { options, preselectedOption } = this.props;
return (
<div className="select">
<select value={preselectedOption} onChange={this.change}>
<select
value={preselectedOption ? preselectedOption : ""}
onChange={this.change}
>
<option key="" />
{options.map(option => {
return (
@@ -27,7 +30,7 @@ class DropDown extends React.Component<Props> {
);
}
change = event => {
change = (event: Event) => {
this.props.optionSelected(event.target.value);
};
}