import { AnyAction } from 'redux' ; import { ThunkDispatch } from 'redux-thunk' ; import { connect } from 'react-redux' ; import { DrawFilterControl } from './draw_filter_control' ; import { setDrawMode , updateDrawState } from '../../../../actions' ; import { getDrawState , getGeoFieldNames } from '../../../../selectors/map_selectors' ; import { DRAW_MODE } from '../../../../../common/constants' ; import { MapStoreState } from '../../../../reducers/store' ; import { getDrawMode } from '../../../../selectors/ui_selectors' ; function mapStateToProps ( state ) { return { drawState : getDrawState ( state ) , filterModeActive : getDrawMode ( state ) === DRAW_MODE . DRAW_FILTERS , geoFieldNames : getGeoFieldNames ( state ) , } ; } function mapDispatchToProps ( dispatch ) { return { disableDrawState ( ) { dispatch ( updateDrawState ( null ) ) ; dispatch ( setDrawMode ( DRAW_MODE . NONE ) ) ; } , } ; } const connected = connect ( mapStateToProps , mapDispatchToProps ) ( DrawFilterControl ) ; export { connected as DrawFilterControl } ;