homeflowjs 0.8.13 → 0.8.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,6 @@
3
3
  import React, { Suspense } from 'react';
4
4
  import { connect } from 'react-redux';
5
5
  import PropTypes from 'prop-types';
6
-
7
6
  import { initGoogleMaps } from '../../actions/app.actions';
8
7
  import { simpleBW } from '../../shared/custom-gmap-styles';
9
8
 
@@ -105,4 +104,4 @@ const mapDispatchToProps = {
105
104
  export default connect(
106
105
  null,
107
106
  mapDispatchToProps,
108
- )(BranchMap);
107
+ )(BranchMap);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "0.8.13",
3
+ "version": "0.8.16",
4
4
  "description": "JavaScript toolkit for Homeflow themes",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,13 +3,14 @@ import { connect } from 'react-redux';
3
3
  import PropTypes from 'prop-types';
4
4
 
5
5
  import { loadNext } from '../../actions/properties.actions';
6
- import Loader from '../../shared/loader.component';
6
+ import DefaultLoader from '../../shared/loader.component';
7
7
 
8
8
  const LoadMoreButton = (props) => {
9
9
  const {
10
10
  loadNext,
11
11
  pagination,
12
12
  children,
13
+ Loader = DefaultLoader,
13
14
  ...otherProps
14
15
  } = props;
15
16
 
@@ -34,10 +34,12 @@ const PropertiesDisplay = ({
34
34
  <p>There were no properties matching your search.</p>
35
35
  );
36
36
  }
37
+
37
38
  const addWrapper = displayType === 'list';
38
39
 
39
- const items = propertiesByPage(properties).map((page) => (
40
+ const items = propertiesByPage(properties).map((page, i) => (
40
41
  <ConditionalWrapper
42
+ key={i}
41
43
  condition={addWrapper}
42
44
  wrapper={(children) => (
43
45
  <div
@@ -51,6 +51,7 @@ window.$ = () => ({
51
51
  const PropertiesMap = ({ leaflet, gmapKey, googleLayer }) => {
52
52
  const addLegacyMaps = () => {
53
53
  const needsGoogle = !leaflet || googleLayer;
54
+
54
55
  if (needsGoogle && !document.getElementById('hfjs-gmaps') && gmapKey) {
55
56
  const gmapScript = document.createElement('script');
56
57
  gmapScript.setAttribute('src', `https://maps.google.com/maps/api/js?key=${gmapKey}`);
@@ -3,7 +3,6 @@
3
3
  import React, { Suspense } from 'react';
4
4
  import { connect } from 'react-redux';
5
5
  import PropTypes from 'prop-types';
6
-
7
6
  import { initGoogleMaps } from '../../actions/app.actions';
8
7
  import { simpleBW } from '../../shared/custom-gmap-styles';
9
8
 
@@ -32,6 +31,7 @@ class PropertyMap extends React.Component {
32
31
  zoom,
33
32
  disableStreetview,
34
33
  custom,
34
+ iconConfig,
35
35
  } = this.props;
36
36
 
37
37
  // Should this be added to Redux?
@@ -53,14 +53,15 @@ class PropertyMap extends React.Component {
53
53
  const marker = new google.maps.Marker({
54
54
  position: { lat: property.lat, lng: property.lng },
55
55
  map,
56
+ ...(iconConfig && { icon: iconConfig.iconUrl }),
56
57
  });
57
58
  }
58
59
 
59
60
  render() {
60
- const { google } = this.props;
61
+ const { google, iconConfig } = this.props;
61
62
 
62
63
  if (!google) {
63
- return <LazyLeafletMap />;
64
+ return <LazyLeafletMap iconConfig={iconConfig} />;
64
65
  }
65
66
 
66
67
  return (
@@ -77,6 +78,7 @@ PropertyMap.propTypes = {
77
78
  disableStreetview: PropTypes.bool,
78
79
  initGoogleMaps: PropTypes.func.isRequired,
79
80
  google: PropTypes.bool,
81
+ iconConfig: PropTypes.object,
80
82
  };
81
83
 
82
84
  PropertyMap.defaultProps = {
@@ -86,6 +88,7 @@ PropertyMap.defaultProps = {
86
88
  zoom: 15,
87
89
  disableStreetview: false,
88
90
  google: false,
91
+ iconConfig: null,
89
92
  };
90
93
 
91
94
  const mapDispatchToProps = {
@@ -95,4 +98,4 @@ const mapDispatchToProps = {
95
98
  export default connect(
96
99
  null,
97
100
  mapDispatchToProps,
98
- )(PropertyMap);
101
+ )(PropertyMap);
@@ -38,6 +38,7 @@ export default (fragment) => {
38
38
 
39
39
  if (part.startsWith('tag-')) {
40
40
  search.tags = part.replace('tag-', '').split(',');
41
+ return;
41
42
  }
42
43
 
43
44
  if (orderParams.includes(part)) {
@@ -47,6 +47,7 @@ class SearchForm extends Component {
47
47
  setPlace(place);
48
48
  setInitialSearch({
49
49
  q: place.name + (place.county_name ? `, ${place.county_name}` : ''),
50
+ place,
50
51
  });
51
52
  }
52
53
  const expandedPolygon = Homeflow.get('expanded_polygon');