feat(tradein/v2): replace mailto lead CTA with real form (#2377) #2393

Merged
lekss361 merged 1 commit from fix/tradein-2377-lead-form into main 2026-07-04 08:03:01 +00:00

1 commit

Author SHA1 Message Date
bot-backend
5adf94357e feat(tradein/v2): replace mailto lead CTA with real form (#2377)
All checks were successful
CI Trade-In / backend-tests (pull_request) Has been skipped
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI Trade-In / frontend-checks (pull_request) Successful in 1m6s
CI Trade-In / changes (pull_request) Successful in 8s
CI / changes (pull_request) Successful in 8s
CI / openapi-codegen-check (pull_request) Has been skipped
Real POST /api/v1/trade-in/lead form (phone + FZ-152 consent) in
HeroTransparency.tsx, replacing the mailto stub. Removed the
CONTACT_EMAIL/leadEnabled env-gate — form always renders.

Review fixup: the submit button was disabled whenever phone/consent
were invalid, which suppresses the native submit event entirely (both
click and Enter-key implicit submission) — the client-side validation
hint text was unreachable dead code, and users saw only a dimmed
button with no explanation. Submit is now only disabled while the
mutation is pending; invalid attempts fall through to the existing
handleLeadSubmit guard clause, which surfaces the phone hint via
leadTouched. aria-disabled communicates the visual state without
blocking the event.

Also guarded the error-message render against non-string mutation
errors (FastAPI 422 responses put a list in `detail`, which would
otherwise stringify to "[object Object]").
2026-07-04 10:38:53 +03:00