From ed70fce6a75f915141d080d203b49a949d638d46 Mon Sep 17 00:00:00 2001
From: ronreg-ribdev <56719257+ronreg-ribdev@users.noreply.github.com>
Date: Fri, 5 Jun 2020 03:42:01 -0700
Subject: [PATCH] RouteResults widget
---
src/js/components/root.js | 17 +++++++++++++++--
src/js/reducers/update.js | 5 +++++
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/js/components/root.js b/src/js/components/root.js
index dcc5441..5005df9 100644
--- a/src/js/components/root.js
+++ b/src/js/components/root.js
@@ -251,9 +251,20 @@ class RouteSearch extends Component {
}
}
+class RouteResults extends Component {
+ render() {
+ console.log(this.props.routes);
+ if (!this.props.routes) {
+ return (
);
+ }
+
+ return (
+ Trains:
+
);
+ }
+}
+
class RoutePlanner extends Component {
-
-
render() {
const curTime = this.props.curTime;
const mapFilename = isSundaySchedule(curTime) ? "BART-Map-Sunday.png" : "BART-Map-Weekday-Saturday.png";
@@ -274,6 +285,7 @@ class RoutePlanner extends Component {
Search scheduled trains:
+
or see the official bart scheduler for a given station, date and time:
@@ -306,6 +318,7 @@ export class Root extends Component {
} />
diff --git a/src/js/reducers/update.js b/src/js/reducers/update.js
index 512ae49..908d228 100644
--- a/src/js/reducers/update.js
+++ b/src/js/reducers/update.js
@@ -14,6 +14,11 @@ export class UpdateReducer {
if (elevators) {
state.elevators = elevators;
}
+
+ const routes = _.get(data, "routes", false);
+ if (routes) {
+ state.routes = routes;
+ }
}
}
}