aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/app/components/Stops
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/app/components/Stops')
-rw-r--r--src/frontend/app/components/Stops/ConsolidatedCirculationList.css14
-rw-r--r--src/frontend/app/components/Stops/ConsolidatedCirculationList.tsx45
2 files changed, 41 insertions, 18 deletions
diff --git a/src/frontend/app/components/Stops/ConsolidatedCirculationList.css b/src/frontend/app/components/Stops/ConsolidatedCirculationList.css
index 65e897b..3705ec3 100644
--- a/src/frontend/app/components/Stops/ConsolidatedCirculationList.css
+++ b/src/frontend/app/components/Stops/ConsolidatedCirculationList.css
@@ -104,12 +104,22 @@
color: #09106e;
}
+/* Scheduled-only: dark blue in light mode, softer blue in dark mode */
.consolidated-circulation-card .arrival-time.time-scheduled {
- color: var(--text-color);
+ color: #0b3d91; /* dark blue */
}
.consolidated-circulation-card .arrival-time.time-scheduled svg {
- color: var(--subtitle-color);
+ color: #0b3d91;
+}
+
+@media (prefers-color-scheme: dark) {
+ .consolidated-circulation-card .arrival-time.time-scheduled {
+ color: #8fb4ff; /* lighten for dark backgrounds */
+ }
+ .consolidated-circulation-card .arrival-time.time-scheduled svg {
+ color: #8fb4ff;
+ }
}
.consolidated-circulation-card .distance-info {
diff --git a/src/frontend/app/components/Stops/ConsolidatedCirculationList.tsx b/src/frontend/app/components/Stops/ConsolidatedCirculationList.tsx
index 1ba460b..37f6a47 100644
--- a/src/frontend/app/components/Stops/ConsolidatedCirculationList.tsx
+++ b/src/frontend/app/components/Stops/ConsolidatedCirculationList.tsx
@@ -1,8 +1,8 @@
-import { useTranslation } from "react-i18next";
import { Clock } from "lucide-react";
-import { type ConsolidatedCirculation } from "~routes/stops-$id";
+import { useTranslation } from "react-i18next";
import LineIcon from "~components/LineIcon";
import { type RegionConfig } from "~data/RegionConfig";
+import { type ConsolidatedCirculation } from "~routes/stops-$id";
import "./ConsolidatedCirculationList.css";
@@ -104,15 +104,11 @@ export const ConsolidatedCirculationList: React.FC<RegularTableProps> = ({
const delay = estimate.realTime.minutes - estimate.schedule.minutes;
if (delay >= -1 && delay <= 2) {
- return t("estimates.on_time", "on time");
+ return "OK"
} else if (delay > 2) {
- return t("estimates.minutes_late", "{{minutes}} minutes late", {
- minutes: delay,
- });
+ return "R" + delay;
} else {
- return t("estimates.minutes_early", "{{minutes}} minutes early", {
- minutes: Math.abs(delay),
- });
+ return "A" + Math.abs(delay);
}
};
@@ -179,15 +175,32 @@ export const ConsolidatedCirculationList: React.FC<RegularTableProps> = ({
? `${displayMinutes} ${t("estimates.minutes", "min")}`
: absoluteArrivalTime(displayMinutes)}
</div>
- {estimate.realTime && estimate.realTime.distance >= 0 && (
- <div className="distance-info">
- {formatDistance(estimate.realTime.distance)}
- </div>
- )}
+ <div className="distance-info">
+ {estimate.schedule && (
+ <>
+ {parseServiceId(estimate.schedule.serviceId)} v{getTripIdDisplay(estimate.schedule.tripId)} {" "}
+ </>
+ )}
+
+ {estimate.schedule &&
+ estimate.realTime &&
+ estimate.realTime.distance >= 0 && <> &middot; </>}
+
+ {estimate.realTime && estimate.realTime.distance >= 0 && (
+ <>{formatDistance(estimate.realTime.distance)}</>
+ )}
+
+ {estimate.schedule &&
+ estimate.realTime &&
+ estimate.realTime.distance >= 0 && <> &middot; </>}
+
+ {delayText}
+
+ </div>
</div>
</div>
- <div className="card-footer">
+ {/*<div className="card-footer">
<span className="status-text">
{delayText && (
<>
@@ -213,7 +226,7 @@ export const ConsolidatedCirculationList: React.FC<RegularTableProps> = ({
</>
)}
</span>
- </div>
+ </div>*/}
</div>
);
})}