axelclark / metroAppIOS

A simple IOS app project that tells you when WMATA Metro trains arrive.
MIT License
1 stars 0 forks source link

Handle "BRD" & "ARR" in TrainList #45

Closed axelclark closed 6 years ago

axelclark commented 6 years ago

Currently says "Train is arriving in {min} minutes". This results in occasionally saying "in BRD minutes" or "in ARR minutes". The sentence should say:

"Train is arriving" and "Train is boarding!"

axelclark commented 6 years ago
const displayArrival = (mins) => {
  switch(mins)
  {
    case 'BRD':
      return <Text>The train is boarding!</Text>
    case 'ARR':
      return <Text>The train is arriving</Text>
    default:
      return <Text>Arrival in {mins} minutes</Text>
  }
}
axelclark commented 6 years ago

Occasionally, the mins is an empty string. We should consider handling that case as well.