import React from 'react'; export default class Filters extends React.Component { onCloseClick(e) { if (this.props.onClose) { this.props.onClose(); } } onMaxPriceChange (e) { this.props.dispatch({type: 'SET_MAX_PRICE', action: {maxPrice: e.target.value}}) } onMinPriceChange (e) { this.props.dispatch({type: 'SET_MIN_PRICE', action: {minPrice: e.target.value}}) } onRoomsClick(rooms) { console.log('rooms:', rooms); this.props.dispatch({type: 'SET_ROOMS', action: {rooms}}); } onRefreshClick () { this.props.dispatch({type: 'UPDATE_SEARCH'}); } render() { const {filters} = this.props; const selectedRooms = (val) => filters.rooms[val] ? 'selected' : ''; return (