mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
Introduced dumb BranchSelector; moved fetching of branches to BranchRoot
This commit is contained in:
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user