diff --git a/package-lock.json b/package-lock.json index 192aae3..790dc0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,9 @@ "": { "name": "onebusaway-webapp", "version": "0.0.1", + "dependencies": { + "@fortawesome/free-regular-svg-icons": "^6.6.0" + }, "devDependencies": { "@fortawesome/fontawesome-svg-core": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2", @@ -549,6 +552,25 @@ "node": ">=6" } }, + "node_modules/@fortawesome/free-regular-svg-icons": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz", + "integrity": "sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ==", + "dependencies": { + "@fortawesome/fontawesome-common-types": "6.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/free-regular-svg-icons/node_modules/@fortawesome/fontawesome-common-types": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz", + "integrity": "sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw==", + "engines": { + "node": ">=6" + } + }, "node_modules/@fortawesome/free-solid-svg-icons": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.5.2.tgz", diff --git a/package.json b/package.json index b389acf..2a6542a 100644 --- a/package.json +++ b/package.json @@ -34,5 +34,8 @@ "vite": "^5.0.3", "vitest": "^1.2.0" }, - "type": "module" + "type": "module", + "dependencies": { + "@fortawesome/free-regular-svg-icons": "^6.6.0" + } } diff --git a/src/components/ArrivalDeparture.svelte b/src/components/ArrivalDeparture.svelte index af135f5..e5b0cc4 100644 --- a/src/components/ArrivalDeparture.svelte +++ b/src/components/ArrivalDeparture.svelte @@ -3,6 +3,12 @@ export let tripHeadsign; export let scheduledArrivalTime; export let predictedArrivalTime; + export let tripId; + export let vehicleId; + export let serviceDate; + import { createEventDispatcher } from 'svelte'; + + const dispatch = createEventDispatcher(); function formatTime(time) { const date = new Date(time); @@ -45,10 +51,24 @@ return `${Math.floor((chosenTime - now) / 60000)}m`; } + + function handleTripDetail() { + dispatch('showTripDetails', { + tripId, + vehicleId, + serviceDate, + routeShortName, + tripHeadsign, + scheduledArrivalTime, + timeToReach: calculateTimeToReach(predictedArrivalTime, scheduledArrivalTime), + arrivalStatus: getArrivalStatus(predictedArrivalTime, scheduledArrivalTime) + }); + } -

@@ -66,4 +86,4 @@ {calculateTimeToReach(predictedArrivalTime, scheduledArrivalTime)}

-
+ diff --git a/src/components/map/GoogleMap.svelte b/src/components/map/GoogleMap.svelte index 2aeb3e6..16924f8 100644 --- a/src/components/map/GoogleMap.svelte +++ b/src/components/map/GoogleMap.svelte @@ -158,10 +158,6 @@ } }); }); - - function handleStopSelected(stop) { - dispatch('stopSelected', { stop }); - }
diff --git a/src/components/navigation/ModalPane.svelte b/src/components/navigation/ModalPane.svelte index e81a823..fd6e5a0 100644 --- a/src/components/navigation/ModalPane.svelte +++ b/src/components/navigation/ModalPane.svelte @@ -33,7 +33,7 @@ diff --git a/src/components/oba/StopPane.svelte b/src/components/oba/StopPane.svelte index ca1b373..6091f4a 100644 --- a/src/components/oba/StopPane.svelte +++ b/src/components/oba/StopPane.svelte @@ -1,5 +1,7 @@
@@ -96,15 +121,23 @@ tripHeadsign={arrival.tripHeadsign} scheduledArrivalTime={arrival.scheduledArrivalTime} predictedArrivalTime={arrival.predictedArrivalTime} + tripId={arrival.tripId} + vehicleId={arrival.vehicleId} + serviceDate={arrival.serviceDate} + on:showTripDetails={handleShowTripDetails} /> {/each}
{/if} + + {#if showTripDetails} + + {/if} -