diff --git a/index.html b/index.html index 3c41d28ff..bf7a6d640 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,11 @@
- + + + diff --git a/lib/components/viewers/stop-viewer.js b/lib/components/viewers/stop-viewer.js index f351a074b..1f5c740d3 100644 --- a/lib/components/viewers/stop-viewer.js +++ b/lib/components/viewers/stop-viewer.js @@ -13,6 +13,7 @@ import { setMainPanelContent, toggleAutoRefresh } from '../../actions/ui' import { findStop, findStopTimesForStop } from '../../actions/api' import { forgetStop, rememberStop, setLocation } from '../../actions/map' import { routeComparator } from '../../util/itinerary' +import { getShowUserSettings } from '../../util/state' import { formatDuration, formatStopTime, getTimeFormat } from '../../util/time' class StopViewer extends Component { @@ -110,9 +111,10 @@ class StopViewer extends Component { render () { const { - stopData, hideBackButton, homeTimezone, + showUserSettings, + stopData, stopViewerArriving, timeFormat } = this.props @@ -166,17 +168,20 @@ class StopViewer extends Component { ? {stopData.name} : Loading Stop... } - + {showUserSettings + ? + : null + }
@@ -376,7 +381,11 @@ class PatternRow extends Component { const ONE_HOUR_IN_SECONDS = 3600 -function getHomeTime (homeTimezone) { +/** + * @param {string} [homeTimezone='America/New_York'] Timezone string + * @return {number} Current time in home timezone in seconds since midnight + */ +function getHomeTime (homeTimezone = 'America/New_York') { const now = moment() return now.tz(homeTimezone).diff(now.clone().startOf('day'), 'seconds') } @@ -475,11 +484,13 @@ function getStatusLabel (delay) { // connect to redux store const mapStateToProps = (state, ownProps) => { + const showUserSettings = getShowUserSettings(state.otp) return { autoRefreshStopTimes: state.otp.user.autoRefreshStopTimes, favoriteStops: state.otp.user.favoriteStops, homeTimezone: state.otp.config.homeTimezone, viewedStop: state.otp.ui.viewedStop, + showUserSettings, stopData: state.otp.transitIndex.stops[state.otp.ui.viewedStop.stopId], stopViewerArriving: state.otp.config.language.stopViewerArriving, timeFormat: getTimeFormat(state.otp.config)