Select city on canvas
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { Accessor, Component, Setter } from "solid-js";
|
||||
|
||||
import { weatherField } from "../consts";
|
||||
|
||||
export const SelectField: Component<{
|
||||
getField: Accessor<string>,
|
||||
setField: Setter<string>,
|
||||
}> = (props) => {
|
||||
return (
|
||||
<select onChange={(e) => props.setField(e.target.value)}>
|
||||
{ weatherField.map(field =>
|
||||
<option
|
||||
value={field}
|
||||
selected={field === props.getField() ? true : false}
|
||||
>{field}</option>
|
||||
)}
|
||||
</select>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user