Skip to content

Commit 298efa6

Browse files
Merge pull request #421 from ibi-group/fare-by-leg
fix(trip-details): Revert accidental breaking change
2 parents 96e9ae2 + f66f293 commit 298efa6

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

packages/trip-details/src/fare-table.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Transfer } from "@styled-icons/boxicons-regular/Transfer";
77

88
import { boldText, renderFare } from "./utils";
99

10-
import { FareDetailsProps, FareTableLayout, FareTableText } from "./types";
10+
import { FareLegTableProps, FareTableLayout, FareTableText } from "./types";
1111

1212
// Load the default messages.
1313
import defaultEnglishMessages from "../i18n/en-US.yml";
@@ -180,10 +180,10 @@ const FareTypeTable = ({
180180

181181
const FareLegDetails = ({
182182
layout,
183+
legs,
183184
transitFareDetails,
184-
transitFares,
185-
legs
186-
}: FareDetailsProps): JSX.Element => {
185+
transitFares
186+
}: FareLegTableProps): JSX.Element => {
187187
const fareKeys = Object.keys(transitFareDetails);
188188

189189
const legsWithFares = legs

packages/trip-details/src/index.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ export function TripDetails({
173173
{fareDetailsLayout ? (
174174
// Show full ƒare details by leg
175175
<FareLegTable
176-
transitFares={transitFares}
177-
transitFareDetails={fareDetails}
178-
legs={itinerary.legs}
179176
layout={fareDetailsLayout}
177+
legs={itinerary.legs}
178+
transitFareDetails={fareDetails}
179+
transitFares={transitFares}
180180
/>
181181
) : (
182182
// Just show the fares for each payment type
@@ -276,7 +276,13 @@ export function TripDetails({
276276
<TripDetail
277277
// Any custom description for the transit fare needs to be handled by the slot.
278278
description={
279-
FareDetails && <FareDetails transitFares={transitFares} />
279+
FareDetails && (
280+
<FareDetails
281+
maxTNCFare={maxTNCFare}
282+
minTNCFare={minTNCFare}
283+
transitFares={transitFares}
284+
/>
285+
)
280286
}
281287
icon={<MoneyBillAlt size={17} />}
282288
summary={fare}

packages/trip-details/src/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ export interface TransitFareData {
3434
}
3535

3636
export interface FareDetailsProps {
37+
maxTNCFare: number;
38+
minTNCFare: number;
39+
transitFares: TransitFareData;
40+
}
41+
42+
export interface FareLegTableProps {
3743
layout?: FareTableLayout[];
3844
legs?: Leg[];
3945
transitFareDetails?: FareDetails;

0 commit comments

Comments
 (0)