From 7758b512d54d9b764e563ca2faefb7b74b2bbdc1 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Tue, 9 Jan 2018 15:52:03 +0200 Subject: [PATCH] Update comments and image naming --- src/components/SearchFilters/SearchFilters.css | 2 +- src/components/SearchFilters/SearchFilters.js | 4 +++- .../images/{map_icon@2x.png => map_icon216x105.png} | Bin src/containers/SearchPage/SearchPage.js | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) rename src/components/SearchFilters/images/{map_icon@2x.png => map_icon216x105.png} (100%) diff --git a/src/components/SearchFilters/SearchFilters.css b/src/components/SearchFilters/SearchFilters.css index f8f7dac2..3185fb71 100644 --- a/src/components/SearchFilters/SearchFilters.css +++ b/src/components/SearchFilters/SearchFilters.css @@ -42,7 +42,7 @@ font-weight: var(--fontWeightBold); /* background map image */ - background-image: url(./images/map_icon@2x.png); + background-image: url(./images/map_icon216x105.png); background-size: cover; border-radius: 3px; diff --git a/src/components/SearchFilters/SearchFilters.js b/src/components/SearchFilters/SearchFilters.js index 29dfb9ba..052042f4 100644 --- a/src/components/SearchFilters/SearchFilters.js +++ b/src/components/SearchFilters/SearchFilters.js @@ -40,7 +40,9 @@ const SearchFiltersComponent = props => { const classes = classNames(rootClassName || css.root, className); const onSelectSingle = (customAttribute, option) => { - // name of the corresponding query parameter + // Name of the corresponding query parameter. + // The custom attribute query parameters are named + // ca_ in the API. const caParam = `ca_${customAttribute}`; // query parameters after selecting the option diff --git a/src/components/SearchFilters/images/map_icon@2x.png b/src/components/SearchFilters/images/map_icon216x105.png similarity index 100% rename from src/components/SearchFilters/images/map_icon@2x.png rename to src/components/SearchFilters/images/map_icon216x105.png diff --git a/src/containers/SearchPage/SearchPage.js b/src/containers/SearchPage/SearchPage.js index 4cda705f..dcb642f6 100644 --- a/src/containers/SearchPage/SearchPage.js +++ b/src/containers/SearchPage/SearchPage.js @@ -41,6 +41,7 @@ const MODAL_BREAKPOINT = 768; // Search is in modal on mobile layout const SEARCH_WITH_MAP_DEBOUNCE = 300; // Little bit of debounce before search is initiated. const BOUNDS_FIXED_PRECISION = 8; +// extract search parameters, including a custom attribute named category const pickSearchParamsOnly = params => { const { address, origin, bounds, ca_category } = params || {}; return { address, origin, bounds, ca_category }; @@ -90,6 +91,7 @@ export class SearchPageComponent extends Component { onIdle(googleMap) { const { history, location } = this.props; + // parse query parameters, including a custom attribute named category const { address, country, bounds, mapSearch, ca_category } = parse(location.search, { latlng: ['origin'], latlngBounds: ['bounds'],