From d51169f6411b68a226d76d2d39826904de484929 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Wed, 19 Nov 2025 15:04:55 +0100 Subject: 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. --- src/frontend/app/config/AppConfig.ts | 5 ++++ src/frontend/app/config/RegionConfig.ts | 51 +++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 src/frontend/app/config/AppConfig.ts create mode 100644 src/frontend/app/config/RegionConfig.ts (limited to 'src/frontend/app/config') diff --git a/src/frontend/app/config/AppConfig.ts b/src/frontend/app/config/AppConfig.ts new file mode 100644 index 0000000..523343e --- /dev/null +++ b/src/frontend/app/config/AppConfig.ts @@ -0,0 +1,5 @@ +export const APP_CONFIG = { + defaultTheme: "system" as const, + defaultTableStyle: "regular" as const, + defaultMapPositionMode: "gps" as const, +}; diff --git a/src/frontend/app/config/RegionConfig.ts b/src/frontend/app/config/RegionConfig.ts new file mode 100644 index 0000000..8acfbbf --- /dev/null +++ b/src/frontend/app/config/RegionConfig.ts @@ -0,0 +1,51 @@ +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 = { + 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"; +} -- cgit v1.3