move storing data to booking page

This commit is contained in:
Thomas Ruoff
2020-08-20 00:30:47 +02:00
parent e1d1de469b
commit 3a5f5b3204
2 changed files with 5 additions and 34 deletions

View File

@@ -8,42 +8,12 @@ import Contact from './contact'
//import Driver from './driver'
export default function Wizard() {
const { onSubmit, state, storeData, forgetData } = useContext(AppContext)
const {
postData,
postDataSuccess,
postDataError,
dataStored,
dataStoredLoaded,
} = state
const { onSubmit, state, forgetData } = useContext(AppContext)
const { postData, postDataSuccess, postDataError, dataStoredLoaded } = state
if (postDataSuccess) {
return (
<>
<h3>Danke, die Buchung ist in Bearbeitung!</h3>
<p>Nach Prüfung bestätigen wir die Buchung bald per E-Mail!</p>
{!dataStoredLoaded && typeof dataStored !== 'boolean' && (
<>
<p>
Sollen die eingegebenen Daten in <strong>Deinem Browser</strong>{' '}
für die nächste Buchung gespeichert werden?
</p>
<button onClick={() => storeData(true)} className="btn btn-blue">
Ja, bitte speichern
</button>
<button
onClick={() => storeData(false)}
className="btn btn-grey ml-2"
>
Nein danke
</button>
</>
)}
{dataStored === true && (
<p>Ok, die Daten wurden für die nächste Buchung gespeichert.</p>
)}
</>
)
// /booking/[id] takes over
return null
}
return (