Skip to content

Commit

Permalink
added button show trip from stop-details
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghoster981 committed Apr 26, 2023
1 parent bf5cbbb commit 17393ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions journey/src/components/viewers/pattern-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { withNamespaces } from "react-i18next"

import Icon from '../narrative/icon'
import { getFormattedStopTime, getStatusLabel } from '../../util/viewer'
import ViewTripButton from './view-trip-button'

/**
* Represents a single pattern row for displaying arrival times in the stop
Expand Down Expand Up @@ -101,6 +102,13 @@ class PatternRow extends Component {
{t('direction')} {stopTime.headsign}
</div>
<div className='cell time-column'>
{stopTime.tripId}
<ViewTripButton
tripId={stopTime.tripId}
fromIndex={stopTime.stopIndex}
setViewedTrip={this.props.setViewedTrip}
toIndex={stopTime.stopIndex}
/>
{getFormattedStopTime(stopTime, homeTimezone, stopViewerArriving, timeFormat)}
</div>
<div className='cell status-column'>
Expand Down
3 changes: 3 additions & 0 deletions journey/src/components/viewers/stop-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { forgetStop, rememberStop, setLocation } from '../../actions/map'
import PatternRow from './pattern-row'
import { getShowUserSettings, getStopViewerConfig } from '../../util/state'
import { getRouteIdForPattern, getStopTimesByPattern } from '../../util/viewer'
import { setViewedTrip } from '../../actions/ui'

const {
getTimeFormat,
Expand Down Expand Up @@ -301,6 +302,7 @@ class StopViewer extends Component {
<PatternRow
pattern={patternTimes.pattern}
route={patternTimes.route}
setViewedTrip={setViewedTrip}
stopTimes={patternTimes.times}
stopViewerConfig={stopViewerConfig}
showScheduleView={scheduleView}
Expand Down Expand Up @@ -370,6 +372,7 @@ const mapStateToProps = (state, ownProps) => {
const mapDispatchToProps = {
findStop,
findStopTimesForStop,
setViewedTrip,
forgetStop,
rememberStop,
setLocation,
Expand Down

0 comments on commit 17393ed

Please sign in to comment.