mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
further hacking
This commit is contained in:
@@ -5,32 +5,47 @@ import Form from 'react-bootstrap/Form'
|
||||
import Col from 'react-bootstrap/Col'
|
||||
|
||||
export default function Contact() {
|
||||
const { state, dispatch } = useContext(WizardContext)
|
||||
const { state } = useContext(WizardContext)
|
||||
|
||||
const { multipleDays, startDate, endDate } = state
|
||||
const { name, email, street, zip, city } = state
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Group>
|
||||
<Form.Label>Name</Form.Label>
|
||||
<Form.Control type="text" id="name" placeholder="Name" />
|
||||
<Form.Control type="text" id="name" placeholder="Name" value={name} />
|
||||
</Form.Group>
|
||||
<Form.Group>
|
||||
<Form.Label>E-Mail</Form.Label>
|
||||
<Form.Control type="email" id="email" placeholder="E-Mail" />
|
||||
<Form.Control
|
||||
type="email"
|
||||
id="email"
|
||||
placeholder="E-Mail"
|
||||
value={email}
|
||||
/>
|
||||
</Form.Group>
|
||||
<Form.Group>
|
||||
<Form.Label>Straße</Form.Label>
|
||||
<Form.Control type="text" id="street" placeholder="Straße" />
|
||||
<Form.Control
|
||||
type="text"
|
||||
id="street"
|
||||
placeholder="Straße"
|
||||
value={street}
|
||||
/>
|
||||
</Form.Group>
|
||||
<Form.Row>
|
||||
<Form.Group as={Col} xs={4}>
|
||||
<Form.Label>PLZ</Form.Label>
|
||||
<Form.Control type="text" id="plz" placeholder="PLZ" />
|
||||
<Form.Control type="text" id="plz" placeholder="PLZ" value={zip} />
|
||||
</Form.Group>
|
||||
<Form.Group as={Col}>
|
||||
<Form.Label>Stadt</Form.Label>
|
||||
<Form.Control type="text" id="city" placeholder="Stadt" />
|
||||
<Form.Control
|
||||
type="text"
|
||||
id="city"
|
||||
placeholder="Stadt"
|
||||
value={city}
|
||||
/>
|
||||
</Form.Group>
|
||||
</Form.Row>
|
||||
</>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useContext } from 'react'
|
||||
import useSWR, { SWRConfig } from 'swr'
|
||||
import useSWR from 'swr'
|
||||
|
||||
import { WizardContext, ACTIONS } from '../context/wizardStore'
|
||||
|
||||
@@ -18,14 +18,7 @@ export default function DateSelect() {
|
||||
fetcher
|
||||
)
|
||||
|
||||
const {
|
||||
multipleDays,
|
||||
startDate,
|
||||
endDate,
|
||||
focusedInput,
|
||||
pickupTime,
|
||||
dropoffTime,
|
||||
} = state
|
||||
const { multipleDays, startDate, endDate, focusedInput } = state
|
||||
|
||||
function isDayBlocked(momentDay) {
|
||||
return (
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
export default function Driver({}) {
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<label htmlFor="driver1">Fahrer 1</label>
|
||||
<input id="driver1" name="driver1" type="text" />
|
||||
<label htmlFor="driver">Alter</label>
|
||||
<input id="ageDriver1" name="ageDriver1" type="number" min="20" />
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="driver">Fahrer 2</label>
|
||||
<input id="driver2" name="driver2" type="text" />
|
||||
<label htmlFor="driver">Alter</label>
|
||||
<input id="ageDriver2" name="ageDriver2" type="number" min="20" />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -2,26 +2,35 @@ import { useContext } from 'react'
|
||||
import { WizardContext, ACTIONS } from '../context/wizardStore'
|
||||
|
||||
import Form from 'react-bootstrap/Form'
|
||||
import Col from 'react-bootstrap/Col'
|
||||
|
||||
export default function Contact() {
|
||||
const { state, dispatch } = useContext(WizardContext)
|
||||
const { state } = useContext(WizardContext)
|
||||
|
||||
const { multipleDays, startDate, endDate } = state
|
||||
const { purpose, destination, org } = state
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Group>
|
||||
<Form.Label>Zweck der Fahrt</Form.Label>
|
||||
<Form.Control type="text" id="purpose" placeholder="Zweck der Fahrt" />
|
||||
<Form.Control
|
||||
type="text"
|
||||
id="purpose"
|
||||
placeholder="Zweck der Fahrt"
|
||||
value={purpose}
|
||||
/>
|
||||
</Form.Group>
|
||||
<Form.Group>
|
||||
<Form.Label>Verein</Form.Label>
|
||||
<Form.Control type="text" id="org" placeholder="Verein" />
|
||||
<Form.Control type="text" id="org" placeholder="Verein" value={org} />
|
||||
</Form.Group>
|
||||
<Form.Group>
|
||||
<Form.Label>Ziel der Fahrt</Form.Label>
|
||||
<Form.Control type="text" id="destination" placeholder="Fahrtziel" />
|
||||
<Form.Control
|
||||
type="text"
|
||||
id="destination"
|
||||
placeholder="Fahrtziel"
|
||||
value={destination}
|
||||
/>
|
||||
</Form.Group>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -23,6 +23,8 @@ function WizardInternal() {
|
||||
const isFirstStep = currentStep === 0
|
||||
const isLastStep = currentStep === STEPS.length - 1
|
||||
|
||||
const CurrentStepComponent = STEPS[currentStep].component
|
||||
|
||||
return (
|
||||
<Form
|
||||
onSubmit={(event) => {
|
||||
@@ -41,9 +43,7 @@ function WizardInternal() {
|
||||
onSubmit()
|
||||
}}
|
||||
>
|
||||
{STEPS.map(({ id, component: Component }, index) => (
|
||||
<>{currentStep === index && <Component />}</>
|
||||
))}
|
||||
<CurrentStepComponent />
|
||||
{!isFirstStep && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
|
||||
Reference in New Issue
Block a user