From e5bbde90b491d086fd5441186a5127ea717be4bf Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 11 Aug 2020 22:51:51 +0200 Subject: [PATCH] remove multipleDays choice --- components/dateSelect.js | 136 +++++++++++++-------------------------- context/wizardStore.js | 1 - 2 files changed, 45 insertions(+), 92 deletions(-) diff --git a/components/dateSelect.js b/components/dateSelect.js index 5e01ace..8958a40 100644 --- a/components/dateSelect.js +++ b/components/dateSelect.js @@ -55,7 +55,6 @@ export default function DateSelect() { toRef.current?.getInput().focus() }, [range.from]) - const { multipleDays } = state.formData const { from, to } = range const disabledDays = [dayDisabled] const modifiers = { @@ -74,100 +73,55 @@ export default function DateSelect() { } return ( - <> - - - Willst du einen odere mehrere Tage buchen? - - { - //setFocusedInput(null) - onChange({ - multipleDays: false, - startDate: null, - endDate: null, - }) + + + Datum + + + setRange({ ...range, from })} /> - { - //setFocusedInput(null) - onChange({ - multipleDays: true, - startDate: null, - endDate: null, - }) + bis + setRange({ ...range, to })} /> + - {multipleDays !== null && ( - - - Datum - - { - <> - - setRange({ ...range, from })} - /> - bis - setRange({ ...range, to })} - /> - - - - } - - )} - + ) } diff --git a/context/wizardStore.js b/context/wizardStore.js index ab386e6..724ed8f 100644 --- a/context/wizardStore.js +++ b/context/wizardStore.js @@ -63,7 +63,6 @@ const initialState = { postDataError: null, postDataSuccess: null, formData: { - multipleDays: true, //startDate: '2020-08-10', //endDate: '2020-08-17', //purpose: 'Sommerlager 2021',