From 5bfacd51b0959670fc7da78125cf0a68d8fa9cfd Mon Sep 17 00:00:00 2001 From: lekss361 Date: Sun, 24 May 2026 19:42:09 +0000 Subject: [PATCH] =?UTF-8?q?feat(tradein):=20=C2=AB=D0=A0=D0=BE=D1=81=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D1=81=D1=82=D1=80=C2=BB=20button=20=E2=80=94=20cop?= =?UTF-8?q?y=20address=20+=20open=20EGRN=20request=20form=20(#550)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/trade-in/DealsCard.tsx | 12 ++++++++++++ .../src/components/trade-in/ListingsCard.tsx | 11 ++++++++++- .../src/components/trade-in/trade-in.css | 17 +++++++++++++++++ tradein-mvp/frontend/src/lib/rosreestr.ts | 11 +++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tradein-mvp/frontend/src/lib/rosreestr.ts diff --git a/tradein-mvp/frontend/src/components/trade-in/DealsCard.tsx b/tradein-mvp/frontend/src/components/trade-in/DealsCard.tsx index 1b19f143..4731ba91 100644 --- a/tradein-mvp/frontend/src/components/trade-in/DealsCard.tsx +++ b/tradein-mvp/frontend/src/components/trade-in/DealsCard.tsx @@ -4,6 +4,7 @@ * DealsCard — Секция 3 «Сделки» из mockup. Реальные сделки из Росреестра / ДомКлик. */ import type { AggregatedEstimate, AnalogLot } from "@/types/trade-in"; +import { openRosreestrWithAddress } from "@/lib/rosreestr"; interface Props { estimate: AggregatedEstimate; @@ -124,6 +125,7 @@ export function DealsCard({ estimate }: Props) { ₽ / м² Цена сделки Дата + @@ -168,6 +170,16 @@ function DealRow({ deal }: { deal: AnalogLot }) { {fmtRub(deal.price_per_m2)} {fmtRub(deal.price_rub)} {fmtDate(deal.listing_date)} + + + ); } diff --git a/tradein-mvp/frontend/src/components/trade-in/ListingsCard.tsx b/tradein-mvp/frontend/src/components/trade-in/ListingsCard.tsx index c73a0f19..8a9e1123 100644 --- a/tradein-mvp/frontend/src/components/trade-in/ListingsCard.tsx +++ b/tradein-mvp/frontend/src/components/trade-in/ListingsCard.tsx @@ -8,6 +8,7 @@ import { useMemo } from "react"; import type { AggregatedEstimate, AnalogLot, CianPriceChangeStats } from "@/types/trade-in"; import { safeUrl } from "@/lib/safeUrl"; import { useEstimateCianPriceChanges } from "@/lib/trade-in-api"; +import { openRosreestrWithAddress } from "@/lib/rosreestr"; interface Props { estimate: AggregatedEstimate; @@ -328,7 +329,7 @@ function AnalogRow({ )} {distance} - + {externalUrl && ( )} + ); diff --git a/tradein-mvp/frontend/src/components/trade-in/trade-in.css b/tradein-mvp/frontend/src/components/trade-in/trade-in.css index 229fa5af..f6ce77c8 100644 --- a/tradein-mvp/frontend/src/components/trade-in/trade-in.css +++ b/tradein-mvp/frontend/src/components/trade-in/trade-in.css @@ -1595,3 +1595,20 @@ color: var(--fg-secondary, #5b6066); font-weight: 500; } + +/* ── Росреестр deeplink button ── */ + +.rosreestr-btn { + background: transparent; + border: 1px solid var(--border); + color: var(--muted); + padding: 2px 8px; + border-radius: 4px; + font-size: 11px; + cursor: pointer; + white-space: nowrap; +} +.rosreestr-btn:hover { + color: var(--fg); + border-color: var(--fg); +} diff --git a/tradein-mvp/frontend/src/lib/rosreestr.ts b/tradein-mvp/frontend/src/lib/rosreestr.ts new file mode 100644 index 00000000..af89b100 --- /dev/null +++ b/tradein-mvp/frontend/src/lib/rosreestr.ts @@ -0,0 +1,11 @@ +export const ROSREESTR_REQUEST_URL = + "https://rosreestr.gov.ru/eservices/request_info_from_egrn/"; + +export async function openRosreestrWithAddress(address: string): Promise { + try { + await navigator.clipboard.writeText(address); + } catch { + // clipboard may be unavailable — open form anyway + } + window.open(ROSREESTR_REQUEST_URL, "_blank", "noopener,noreferrer"); +}