add appStore and use router for booking

This commit is contained in:
Thomas Ruoff
2020-08-19 00:59:45 +02:00
parent 194ac0aca1
commit e1d1de469b
8 changed files with 80 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
import React, { useContext, useState, useRef, useEffect } from 'react'
import useSWR from 'swr'
import { WizardContext } from '../context/wizardStore'
import { AppContext } from '../context/appStore'
import { DateUtils } from 'react-day-picker'
import DayPickerInput from 'react-day-picker/DayPickerInput'
@@ -19,7 +19,7 @@ import 'moment/locale/de'
const fetcher = (path) => fetch(path).then((r) => r.json())
export default function DateSelect() {
const { state, onChange } = useContext(WizardContext)
const { state, onChange } = useContext(AppContext)
const [range, setRange] = useState({
form: state.startDate && new Date(state.startDate),
to: state.endDate && new Date(state.endDate),