various styling fixes

This commit is contained in:
Thomas Ruoff
2017-02-21 00:30:36 +01:00
parent b75ce5ceb1
commit 33f5abcd30
8 changed files with 132 additions and 38 deletions

View File

@@ -0,0 +1,27 @@
import { h } from 'preact';
export default (props) => {
const { options = [] } = props;
const optionsMarkup = options.map(option => {
return (
<option
label={option.name}
value={option.value}
selected={props.value === option.value}
/>
);
});
return (
<label>
{props.text}:
<select
class={props.name}
onchange={props.onchange.bind(null, props.name)}
>
{optionsMarkup}
</select>
</label>
);
}