Skip to content

Commit 4d31217

Browse files
fix: make route viewer clearer by hiding other elements when it's shown
1 parent 76d0de2 commit 4d31217

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

lib/components/map/connected-endpoints-overlay.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import { getActiveSearch, getShowUserSettings } from '../../util/state'
1212
// connect to the redux store
1313

1414
const mapStateToProps = (state, ownProps) => {
15+
// If trip viewer is not active, do not show trip on map
16+
if (state.otp.ui.mainPanelContent !== null) {
17+
return {}
18+
}
19+
1520
// Use query from active search (if a search has been made) or default to
1621
// current query is no search is available.
1722
const activeSearch = getActiveSearch(state)

lib/components/map/connected-transitive-overlay.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ import { getTransitiveData } from '../../util/state'
77

88
const mapStateToProps = (state, ownProps) => {
99
const { labeledModes, styles } = state.otp.config.map.transitive || {}
10+
11+
// If trip viewer is not active, do not show trip on map
12+
if (state.otp.ui.mainPanelContent !== null) {
13+
return {tripData: null}
14+
}
15+
1016
return {
1117
labeledModes,
1218
styles,

lib/components/viewers/viewer-container.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ViewerContainer extends Component {
1919

2020
// check for main panel content
2121
if (uiState.mainPanelContent === MainPanelContent.ROUTE_VIEWER) {
22-
return <RouteViewer />
22+
return <RouteViewer hideBackButton />
2323
}
2424

2525
// check for stop viewer

0 commit comments

Comments
 (0)