mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 14:37:13 +01:00
32 lines
836 B
JavaScript
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>
|
|
)
|
|
}
|