Schedule per-leg operator logos + Купить button

- FlightCard: when the flight is multi-leg, render one OperatorLogo
  per leg in the header so code-share / multi-carrier journeys show
  both airline brands (Angular's `operator-logo-and-model x N` row).
  Direct flights keep the single logo.
- FlightCard: add an orange "Купить" (buy ticket) link rendered next
  to "Детали рейса" when the card is in the schedule context. Links
  to aeroflot.ru's booking flow per Angular's flight-actions wiring.
- Reverted earlier per-leg flight-number stack — IFlightLeg in React
  doesn't carry a per-leg flightId, so the parent SU number is the
  authoritative label. The Angular dual-number stack belongs to the
  ConnectingFlight shape (separate from MultiLeg) which the React
  code already renders flat.
This commit is contained in:
2026-04-19 21:23:46 +03:00
parent 69706e023d
commit a41c767dd1
2 changed files with 37 additions and 1 deletions
+15
View File
@@ -199,6 +199,21 @@
}
}
&__buy-btn {
background: #ff9000;
color: #fff;
border: none;
border-radius: 4px;
padding: 10px 24px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
text-decoration: none;
transition: background-color 150ms ease;
&:hover { background: #e68200; }
}
&__details-btn {
background: colors.$blue;
color: #fff;
+22 -1
View File
@@ -96,6 +96,7 @@ export const FlightCard: FC<FlightCardProps> = ({
const flightNumber = `${flight.flightId.carrier} ${flight.flightId.flightNumber}`;
const carrier = operatingCarrier(flight.operatingBy) ?? flight.flightId.carrier;
const isMultiLeg = flight.routeType === "MultiLeg";
const aircraftName =
departureLeg.equipment?.aircraft?.actual?.title ??
departureLeg.equipment?.aircraft?.scheduled?.title ??
@@ -171,7 +172,15 @@ export const FlightCard: FC<FlightCardProps> = ({
</div>
<div className="flight-card__operator">
<OperatorLogo carrier={carrier} locale={language} />
{isMultiLeg
? flight.legs.map((leg, i) => (
<OperatorLogo
key={`${operatingCarrier(leg.operatingBy) ?? carrier}-${i}`}
carrier={operatingCarrier(leg.operatingBy) ?? carrier}
locale={language}
/>
))
: <OperatorLogo carrier={carrier} locale={language} />}
</div>
<div className="flight-card__time">
@@ -335,6 +344,18 @@ export const FlightCard: FC<FlightCardProps> = ({
>
<img src="/assets/img/share.svg" alt="" aria-hidden="true" />
</button>
{direction === "schedule" && (
<a
className="flight-card__buy-btn"
data-testid="flight-buy-button"
href="https://www.aeroflot.ru/sb/app/ru-ru"
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
>
{t("SHARED.BUY-TICKET") || "Купить"}
</a>
)}
<button
type="button"
className="flight-card__details-btn"