mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
Boostrapped BranchChooser
This commit is contained in:
@@ -6,25 +6,30 @@ type Props = {
|
||||
options: string[],
|
||||
optionSelected: string => void,
|
||||
preselectedOption: string
|
||||
}
|
||||
};
|
||||
|
||||
class DropDown extends React.Component<Props> {
|
||||
render() {
|
||||
const {options, preselectedOption} = this.props;
|
||||
return <div className="select">
|
||||
<select value={preselectedOption} onChange={this.change}>
|
||||
<option key=""></option>
|
||||
{options.map(option => {
|
||||
return <option key={option}
|
||||
value={option}>{option}</option>
|
||||
})}
|
||||
</select>
|
||||
</div>
|
||||
const { options, preselectedOption } = this.props;
|
||||
return (
|
||||
<div className="select">
|
||||
<select value={preselectedOption} onChange={this.change}>
|
||||
<option key="" />
|
||||
{options.map(option => {
|
||||
return (
|
||||
<option key={option} value={option}>
|
||||
{option}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
</select>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
change = (event) => {
|
||||
change = event => {
|
||||
this.props.optionSelected(event.target.value);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default DropDown;
|
||||
|
||||
Reference in New Issue
Block a user