diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-11-19 15:04:55 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2025-11-19 15:05:34 +0100 |
| commit | d51169f6411b68a226d76d2d39826904de484929 (patch) | |
| tree | 4d8a403dfcc5b17671a92b8cc1e5d71d20ed9537 /src/frontend/app/data | |
| parent | d434204860fc0409ad6343e815d0057b97ce3573 (diff) | |
feat: Add About and Favourites pages, update routing and context management
- Added new routes for About and Favourites pages.
- Implemented About page with version information and credits.
- Created Favourites page with a placeholder message for empty favourites.
- Refactored RegionConfig import paths for consistency.
- Introduced PageTitleContext to manage page titles dynamically.
- Updated various components to utilize the new context for setting page titles.
- Enhanced AppShell layout with a responsive Drawer for navigation.
- Added CSS styles for new components and pages.
- Integrated commit hash display in the About page for version tracking.
Diffstat (limited to 'src/frontend/app/data')
| -rw-r--r-- | src/frontend/app/data/LineColors.ts | 2 | ||||
| -rw-r--r-- | src/frontend/app/data/RegionConfig.ts | 51 | ||||
| -rw-r--r-- | src/frontend/app/data/StopDataProvider.ts | 2 |
3 files changed, 2 insertions, 53 deletions
diff --git a/src/frontend/app/data/LineColors.ts b/src/frontend/app/data/LineColors.ts index 85a7c54..fba150d 100644 --- a/src/frontend/app/data/LineColors.ts +++ b/src/frontend/app/data/LineColors.ts @@ -1,4 +1,4 @@ -import type { RegionId } from "./RegionConfig"; +import type { RegionId } from "../config/RegionConfig"; interface LineColorInfo { background: string; diff --git a/src/frontend/app/data/RegionConfig.ts b/src/frontend/app/data/RegionConfig.ts deleted file mode 100644 index 8acfbbf..0000000 --- a/src/frontend/app/data/RegionConfig.ts +++ /dev/null @@ -1,51 +0,0 @@ -export type RegionId = "vigo"; - -export interface RegionConfig { - id: RegionId; - name: string; - stopsEndpoint: string; - estimatesEndpoint: string; - consolidatedCirculationsEndpoint: string | null; - timetableEndpoint: string | null; - defaultCenter: [number, number]; // [lat, lng] - bounds?: { - sw: [number, number]; - ne: [number, number]; - }; - textColour?: string; - defaultZoom: number; - showMeters: boolean; // Whether to show distance in meters -} - -export const REGIONS: Record<RegionId, RegionConfig> = { - vigo: { - id: "vigo", - name: "Vigo", - stopsEndpoint: "/stops/vigo.json", - estimatesEndpoint: "/api/vigo/GetStopEstimates", - consolidatedCirculationsEndpoint: "/api/vigo/GetConsolidatedCirculations", - timetableEndpoint: "/api/vigo/GetStopTimetable", - defaultCenter: [42.229188855975046, -8.72246955783102], - bounds: { - sw: [-8.951059, 42.098923], - ne: [-8.447748, 42.3496], - }, - textColour: "#e72b37", - defaultZoom: 14, - showMeters: true, - }, -}; - -export const DEFAULT_REGION: RegionId = "vigo"; - -export function getRegionConfig(regionId: RegionId): RegionConfig { - return REGIONS[regionId]; -} - -export function getAvailableRegions(): RegionConfig[] { - return Object.values(REGIONS); -} - -export function isValidRegion(regionId: string): regionId is RegionId { - return regionId === "vigo"; -} diff --git a/src/frontend/app/data/StopDataProvider.ts b/src/frontend/app/data/StopDataProvider.ts index b4e877f..2f13e43 100644 --- a/src/frontend/app/data/StopDataProvider.ts +++ b/src/frontend/app/data/StopDataProvider.ts @@ -1,4 +1,4 @@ -import { type RegionId, getRegionConfig } from "./RegionConfig"; +import { type RegionId, getRegionConfig } from "../config/RegionConfig"; export interface CachedStopList { timestamp: number; |
