Skip to content

Commit b2b7660

Browse files
committed
refactor(itinerary-body): nest header sequence inside PlaceHeader instead of separate grid area
1 parent f3566fa commit b2b7660

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

packages/itinerary-body/src/ItineraryBody/place-row.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ export default function PlaceRow({
146146
<S.PlaceRowWrapper
147147
$showTimeColumn={showTimeColumn}
148148
$shouldShowAlightStep={shouldShowAlightStep}
149-
$showHeaderSequence={showHeaderSequence}
150149
$isDestination={isDestination}
151150
$isLastLeg={isLastLeg && !isDestination}
152151
className={`place-row-wrapper ${leg.transitLeg ? "transit" : ""} ${
@@ -166,17 +165,15 @@ export default function PlaceRow({
166165
toRouteAbbreviation={toRouteAbbreviation}
167166
/>
168167
</S.LineColumn>
169-
{shouldShowHeaderInOwnRow && (
170-
<S.PlaceHeaderSequence>
168+
<S.PlaceHeader $showTimeColumn={showTimeColumn}>
169+
{shouldShowHeaderInOwnRow && (
171170
<HeaderSequenceContent
172171
config={config}
173172
isDestination={isDestination}
174173
leg={leg}
175174
legIndex={legIndex}
176175
/>
177-
</S.PlaceHeaderSequence>
178-
)}
179-
<S.PlaceHeader $showTimeColumn={showTimeColumn}>
176+
)}
180177
<S.PlaceName aria-hidden className="place-row-place-name">
181178
{placeName}
182179
</S.PlaceName>

packages/itinerary-body/src/styled.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ export const LegDetails = styled.span`
453453
interface PlaceRowWrapperProps {
454454
$showTimeColumn: boolean;
455455
$shouldShowAlightStep: boolean;
456-
$showHeaderSequence: boolean;
457456
$isDestination: boolean;
458457
$isLastLeg?: boolean;
459458
}
@@ -463,7 +462,6 @@ interface PlaceRowWrapperProps {
463462
*/
464463
function getGridTemplateAreas(
465464
showTimeColumn: boolean,
466-
showHeaderSequence: boolean,
467465
isDestination: boolean
468466
): string {
469467
if (isDestination && showTimeColumn) {
@@ -472,16 +470,6 @@ function getGridTemplateAreas(
472470
if (isDestination) {
473471
return `"line title"`;
474472
}
475-
if (showHeaderSequence && !showTimeColumn) {
476-
return `"line header"
477-
"line title"
478-
"line instructions"`;
479-
}
480-
if (showHeaderSequence && showTimeColumn) {
481-
return `"time line header"
482-
"time line title"
483-
"time line instructions"`;
484-
}
485473
if (showTimeColumn) {
486474
return `"time line title"
487475
"time line instructions"`;
@@ -497,7 +485,6 @@ export const PlaceRowWrapper = styled.li<PlaceRowWrapperProps>`
497485
grid-template-areas: ${props =>
498486
getGridTemplateAreas(
499487
props.$showTimeColumn,
500-
props.$showHeaderSequence,
501488
props.$isDestination
502489
)};
503490
grid-template-columns: ${props =>
@@ -572,10 +559,6 @@ export const PlaceDetails = styled.div<PlaceContentProps>`
572559
grid-area: instructions;
573560
`;
574561

575-
export const PlaceHeaderSequence = styled.div`
576-
grid-area: header;
577-
`;
578-
579562
export const PlaceSequenceHeader = styled.h3`
580563
font-weight: bold;
581564
margin: 0 0 8px 0;

0 commit comments

Comments
 (0)