Files
pfadi-bussle/components/rangeSelect.js
2020-07-01 00:25:36 +02:00

32 lines
836 B
JavaScript

import { useContext } from 'react'
import { AppContext, ACTIONS } from '../context/appStore'
export default function RangeSelect() {
const { state, dispatch } = useContext(AppContext)
return (
<div>
Ich will das Bussle für
<input
type="radio"
id="single"
name="days"
checked={state.multipleDays === false}
onChange={() =>
dispatch({ type: ACTIONS.SET_MULTIPLE_DAYS, payload: false })
}
/>
<label htmlFor="single">einen Tag</label>
<input
type="radio"
id="multiple"
name="days"
checked={state.multipleDays === true}
onChange={() =>
dispatch({ type: ACTIONS.SET_MULTIPLE_DAYS, payload: true })
}
/>
<label htmlFor="multiple">mehrere Tage</label> mieten
</div>
)
}