Skip to content

Commit a5ea29c

Browse files
committed
fix: directions panel dark mode colors and limit departure time to transit mode
Replace hardcoded grey.50/grey.100/grey.200 with theme-aware action.hover and action.selected tokens in waypoint inputs, time picker, and route details. Show departure time chip only in transit mode where it functions.
1 parent 1fcdc7a commit a5ea29c

3 files changed

Lines changed: 43 additions & 39 deletions

File tree

apps/web/src/components/panels/directions/DetailsView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ function LegByLegView({
171171
px: 2,
172172
py: 1.25,
173173
cursor: "pointer",
174-
bgcolor: "grey.50",
175-
"&:hover": { bgcolor: "grey.100" },
174+
bgcolor: "action.hover",
175+
"&:hover": { bgcolor: "action.selected" },
176176
transition: "background-color 0.15s",
177177
borderTop: "1px solid",
178178
borderColor: "divider",

apps/web/src/components/panels/directions/DirectionsPanelContent.tsx

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -453,49 +453,53 @@ export function DirectionsPanelContent() {
453453
</Box>
454454
)}
455455

456-
{/* Leave now / Depart at / Arrive by + Options */}
456+
{/* Leave now / Depart at / Arrive by (transit only) + Options (non-transit) */}
457457
<Box
458458
sx={{
459459
display: "flex",
460460
alignItems: "center",
461-
justifyContent: "space-between",
461+
justifyContent: isTransitMode ? "space-between" : "flex-end",
462462
px: 2,
463463
py: 1,
464464
}}
465465
>
466-
<Box
467-
onClick={() => setTimePickerOpen((v) => !v)}
468-
sx={{
469-
display: "inline-flex",
470-
alignItems: "center",
471-
gap: 0.75,
472-
px: 1.75,
473-
py: 0.75,
474-
borderRadius: "12px",
475-
bgcolor: transitTimeMode !== "now" ? `${TEAL}18` : "grey.100",
476-
cursor: "pointer",
477-
"&:hover": { bgcolor: transitTimeMode !== "now" ? `${TEAL}28` : "grey.200" },
478-
transition: "background-color 0.15s",
479-
}}
480-
>
481-
<ScheduleIcon
482-
sx={{ fontSize: 18, color: transitTimeMode !== "now" ? TEAL : "text.primary" }}
483-
/>
484-
<Typography
485-
variant="body2"
486-
fontWeight={500}
487-
color={transitTimeMode !== "now" ? TEAL : "text.primary"}
466+
{isTransitMode && (
467+
<Box
468+
onClick={() => setTimePickerOpen((v) => !v)}
469+
sx={{
470+
display: "inline-flex",
471+
alignItems: "center",
472+
gap: 0.75,
473+
px: 1.75,
474+
py: 0.75,
475+
borderRadius: "12px",
476+
bgcolor: transitTimeMode !== "now" ? `${TEAL}18` : "action.hover",
477+
cursor: "pointer",
478+
"&:hover": {
479+
bgcolor: transitTimeMode !== "now" ? `${TEAL}28` : "action.selected",
480+
},
481+
transition: "background-color 0.15s",
482+
}}
488483
>
489-
{transitTimeMode === "now"
490-
? t("departNow")
491-
: transitTimeMode === "depart"
492-
? `${t("departAt")} ${transitDepartureTime instanceof Date ? transitDepartureTime.toLocaleTimeString(locale, { hour: "2-digit", minute: "2-digit" }) : ""}`
493-
: `${t("arriveBy")} ${transitArrivalTime instanceof Date ? transitArrivalTime.toLocaleTimeString(locale, { hour: "2-digit", minute: "2-digit" }) : ""}`}
494-
</Typography>
495-
<ExpandMoreIcon
496-
sx={{ fontSize: 18, color: transitTimeMode !== "now" ? TEAL : "text.primary" }}
497-
/>
498-
</Box>
484+
<ScheduleIcon
485+
sx={{ fontSize: 18, color: transitTimeMode !== "now" ? TEAL : "text.primary" }}
486+
/>
487+
<Typography
488+
variant="body2"
489+
fontWeight={500}
490+
color={transitTimeMode !== "now" ? TEAL : "text.primary"}
491+
>
492+
{transitTimeMode === "now"
493+
? t("departNow")
494+
: transitTimeMode === "depart"
495+
? `${t("departAt")} ${transitDepartureTime instanceof Date ? transitDepartureTime.toLocaleTimeString(locale, { hour: "2-digit", minute: "2-digit" }) : ""}`
496+
: `${t("arriveBy")} ${transitArrivalTime instanceof Date ? transitArrivalTime.toLocaleTimeString(locale, { hour: "2-digit", minute: "2-digit" }) : ""}`}
497+
</Typography>
498+
<ExpandMoreIcon
499+
sx={{ fontSize: 18, color: transitTimeMode !== "now" ? TEAL : "text.primary" }}
500+
/>
501+
</Box>
502+
)}
499503

500504
{!isTransitMode && (
501505
<Typography
@@ -542,8 +546,8 @@ export function DirectionsPanelContent() {
542546
cursor: "pointer",
543547
display: "flex",
544548
alignItems: "center",
545-
bgcolor: transitTimeMode === m ? TEAL : "grey.100",
546-
"&:hover": { bgcolor: transitTimeMode === m ? TEAL : "grey.200" },
549+
bgcolor: transitTimeMode === m ? TEAL : "action.hover",
550+
"&:hover": { bgcolor: transitTimeMode === m ? TEAL : "action.selected" },
547551
transition: "background-color 0.15s",
548552
}}
549553
>

apps/web/src/components/panels/directions/WaypointRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function WaypointRow({
110110
border: "1px solid",
111111
borderColor: "divider",
112112
borderRadius: "8px",
113-
bgcolor: "grey.50",
113+
bgcolor: "action.hover",
114114
"&:focus-within": {
115115
borderColor: TEAL,
116116
bgcolor: "background.paper",

0 commit comments

Comments
 (0)