Skip to content
Snippets Groups Projects
Commit 821183f4 authored by Niklas Schrötler's avatar Niklas Schrötler
Browse files

PlanElement: Now selectively removing Dortmund from strings

parent 44731f5e
No related branches found
No related tags found
No related merge requests found
...@@ -22,8 +22,8 @@ const PlanElement = (props: { ...@@ -22,8 +22,8 @@ const PlanElement = (props: {
)}> )}>
{props.trainIdentifier} {props.trainIdentifier}
</div> </div>
<h3 className={"text-xl"}> <h3 className={"text-xl leading-9"}>
{props.trainHeading} {deDortmund(props.trainHeading)}
</h3> </h3>
</div> </div>
...@@ -34,8 +34,9 @@ const PlanElement = (props: { ...@@ -34,8 +34,9 @@ const PlanElement = (props: {
<ProgressIndicator <ProgressIndicator
first={index === 0} first={index === 0}
id={stop.name} id={stop.name}
name={stop.name} name={deDortmund(stop.name)}
arrival={stop.arrival} arrival={stop.arrival}
delay={stop.delay}
/> />
)) ))
} }
...@@ -63,3 +64,13 @@ const trainIdentifierToColor = (identifier: string): string => { ...@@ -63,3 +64,13 @@ const trainIdentifierToColor = (identifier: string): string => {
return "bg-zinc-700"; return "bg-zinc-700";
} }
const deDortmund = (input: string): string => {
// Don't remove the city from central station location
if(input.toLowerCase().includes("HBf")) {
return input;
}
// In all other cases, remove dortmund
return input.replaceAll("Dortmund ", "");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment