diff --git a/tradein-mvp/frontend/src/app/v2/page.tsx b/tradein-mvp/frontend/src/app/v2/page.tsx index 7b9160d5..8d3f4795 100644 --- a/tradein-mvp/frontend/src/app/v2/page.tsx +++ b/tradein-mvp/frontend/src/app/v2/page.tsx @@ -21,6 +21,7 @@ import HeroBar from "@/components/trade-in/v2/HeroBar"; import ParamsPanel from "@/components/trade-in/v2/ParamsPanel"; import ResultPanel from "@/components/trade-in/v2/ResultPanel"; import { ObjectSummary } from "@/components/trade-in/v2/ObjectSummary"; +import { LeadForm } from "@/components/trade-in/v2/LeadForm"; import { Footer } from "@/components/trade-in/v2/Footer"; import SectionOverlay from "@/components/trade-in/v2/SectionOverlay"; import { LocationDrawer } from "@/components/trade-in/v2/LocationDrawer"; @@ -928,6 +929,14 @@ export default function TradeInV2Page() { /> + + {/* Lead form (issue #2395 — v2-native mount of #2377's lead capture, + previously stranded in the dead HeroTransparency/HeroSummary tree). + Lives outside the scaled 1536×1024 artboard transform (in normal page + flow) so it stays legible at any viewport/scale instead of shrinking + with the HUD; only shown once a real, sufficient estimate is on + screen — never on the empty/insufficient-data states. */} + {hasEstimate && } ); } diff --git a/tradein-mvp/frontend/src/components/trade-in/v2/LeadForm.tsx b/tradein-mvp/frontend/src/components/trade-in/v2/LeadForm.tsx new file mode 100644 index 00000000..17e953d4 --- /dev/null +++ b/tradein-mvp/frontend/src/components/trade-in/v2/LeadForm.tsx @@ -0,0 +1,343 @@ +"use client"; + +// LeadForm — «Оставить заявку на трейд-ин» v2-native card (issue #2395: fixup +// of #2377 — the working lead form only existed in the dead HeroTransparency/ +// HeroSummary legacy tree, unreachable from the live `/trade-in/v2` route, +// which redirects everything else. This is the v2-native mount). +// +// Reused AS-IS (per #2395 DoD): `useCreateLeadMutation` (trade-in-api.ts) + +// `TradeInLeadInput`/`TradeInLeadResponse` types — backend is untouched and +// already live (`POST /api/v1/trade-in/lead`). The state machine / validation / +// submit-handler shape is ported from HeroTransparency.tsx (idle → submitting → +// success/error, phone regex mirroring the backend's `_PHONE_PATTERN`, explicit +// ФЗ-152 consent) — but the markup/styling below is a fresh v2 HUD card built on +// `tokens.ts`, not the legacy `.hero-lead*` CSS classes (those stay in +// trade-in.css, unused by this component). +// +// Critical fixup carried over from the #2377 code review: the submit + + + + + {phoneInvalid && ( +

+ Введите телефон (5–32 символа: цифры, +, пробелы, скобки, дефис) +

+ )} + {consentInvalid && ( +

+ Необходимо согласие на обработку персональных данных +

+ )} + {apiError && ( +

+ {apiError} +

+ )} +

+ Менеджер свяжется с вами для уточнения деталей трейд-ина +

+ + ); +} + +export default LeadForm;