feat: add phone input handling for company and personal profile forms
This commit is contained in:
parent
f1ddba461a
commit
cb14d26de8
@ -272,6 +272,12 @@ export default function CompanyAdditionalInformationPage() {
|
||||
setError('')
|
||||
}
|
||||
|
||||
const handlePhoneInput = (e: React.FormEvent<HTMLInputElement>) => {
|
||||
const { name, value } = e.currentTarget
|
||||
setForm(p => ({ ...p, [name]: value }))
|
||||
setError('')
|
||||
}
|
||||
|
||||
const validate = () => {
|
||||
const required: (keyof CompanyProfileData)[] = [
|
||||
'companyName','companyEmail','companyPhone','contactPersonName','contactPersonPhone',
|
||||
@ -540,6 +546,7 @@ export default function CompanyAdditionalInformationPage() {
|
||||
name="companyPhone"
|
||||
value={form.companyPhone}
|
||||
onChange={handleChange}
|
||||
onInput={handlePhoneInput}
|
||||
placeholder="e.g. +43 1 234567"
|
||||
ref={companyPhoneRef}
|
||||
required
|
||||
@ -565,6 +572,7 @@ export default function CompanyAdditionalInformationPage() {
|
||||
name="contactPersonPhone"
|
||||
value={form.contactPersonPhone}
|
||||
onChange={handleChange}
|
||||
onInput={handlePhoneInput}
|
||||
placeholder="e.g. +43 676 1234567"
|
||||
ref={contactPhoneRef}
|
||||
required
|
||||
@ -696,6 +704,7 @@ export default function CompanyAdditionalInformationPage() {
|
||||
name="secondPhone"
|
||||
value={form.secondPhone}
|
||||
onChange={handleChange}
|
||||
onInput={handlePhoneInput}
|
||||
placeholder="+49 123 456 7890"
|
||||
ref={secondPhoneRef}
|
||||
/>
|
||||
@ -720,6 +729,7 @@ export default function CompanyAdditionalInformationPage() {
|
||||
name="emergencyPhone"
|
||||
value={form.emergencyPhone}
|
||||
onChange={handleChange}
|
||||
onInput={handlePhoneInput}
|
||||
placeholder="+49 123 456 7890"
|
||||
ref={emergencyPhoneRef}
|
||||
/>
|
||||
|
||||
@ -276,6 +276,12 @@ export default function PersonalAdditionalInformationPage() {
|
||||
setError('')
|
||||
}
|
||||
|
||||
const handlePhoneInput = (e: React.FormEvent<HTMLInputElement>) => {
|
||||
const { name, value } = e.currentTarget
|
||||
setForm(p => ({ ...p, [name]: value }))
|
||||
setError('')
|
||||
}
|
||||
|
||||
const validateDateOfBirth = (dob: string) => {
|
||||
if (!dob) return false
|
||||
|
||||
@ -620,6 +626,7 @@ export default function PersonalAdditionalInformationPage() {
|
||||
name="phone"
|
||||
value={form.phone}
|
||||
onChange={handleChange}
|
||||
onInput={handlePhoneInput}
|
||||
placeholder="e.g. +43 676 1234567"
|
||||
ref={phoneRef}
|
||||
required
|
||||
@ -753,6 +760,7 @@ export default function PersonalAdditionalInformationPage() {
|
||||
name="secondPhone"
|
||||
value={form.secondPhone}
|
||||
onChange={handleChange}
|
||||
onInput={handlePhoneInput}
|
||||
placeholder="+43 660 1234567"
|
||||
ref={secondPhoneRef}
|
||||
/>
|
||||
@ -777,6 +785,7 @@ export default function PersonalAdditionalInformationPage() {
|
||||
name="emergencyPhone"
|
||||
value={form.emergencyPhone}
|
||||
onChange={handleChange}
|
||||
onInput={handlePhoneInput}
|
||||
placeholder="+43 660 1234567"
|
||||
ref={emergencyPhoneRef}
|
||||
/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user