From cd0551534d8aaf3d3d5cc1727dfcc01d0637c6b2 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Sun, 12 Apr 2026 18:02:56 +0200 Subject: Run formatter, split code in backend --- src/frontend/app/api/schema.ts | 5 +---- src/frontend/app/components/arrivals/ArrivalList.tsx | 5 ++++- src/frontend/app/contexts/JourneyContext.tsx | 8 ++------ src/frontend/app/hooks/useJourneyTracker.ts | 5 +---- 4 files changed, 8 insertions(+), 15 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/app/api/schema.ts b/src/frontend/app/api/schema.ts index fe90642..64a9e94 100644 --- a/src/frontend/app/api/schema.ts +++ b/src/frontend/app/api/schema.ts @@ -173,10 +173,7 @@ export const ConsolidatedCirculationSchema = z.object({ }) .optional() .nullable(), - currentPosition: z - .object(PositionSchema) - .optional() - .nullable(), + currentPosition: z.object(PositionSchema).optional().nullable(), isPreviousTrip: z.boolean().optional().nullable(), previousTripShapeId: z.string().optional().nullable(), nextStreets: z.array(z.string()).optional().nullable(), diff --git a/src/frontend/app/components/arrivals/ArrivalList.tsx b/src/frontend/app/components/arrivals/ArrivalList.tsx index 18885c8..8fdef06 100644 --- a/src/frontend/app/components/arrivals/ArrivalList.tsx +++ b/src/frontend/app/components/arrivals/ArrivalList.tsx @@ -26,7 +26,10 @@ export const ArrivalList: React.FC = ({
{arrivals.length === 0 && (
- {t("estimates.none", "No hay llegadas próximas disponibles para esta parada.")} + {t( + "estimates.none", + "No hay llegadas próximas disponibles para esta parada." + )}
)} {arrivals.map((arrival, index) => diff --git a/src/frontend/app/contexts/JourneyContext.tsx b/src/frontend/app/contexts/JourneyContext.tsx index f513aa8..9c3c3ac 100644 --- a/src/frontend/app/contexts/JourneyContext.tsx +++ b/src/frontend/app/contexts/JourneyContext.tsx @@ -25,9 +25,7 @@ export interface ActiveJourney { interface JourneyContextValue { activeJourney: ActiveJourney | null; - startJourney: ( - journey: Omit - ) => void; + startJourney: (journey: Omit) => void; stopJourney: () => void; markNotified: () => void; } @@ -61,9 +59,7 @@ export function JourneyProvider({ children }: { children: ReactNode }) { }, []); const markNotified = useCallback(() => { - setActiveJourney((prev) => - prev ? { ...prev, hasNotified: true } : null - ); + setActiveJourney((prev) => (prev ? { ...prev, hasNotified: true } : null)); }, []); return ( diff --git a/src/frontend/app/hooks/useJourneyTracker.ts b/src/frontend/app/hooks/useJourneyTracker.ts index e9be393..97bf23d 100644 --- a/src/frontend/app/hooks/useJourneyTracker.ts +++ b/src/frontend/app/hooks/useJourneyTracker.ts @@ -57,10 +57,7 @@ export function useJourneyTracker() { ) { const title = minutes <= 0 - ? t( - "journey.notification_now_title", - "¡Tu autobús está llegando!" - ) + ? t("journey.notification_now_title", "¡Tu autobús está llegando!") : t("journey.notification_approaching_title", { defaultValue: "Tu autobús llega en {{minutes}} min", minutes, -- cgit v1.3