mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Poprawka favicon
This commit is contained in:
@@ -2,16 +2,22 @@ import TrainStop from "./TrainStop";
|
||||
|
||||
export default interface Timetable {
|
||||
trainNo: number;
|
||||
driverName: string;
|
||||
driverId: number;
|
||||
currentStationName: string;
|
||||
currentStationHash: string;
|
||||
timetableId: number;
|
||||
category: string;
|
||||
route: string;
|
||||
TWR: boolean;
|
||||
SKR: boolean;
|
||||
routeDistance: number;
|
||||
followingStops: TrainStop[];
|
||||
followingSceneries: string[];
|
||||
|
||||
success: boolean;
|
||||
|
||||
data?: {
|
||||
trainNo: number;
|
||||
driverName: string;
|
||||
driverId: number;
|
||||
currentStationName: string;
|
||||
currentStationHash: string;
|
||||
timetableId: number;
|
||||
category: string;
|
||||
route: string;
|
||||
TWR: boolean;
|
||||
SKR: boolean;
|
||||
routeDistance: number;
|
||||
followingStops: TrainStop[];
|
||||
followingSceneries: string[];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Station from "../interfaces/Station";
|
||||
import Timetable from "../interfaces/Timetable";
|
||||
import TrainStop from "../interfaces/TrainStop";
|
||||
|
||||
export const getLocoURL = (locoType: string): string => (`https://rj.td2.info.pl/dist/img/thumbnails/${locoType.includes("EN") ? locoType + "rb" : locoType}.png`)
|
||||
@@ -79,7 +80,7 @@ export const timestampToString = (timestamp: number | null): string =>
|
||||
})
|
||||
: "";
|
||||
|
||||
export const getTrainStopStatus = (stopInfo: TrainStop, timetableData: { currentStationName: string }, station: Station) => {
|
||||
export const getTrainStopStatus = (stopInfo: TrainStop, currentStationName: string, station: Station) => {
|
||||
let stopStatus = "",
|
||||
stopLabel = "",
|
||||
stopStatusID = -1;
|
||||
@@ -88,23 +89,23 @@ export const getTrainStopStatus = (stopInfo: TrainStop, timetableData: { current
|
||||
stopStatus = "terminated";
|
||||
stopLabel = "Skończył bieg";
|
||||
stopStatusID = 5;
|
||||
} else if (!stopInfo.terminatesHere && stopInfo.confirmed && timetableData.currentStationName == station.name) {
|
||||
} else if (!stopInfo.terminatesHere && stopInfo.confirmed && currentStationName == station.name) {
|
||||
stopStatus = "departed";
|
||||
stopLabel = "Odprawiony";
|
||||
stopStatusID = 2;
|
||||
} else if (!stopInfo.terminatesHere && stopInfo.confirmed && timetableData.currentStationName != station.name) {
|
||||
} else if (!stopInfo.terminatesHere && stopInfo.confirmed && currentStationName != station.name) {
|
||||
stopStatus = "departed-away";
|
||||
stopLabel = "Odjechał";
|
||||
stopStatusID = 4;
|
||||
} else if (timetableData.currentStationName == station.name && !stopInfo.stopped) {
|
||||
} else if (currentStationName == station.name && !stopInfo.stopped) {
|
||||
stopStatus = "online";
|
||||
stopLabel = "Na stacji";
|
||||
stopStatusID = 0;
|
||||
} else if (timetableData.currentStationName == station.name && stopInfo.stopped) {
|
||||
} else if (currentStationName == station.name && stopInfo.stopped) {
|
||||
stopStatus = "stopped";
|
||||
stopLabel = "Postój";
|
||||
stopStatusID = 1;
|
||||
} else if (timetableData.currentStationName != station.name) {
|
||||
} else if (currentStationName != station.name) {
|
||||
stopStatus = "arriving";
|
||||
stopLabel = "W drodze";
|
||||
stopStatusID = 3;
|
||||
|
||||
Reference in New Issue
Block a user