feat: indicators
Some checks failed
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Loic Coenen
2025-10-31 14:29:46 +01:00
parent b2a5031056
commit 0ee7532a30
13 changed files with 278 additions and 48 deletions

View File

@@ -1,7 +1,7 @@
export type ActionType = string;
import type {Article} from '../../types/article';
import type { LiveBoard } from '../../types/liveboard';
import type { DepartureType } from '../../types/liveboard';
import type {WeatherData} from '../../types/weather';
import {
loadTrainSchedule,
@@ -25,7 +25,7 @@ export type LoadTrainSchedule = {
export type LoadTrainScheduleSuccess = {
type: typeof loadTrainScheduleSuccess,
liveboard: LiveBoard
departures: DepartureType[]
}
export type LoadTrainScheduleError = {

View File

@@ -1,7 +1,7 @@
import { type State } from "./state";
export const initialState: State = {
liveboard: undefined,
departures: undefined,
trainScheduleError: undefined,
trainScheduleLoading: false,
news: undefined,

View File

@@ -33,7 +33,7 @@ export const reducerInner = (state: State, action: Action): State => {
else if(action.type === loadTrainScheduleSuccess) {
return {
...state,
liveboard: (action as LoadTrainScheduleSuccess).liveboard,
departures: (action as LoadTrainScheduleSuccess).departures,
trainScheduleLoading: false,
}
}

View File

@@ -1,10 +1,10 @@
import type { Article } from "../types/article";
import type { LiveBoard } from "../types/liveboard";
import type { DepartureType } from "../types/liveboard";
import type { WeatherData } from "../types/weather";
export type State = {
trainScheduleLoading: boolean,
liveboard: LiveBoard | undefined,
departures: DepartureType[] | undefined,
trainScheduleError: Error | undefined,
weather: WeatherData | undefined,