From a26adad895f1a76635b958c442df7d0088751111 Mon Sep 17 00:00:00 2001 From: gnezim Date: Wed, 22 Apr 2026 13:45:21 +0300 Subject: [PATCH] Schedule row click opens flight details (TIRREDESIGN-4) FlightList on direction=schedule now wires a row-level onClick so the entire row navigates to the details page instead of expanding inline. Matches Angular's schedule-search-result behaviour where each flight row is a link to the details card. --- src/ui/flights/FlightList.tsx | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/ui/flights/FlightList.tsx b/src/ui/flights/FlightList.tsx index 4250ed04..d4a7a2b5 100644 --- a/src/ui/flights/FlightList.tsx +++ b/src/ui/flights/FlightList.tsx @@ -40,6 +40,11 @@ export interface FlightListProps { * Купить / Онлайн регистрация alongside Детали рейса. */ renderActions?: (flight: ISimpleFlight) => ReactNode; + /** + * Aeroflot booking URL per flight for the hover-reveal inline + * "Купить билет" link (TIRREDESIGN-6). Return null to hide. + */ + buyUrlFor?: (flight: ISimpleFlight) => string | null; } /** @@ -57,6 +62,7 @@ export const FlightList: FC = ({ direction = "route", renderExpandedBody, renderActions, + buyUrlFor, }) => { const { t } = useTranslation(); const cardRefs = useRef>(new Map()); @@ -110,16 +116,29 @@ export const FlightList: FC = ({ onFlightClick(flight) } + ? { + onViewDetails: () => onFlightClick(flight), + // When expandable is off we need a row-level onClick to + // trigger navigation — rowClickable in FlightCard depends + // on `expandable || Boolean(onClick)`. + ...(direction === "schedule" + ? { onClick: () => onFlightClick(flight) } + : {}), + } : {})} {...(renderExpandedBody ? { renderExpandedBody } : {})} {...(renderActions ? { renderActions } : {})} + {...(() => { + const url = buyUrlFor?.(flight); + return url ? { inlineBuyUrl: url } : {}; + })()} /> ))}