mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 22:47:15 +01:00
improve client a bit
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useContext, useRef } from 'react'
|
||||
import { useContext } from 'react'
|
||||
|
||||
import Button from 'react-bootstrap/Button'
|
||||
import Form from 'react-bootstrap/Form'
|
||||
@@ -11,7 +11,23 @@ import Contact from './contact'
|
||||
//import Driver from './driver'
|
||||
|
||||
function WizardInternal() {
|
||||
const { state, storeBooking } = useContext(WizardContext)
|
||||
const { onSubmit, state } = useContext(WizardContext)
|
||||
const { postData, postDataSuccess, postDataError } = state
|
||||
|
||||
if (postDataSuccess) {
|
||||
return (
|
||||
<>
|
||||
<h3>Danke, die Buchung ist in Bearbeitung!</h3>
|
||||
<p>Wir melden uns per E-Mail sobald die Buchung bestätigt ist.</p>
|
||||
<p>
|
||||
Sollen die eingegebenen Daten in Deinem Browser für die nächste
|
||||
Buchung gespeichert werden?
|
||||
</p>
|
||||
<Button>Ja, bitte speichern</Button>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
const onChange = (payload) =>
|
||||
dispatch({ action: ACTIONS.SET_FORM_DATA, payload })
|
||||
|
||||
@@ -19,14 +35,16 @@ function WizardInternal() {
|
||||
<Form
|
||||
onSubmit={(event) => {
|
||||
event.preventDefault()
|
||||
|
||||
storeBooking()
|
||||
onSubmit()
|
||||
}}
|
||||
>
|
||||
<DateSelect />
|
||||
<Reason />
|
||||
<Contact />
|
||||
<Button type="submit">Absenden</Button>
|
||||
<div>{postDataError}</div>
|
||||
<Button type="submit" disabled={postData}>
|
||||
{postData ? 'Speichern...' : 'Absenden'}
|
||||
</Button>
|
||||
</Form>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user