mirror of https://github.com/franjsco/tick3t
add dropdown component
This commit is contained in:
parent
39f5fb503c
commit
164c055e7c
|
@ -0,0 +1,33 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Input } from 'reactstrap';
|
||||
|
||||
|
||||
class DropDown extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
render() {
|
||||
let options = this.props.options;
|
||||
options = options.map((opt) => {
|
||||
return <option key={opt.id} value={opt.id}>{opt.value}</option>
|
||||
});
|
||||
console.log('reh');
|
||||
|
||||
return(
|
||||
<Input
|
||||
name = "type"
|
||||
type = "select"
|
||||
value = { this.props.type }
|
||||
onChange = { this.props.handleInputChange }
|
||||
>
|
||||
<option value="">---</option>
|
||||
{ options }
|
||||
</Input>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default DropDown;
|
Loading…
Reference in New Issue