add toggle button for sites

This commit is contained in:
Lachlan Kermode
2019-01-08 14:02:25 +00:00
parent 7ca8610bfa
commit d9c86ee6a8
8 changed files with 82 additions and 64 deletions

View File

@@ -5,60 +5,42 @@ import RefreshIcon from './presentational/Icons/RefreshIcon.js';
import CoeventIcon from './presentational/Icons/CoeventIcon.js';
import RouteIcon from './presentational/Icons/RouteIcon.js';
class ToolbarBottomActions extends React.Component {
resetAllFilters() {
this.props.actions.resetAllFilters();
}
toggleInfoPopup() {
this.props.actions.toggleInfoPopup();
}
toggleLanguage() {
this.props.actions.toggleLanguage();
}
toggleMapViews(layer) {
this.props.actions.toggleMapView(layer);
}
renderMapActions() {
function ToolbarBottomActions (props) {
function renderMapActions() {
return (
<div className="bottom-action-block">
<RouteIcon
onClick={(view) => this.toggleMapViews(view)}
isEnabled={this.props.viewFilters.routes}
/>
{/* <RouteIcon */}
{/* onClick={(view) => this.toggleMapViews(view)} */}
{/* isEnabled={this.props.viewFilters.routes} */}
{/* /> */}
<SitesIcon
onClick={(view) => this.toggleMapViews(view)}
isEnabled={this.props.viewFilters.sites}
/>
<CoeventIcon
onClick={(view) => this.toggleMapViews(view)}
isEnabled={this.props.viewFilters.coevents}
isEnabled={props.sites.enabled}
onClickHandler={props.sites.toggle}
/>
{/* <CoeventIcon */}
{/* onClick={(view) => this.toggleMapViews(view)} */}
{/* isEnabled={this.props.viewFilters.coevents} */}
{/* /> */}
</div>
);
}
render() {
return (
<div className="bottom-actions">
{/*}{this.renderMapActions()}
<div className="bottom-action-block">
<button className="action-button tiny default" onClick={() => { this.toggleLanguage()}}>
{(this.props.language === 'es-MX') ? 'ES' : 'EN' }
</button>
<button className="action-button info tiny default" onClick={() => { this.toggleInfoPopup()}}>
i
</button>
<button className="action-button tiny" onClick={() => this.resetAllFilters()}>
<RefreshIcon />
</button>
</div>*/}
return (
<div className="bottom-actions">
{renderMapActions()}
<div className="bottom-action-block">
{/* <button className="action-button tiny default" onClick={() => { toggleLanguage()}}> */}
{/* {(props.language === 'es-MX') ? 'ES' : 'EN' } */}
{/* </button> */}
{/* <button className="action-button info tiny default" onClick={() => { this.toggleInfoPopup()}}> */}
{/* i */}
{/* </button> */}
{/* <button className="action-button tiny" onClick={() => this.resetAllFilters()}> */}
{/* <RefreshIcon /> */}
{/* </button> */}
</div>
);
}
</div>
)
}
export default ToolbarBottomActions;