From 0c59643546c615acf90cd7cd38f368b9519683c0 Mon Sep 17 00:00:00 2001 From: ronreg-ribdev <56719257+ronreg-ribdev@users.noreply.github.com> Date: Mon, 1 Jun 2020 03:20:15 -0700 Subject: [PATCH] Elevator info hooked up --- src/js/components/root.js | 22 ++++++++++++++++++++-- src/js/reducers/update.js | 5 +++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/js/components/root.js b/src/js/components/root.js index f931642..be835f6 100644 --- a/src/js/components/root.js +++ b/src/js/components/root.js @@ -4,11 +4,26 @@ import _ from 'lodash'; import { HeaderBar } from "./lib/header-bar.js" class ElevatorWidget extends Component { + + statuses() { + const elevatorStatuses = this.props.elevatorStatuses; + if (elevatorStatuses.length === 0) { + return

No elevators are known to be out of service.

; + } + return (
+ { _.map(elevatorStatuses, (st, idx) => { + const desc = st.description['#cdata-section']; + return

{desc}

; + }) + } +
); + } + render() { return (

BART Info - Elevator status

Route planner - No elevators are known to be out of service. + { this.statuses() }
); } } @@ -125,7 +140,10 @@ export class Root extends Component {
- }/> + + }/>