mirror of
https://github.com/franjsco/tick3t
synced 2025-06-05 22:19:18 +02:00
add dropdown component
This commit is contained in:
33
src/components/DropDown.js
Normal file
33
src/components/DropDown.js
Normal file
@@ -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;
|
Reference in New Issue
Block a user