Dropdowns are now standalone class

This commit is contained in:
Serhat
2020-10-27 17:59:45 +03:00
parent 4cb5d1eaae
commit cc5fa542e1
4 changed files with 65 additions and 33 deletions

View File

@@ -0,0 +1,20 @@
import React from 'react';
export default class Dropdown extends React.PureComponent {
getLabel() {
return this.props.label ? <label htmlFor={this.props.name}>{this.props.label} </label> : null;
}
render() {
return (
<>
{this.getLabel()}
<div className='dropdown' style={{ display: 'inline' }}>
<select name={this.props.name} id={this.props.id} onChange={this.props.onChange}>
{this.props.children}
</select>
</div>
</>
);
}
}