mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
Added DropDown.js
This commit is contained in:
25
scm-ui/src/changesets/components/DropDown.js
Normal file
25
scm-ui/src/changesets/components/DropDown.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// @flow
|
||||
|
||||
import React from "react";
|
||||
|
||||
type Props = {
|
||||
options: string[],
|
||||
optionSelected: string => void
|
||||
}
|
||||
|
||||
class DropDown extends React.Component<Props> {
|
||||
render() {
|
||||
const {options} = this.props;
|
||||
return <select onChange={this.change}>
|
||||
{options.map(option => {
|
||||
return <option key={option} value={option}>{option}</option>
|
||||
})}
|
||||
</select>
|
||||
}
|
||||
|
||||
change = (event) => {
|
||||
this.props.optionSelected(event.target.value);
|
||||
}
|
||||
}
|
||||
|
||||
export default DropDown;
|
||||
Reference in New Issue
Block a user