@@ -23,6 +23,7 @@ import {
2323 getTransitModes
2424} from '../../util/itinerary'
2525import { getTripOptionsFromQuery , isNotDefaultQuery } from '../../util/query'
26+ import { getShowUserSettings } from '../../util/state'
2627
2728class SettingsSelectorPanel extends Component {
2829 static propTypes = {
@@ -345,8 +346,15 @@ class SettingsSelectorPanel extends Component {
345346 }
346347
347348 render ( ) {
348- const { config, defaults, mode, icons, query, queryModes } = this . props
349-
349+ const {
350+ config,
351+ defaults,
352+ mode,
353+ icons,
354+ query,
355+ queryModes,
356+ showUserSettings
357+ } = this . props
350358 const modeHasTransit = hasTransit ( mode )
351359 const { transitModes, accessModes, bicycleModes, micromobilityModes } = config . modes
352360
@@ -358,26 +366,28 @@ class SettingsSelectorPanel extends Component {
358366 return (
359367 < div className = 'settings-selector-panel' >
360368 < div className = 'modes-panel' >
361- < div style = { { marginBottom : '5px' } } className = 'pull-right' >
362- < Button
363- bsStyle = 'link'
364- bsSize = 'xsmall'
365- disabled = { rememberIsDisabled }
366- onClick = { this . _toggleStoredSettings }
367- > { defaults
368- ? < span > < Icon type = 'times' /> Forget my options</ span >
369- : < span > < Icon type = 'lock' /> Remember trip options</ span >
370- } </ Button >
371- < Button
372- bsStyle = 'link'
373- bsSize = 'xsmall'
374- disabled = { queryIsDefault && ! defaults }
375- onClick = { this . _resetForm }
376- >
377- < Icon type = 'undo' /> { ' ' }
378- Restore{ defaults ? ' my' : '' } defaults
379- </ Button >
380- </ div >
369+ { showUserSettings &&
370+ < div style = { { marginBottom : '5px' } } className = 'store-settings pull-right' >
371+ < Button
372+ bsStyle = 'link'
373+ bsSize = 'xsmall'
374+ disabled = { rememberIsDisabled }
375+ onClick = { this . _toggleStoredSettings }
376+ > { defaults
377+ ? < span > < Icon type = 'times' /> Forget my options</ span >
378+ : < span > < Icon type = 'lock' /> Remember trip options</ span >
379+ } </ Button >
380+ < Button
381+ bsStyle = 'link'
382+ bsSize = 'xsmall'
383+ disabled = { queryIsDefault && ! defaults }
384+ onClick = { this . _resetForm }
385+ >
386+ < Icon type = 'undo' /> { ' ' }
387+ Restore{ defaults ? ' my' : '' } defaults
388+ </ Button >
389+ </ div >
390+ }
381391 { /* Take Transit button */ }
382392 < Row className = 'mode-group-row' >
383393 < Col xs = { 12 } >
@@ -548,6 +558,7 @@ class SettingsSelectorPanel extends Component {
548558const mapStateToProps = ( state , ownProps ) => {
549559 const { config, currentQuery, user } = state . otp
550560 const { defaults } = user
561+ const showUserSettings = getShowUserSettings ( state . otp )
551562 const { companies, mode, routingType } = currentQuery
552563 return {
553564 defaults,
@@ -557,7 +568,8 @@ const mapStateToProps = (state, ownProps) => {
557568 companies,
558569 modeGroups : config . modeGroups ,
559570 queryModes : ! mode || mode . length === 0 ? [ ] : mode . split ( ',' ) ,
560- routingType
571+ routingType,
572+ showUserSettings
561573 }
562574}
563575
0 commit comments