diff --git a/src/components/SearchFiltersMobile/SearchFiltersMobile.js b/src/components/SearchFiltersMobile/SearchFiltersMobile.js
index 7e2d3cca..d224302a 100644
--- a/src/components/SearchFiltersMobile/SearchFiltersMobile.js
+++ b/src/components/SearchFiltersMobile/SearchFiltersMobile.js
@@ -7,11 +7,18 @@ import { omit, toPairs } from 'lodash';
import routeConfiguration from '../../routeConfiguration';
import { createResourceLocatorString } from '../../util/routes';
-import { SecondaryButton, ModalInMobile, Button, SelectSingleFilterMobile } from '../../components';
+import {
+ SecondaryButton,
+ ModalInMobile,
+ Button,
+ SelectSingleFilterMobile,
+ SelectMultipleFilterMobile,
+} from '../../components';
import css from './SearchFiltersMobile.css';
const CATEGORY_URL_PARAM = 'pub_category';
-const allowedCategories = [CATEGORY_URL_PARAM];
+const FEATURES_URL_PARAM = 'pub_amenities';
+const allowedCategories = [CATEGORY_URL_PARAM, FEATURES_URL_PARAM];
const validateParamValue = value => value !== null && value !== undefined && value.length > 0;
const validateParamKey = key => allowedCategories.includes(key);
@@ -33,7 +40,8 @@ class SearchFiltersMobileComponent extends Component {
this.cancelFilters = this.cancelFilters.bind(this);
this.closeFilters = this.closeFilters.bind(this);
this.resetAll = this.resetAll.bind(this);
- this.onSelectSingle = this.onSelectSingle.bind(this);
+ this.handleSelectSingle = this.handleSelectSingle.bind(this);
+ this.handleSelectMultiple = this.handleSelectMultiple.bind(this);
}
// Open filters modal, set the initial parameters to current ones
@@ -65,7 +73,7 @@ class SearchFiltersMobileComponent extends Component {
this.setState({ isFiltersOpenOnMobile: false });
}
- onSelectSingle(urlParam, option) {
+ handleSelectSingle(urlParam, option) {
const { urlQueryParams, history } = this.props;
// query parameters after selecting the option
@@ -77,6 +85,17 @@ class SearchFiltersMobileComponent extends Component {
history.push(createResourceLocatorString('SearchPage', routeConfiguration(), {}, queryParams));
}
+ handleSelectMultiple(urlParam, options) {
+ const { urlQueryParams, history } = this.props;
+
+ const queryParams =
+ options && options.length > 0
+ ? { ...urlQueryParams, [FEATURES_URL_PARAM]: options.join(',') }
+ : omit(urlQueryParams, FEATURES_URL_PARAM);
+
+ history.push(createResourceLocatorString('SearchPage', routeConfiguration(), {}, queryParams));
+ }
+
// Reset all filter query parameters
resetAll(e) {
const { urlQueryParams, history } = this.props;
@@ -102,6 +121,7 @@ class SearchFiltersMobileComponent extends Component {
onMapIconClick,
onManageDisableScrolling,
categories,
+ features,
intl,
} = this.props;
@@ -139,13 +159,30 @@ class SearchFiltersMobileComponent extends Component {