import { connect } from 'react-redux' ; import { ToolbarOverlay } from './toolbar_overlay' ; import { MapStoreState } from '../../reducers/store' ; import { getDrawMode } from '../../selectors/ui_selectors' ; import { getGeoFieldNames } from '../../selectors/map_selectors' ; import { DRAW_MODE } from '../../../common/constants' ; function mapStateToProps ( state ) { return { showToolsControl : getGeoFieldNames ( state ) . length !== 0 , shapeDrawModeActive : getDrawMode ( state ) === DRAW_MODE . DRAW_SHAPES , pointDrawModeActive : getDrawMode ( state ) === DRAW_MODE . DRAW_POINTS , } ; } const connected = connect ( mapStateToProps ) ( ToolbarOverlay ) ; export { connected as ToolbarOverlay } ;