Skip to content

Commit

Permalink
fix: make route viewer clearer by hiding other elements when it's shown
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Oct 19, 2021
1 parent 76d0de2 commit 4d31217
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/components/map/connected-endpoints-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import { getActiveSearch, getShowUserSettings } from '../../util/state'
// connect to the redux store

const mapStateToProps = (state, ownProps) => {
// If trip viewer is not active, do not show trip on map
if (state.otp.ui.mainPanelContent !== null) {
return {}
}

// Use query from active search (if a search has been made) or default to
// current query is no search is available.
const activeSearch = getActiveSearch(state)
Expand Down
6 changes: 6 additions & 0 deletions lib/components/map/connected-transitive-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import { getTransitiveData } from '../../util/state'

const mapStateToProps = (state, ownProps) => {
const { labeledModes, styles } = state.otp.config.map.transitive || {}

// If trip viewer is not active, do not show trip on map
if (state.otp.ui.mainPanelContent !== null) {
return {tripData: null}
}

return {
labeledModes,
styles,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/viewers/viewer-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ViewerContainer extends Component {

// check for main panel content
if (uiState.mainPanelContent === MainPanelContent.ROUTE_VIEWER) {
return <RouteViewer />
return <RouteViewer hideBackButton />
}

// check for stop viewer
Expand Down

0 comments on commit 4d31217

Please sign in to comment.