Account for origin walk in departure time

Add useOriginStationWalk and integrate it into EventDetail/EventList to
resolve walking time from origin to station. Introduce calculateLeaveByTime
for notification scheduling and use exported Expo trigger types. Support
HAFAS 'crd' coordinates in client and destination hooks, update tests,
jest mappings, and Expo run scripts.
This commit is contained in:
2026-05-18 11:56:49 +02:00
parent 9d6efdd43b
commit ce1fa4972c
14 changed files with 381 additions and 62 deletions
@@ -15,6 +15,7 @@ import type { Journey, BikeRoute, Station, Event as CalendarEvent, WalkRoute } f
import { useDestinationStation } from '../hooks/useDestinationStation';
import { useDepartureTime } from '../hooks/useDepartureTime';
import { useGeocode } from '../hooks/useGeocode';
import { useOriginStationWalk } from '../hooks/useOriginStationWalk';
import { useWalkRoute } from '../hooks/useWalkRoute';
import { useWienerLinien } from '../hooks/useWienerLinien';
import { useColors } from '../hooks/useColors';
@@ -70,6 +71,7 @@ export function EventDetailScreen({ navigation, route }: ScreenProps) {
destCoords.coords?.lat,
destCoords.coords?.lng,
);
const originWalk = useOriginStationWalk(origin);
const wienerLinien = useWienerLinien(destCoords.coords?.lat, destCoords.coords?.lng);
const fetchData = useCallback(async () => {
@@ -160,6 +162,7 @@ export function EventDetailScreen({ navigation, route }: ScreenProps) {
: null,
arrivalBufferMinutes,
showWalkingOption ? (walkRoute?.duration ?? 0) : 0,
originWalk.walkRoute?.duration ?? 0,
);
if (loading) {