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: {
)}>
{props.trainIdentifier}
</div>
<h3 className={"text-xl"}>
{props.trainHeading}
<h3 className={"text-xl leading-9"}>
{deDortmund(props.trainHeading)}
</h3>
</div>
......@@ -34,8 +34,9 @@ const PlanElement = (props: {
<ProgressIndicator
first={index === 0}
id={stop.name}
name={stop.name}
name={deDortmund(stop.name)}
arrival={stop.arrival}
delay={stop.delay}
/>
))
}
......@@ -63,3 +64,13 @@ const trainIdentifierToColor = (identifier: string): string => {
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.
Finish editing this message first!
Please register or to comment