+
{this.props.departure.time}
{lineInterference &&
-
+
}
-
+
-
{this.props.departure.lineName}
-
-
{this.props.departure.destination}
+
{this.props.departure.lineName}
+
+
{this.props.departure.destination}
- {infoElem}
+ {lineInterference &&
+
{trafficInfo} Visa mer
+ }
diff --git a/src/components/TrafficList.js b/src/components/TrafficList.js
index d96e079..c91101c 100644
--- a/src/components/TrafficList.js
+++ b/src/components/TrafficList.js
@@ -8,18 +8,20 @@ class TrafficList extends Component {
render() {
let entries = [];
+ let i = 0; // React requires elems in array to have associated unique key
+
this.props.departures.forEach(departure => {
entries.push(
-
+
);
});
// Add separator between every element
const intersperse = (arr, sep) => arr.reduce((a,v)=>[...a,v,sep],[]).slice(0,-1);
- entries = intersperse(entries, (
));
+ entries = intersperse(entries, (
));
// Add separator after the last element
- entries.push(
);
+ entries.push(
);
return (
diff --git a/src/components/TripSelector.js b/src/components/TripSelector.js
index 838f1b5..d1394c8 100644
--- a/src/components/TripSelector.js
+++ b/src/components/TripSelector.js
@@ -7,7 +7,7 @@ class TripSelector extends Component {
-
+
);