From 96235d5534571fbb1192616bf8d188b211e90229 Mon Sep 17 00:00:00 2001 From: gnezim Date: Sat, 18 Apr 2026 13:11:28 +0300 Subject: [PATCH] Wrap ScheduleDetailsPage in PageLayout + frame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The schedule-details view rendered bare content on the blue background with no PageLayout, no PageTabs, no breadcrumbs, no white card — so the flight-number heading, leg list and skeletons were invisible against the page background. Wrap the component in PageLayout with the schedule tab + breadcrumb + 'Информация о рейсе: SU 6805' title, and put each branch inside a
(error, not-found, empty, success) so it sits on the same white card as the board pages. Also fix the same React key warning the board page had: the leg map used leg.index as the key, which is undefined for Direct flights. Fall back to the array index. --- .../components/ScheduleDetailsPage.tsx | 127 ++++++++++++------ 1 file changed, 84 insertions(+), 43 deletions(-) diff --git a/src/features/schedule/components/ScheduleDetailsPage.tsx b/src/features/schedule/components/ScheduleDetailsPage.tsx index c5df0426..ff0c6b98 100644 --- a/src/features/schedule/components/ScheduleDetailsPage.tsx +++ b/src/features/schedule/components/ScheduleDetailsPage.tsx @@ -13,6 +13,8 @@ import { useTranslation } from "@/i18n/provider.js"; import { FlightCard } from "@/ui/flights/FlightCard.js"; import { FlightListSkeleton } from "@/ui/flights/FlightListSkeleton.js"; import { SeoHead } from "@/ui/seo/SeoHead.js"; +import { PageLayout } from "@/ui/layout/PageLayout.js"; +import { PageTabs } from "@/ui/layout/PageTabs.js"; import { JsonLdRenderer } from "@/shared/seo/json-ld.js"; import { useScheduleDetails } from "../hooks/useScheduleDetails.js"; import { buildScheduleDetailsSeo } from "../seo.js"; @@ -69,23 +71,55 @@ export const ScheduleDetailsPage: FC = ({ const { flights, loading, error } = useScheduleDetails(detailsParams); + const pageTabs = ; + const scheduleHref = `/${locale}/schedule`; + const title = flightIds[0] + ? `${t("BOARD.FLIGHT-INFO")}: ${flightIds[0].carrier} ${flightIds[0].flightNumber}` + : t("SCHEDULE.TITLE"); + if (loading) { - return ; + return ( + {title}} + breadcrumbs={[{ label: t("SCHEDULE.TITLE"), url: scheduleHref }]} + > +
+ +
+
+ ); } if (error) { return ( -
-

{t("BOARD.LOAD-FAILED")}

-
+ {title}} + breadcrumbs={[{ label: t("SCHEDULE.TITLE"), url: scheduleHref }]} + > +
+
+

{t("BOARD.LOAD-FAILED")}

+
+
+
); } if (flights.length === 0) { return ( -
-

{t("BOARD.FLIGHT-NOT-FOUND")}

-
+ {title}} + breadcrumbs={[{ label: t("SCHEDULE.TITLE"), url: scheduleHref }]} + > +
+
+

{t("BOARD.FLIGHT-NOT-FOUND")}

+
+
+
); } @@ -93,47 +127,54 @@ export const ScheduleDetailsPage: FC = ({ const seoProps = buildScheduleDetailsSeo(t, flights, locale, canonicalOrigin, flightIds); return ( -
+ {title}} + breadcrumbs={[{ label: t("SCHEDULE.TITLE"), url: scheduleHref }]} + > +
+
+ {flights.map((flight) => { + const jsonLd = buildScheduleFlightJsonLd(flight); + const legs = getLegs(flight); + const flightNumber = `${flight.flightId.carrier} ${flight.flightId.flightNumber}`; - {flights.map((flight) => { - const jsonLd = buildScheduleFlightJsonLd(flight); - const legs = getLegs(flight); - const flightNumber = `${flight.flightId.carrier} ${flight.flightId.flightNumber}`; + return ( +
+ - return ( -
- - -
-

{flightNumber}

- {flight.status} -
- - - - {legs.map((leg) => ( -
-
- {leg.departure.scheduled.airportCode} - - {leg.arrival.scheduled.airportCode} +
+

{flightNumber}

+ {flight.status}
-
- {leg.departure.times.scheduledDeparture.localTime} - - - {leg.arrival.times.scheduledArrival.localTime} -
- {leg.equipment.name && ( -
- {leg.equipment.name} + + + + {legs.map((leg, i) => ( +
+
+ {leg.departure.scheduled.airportCode} + + {leg.arrival.scheduled.airportCode} +
+
+ {leg.departure.times.scheduledDeparture.localTime} + - + {leg.arrival.times.scheduledArrival.localTime} +
+ {leg.equipment.name && ( +
+ {leg.equipment.name} +
+ )}
- )} + ))}
- ))} -
- ); - })} -
+ ); + })} +
+
+
); };