homeflowjs 0.9.4 → 0.9.7

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.
package/README.md CHANGED
@@ -55,3 +55,6 @@ success Using linked package for "react".
55
55
  You may need to repeat this for `react-dom`.
56
56
 
57
57
  This is a known issue with peer dependencies, see this comment and containing thread for more info: https://github.com/facebook/react/issues/14257#issuecomment-439967377
58
+
59
+
60
+ Temp commit for to publish last PR to Jenkins
@@ -0,0 +1,47 @@
1
+ import React, { useEffect } from 'react';
2
+ import { connect } from 'react-redux';
3
+ import PropTypes from 'prop-types';
4
+
5
+ import { initGoogleMaps } from '../../actions/app.actions';
6
+
7
+ const BranchStreetview = ({ initGoogleMaps, ...otherProps }) => {
8
+ const initializeMap = () => {
9
+ const branch = Homeflow.get('branch');
10
+
11
+ const panorama = new google.maps.StreetViewPanorama(document.getElementById('hfjs-branch-streetview'));
12
+ panorama.setPosition(new google.maps.LatLng(branch.lat, branch.lng));
13
+
14
+ if (branch.streetview) {
15
+ const { pitch, heading } = branch.streetview.orientation;
16
+ const { lat, lng } = branch.streetview.position;
17
+
18
+ panorama.setPosition(new google.maps.LatLng(lat, lng));
19
+ panorama.setPov({ heading, pitch });
20
+ } else {
21
+ panorama.setPosition(new google.maps.LatLng(branch.lat, branch.lng));
22
+ }
23
+
24
+ panorama.setVisible(true);
25
+ };
26
+
27
+ useEffect(() => {
28
+ initGoogleMaps().then(() => initializeMap());
29
+ });
30
+
31
+ return (
32
+ <div id="hfjs-branch-streetview" style={{ height: '100%' }} {...otherProps} />
33
+ );
34
+ };
35
+
36
+ BranchStreetview.propTypes = {
37
+ initGoogleMaps: PropTypes.func.isRequired,
38
+ };
39
+
40
+ const mapDispatchToProps = {
41
+ initGoogleMaps,
42
+ };
43
+
44
+ export default connect(
45
+ null,
46
+ mapDispatchToProps,
47
+ )(BranchStreetview);
package/branches/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import BranchesMap from './branches-map/branches-map.component';
2
2
  import BranchMap from './branch-map/branch-map.component';
3
+ import BranchStreetview from './branch-streetview/branch-streetview.component';
3
4
  import BranchesSearchForm from './branches-search-form/branches-search-form.component';
4
5
  import BranchesSearchInput from './branches-search-form/branches-search-input.component';
5
6
 
6
7
  export {
7
8
  BranchesMap,
8
9
  BranchMap,
10
+ BranchStreetview,
9
11
  BranchesSearchForm,
10
12
  BranchesSearchInput,
11
13
  };
@@ -126,6 +126,11 @@ class InstantValuation extends Component {
126
126
  lead.opt_in_marketing_statement = 'Get emails with the latest news and information on the local property market, our products and services.You can unsubscribe at any time.';
127
127
  }
128
128
 
129
+ const referrerURL = window.location.href;
130
+ lead.metadata = {
131
+ lead_url_referrer: referrerURL,
132
+ };
133
+
129
134
  const params = flatten({ search: restOfSearch, lead });
130
135
 
131
136
  const query = new URLSearchParams(params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "0.9.4",
3
+ "version": "0.9.7",
4
4
  "description": "JavaScript toolkit for Homeflow themes",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,6 +17,9 @@ const SavedSearch = (props) => {
17
17
  deleteButtonClass,
18
18
  buttonSpanClass,
19
19
  userLoggedIn,
20
+ frequencyLabel,
21
+ visitSearchLabel,
22
+ removeSearchLabel,
20
23
  } = props;
21
24
 
22
25
  const visitSearch = (e) => {
@@ -41,7 +44,7 @@ const SavedSearch = (props) => {
41
44
  <div className="saved-search__body">
42
45
  {userLoggedIn && (
43
46
  <>
44
- Email me matching properties:
47
+ {frequencyLabel}
45
48
  <select
46
49
  className={`saved-search__frequency ${selectClass}`}
47
50
  onChange={handleFrequencyChange}
@@ -60,7 +63,7 @@ const SavedSearch = (props) => {
60
63
  onClick={visitSearch}
61
64
  className={visitButtonClass}
62
65
  >
63
- <span className={buttonSpanClass}>Visit</span>
66
+ <span className={buttonSpanClass}>{visitSearchLabel}</span>
64
67
  </button>
65
68
 
66
69
  <button
@@ -68,7 +71,7 @@ const SavedSearch = (props) => {
68
71
  onClick={removeSearch}
69
72
  className={deleteButtonClass}
70
73
  >
71
- <span className={buttonSpanClass}>Remove</span>
74
+ <span className={buttonSpanClass}>{removeSearchLabel}</span>
72
75
  </button>
73
76
  </div>
74
77
  </div>
@@ -84,6 +87,9 @@ SavedSearch.propTypes = {
84
87
  deleteButtonClass: PropTypes.string,
85
88
  buttonSpanClass: PropTypes.string,
86
89
  userLoggedIn: PropTypes.bool.isRequired,
90
+ frequencyLabel: PropTypes.string,
91
+ visitSearchLabel: PropTypes.string,
92
+ removeSearchLabel: PropTypes.string,
87
93
  };
88
94
 
89
95
  SavedSearch.defaultProps = {
@@ -91,7 +97,10 @@ SavedSearch.defaultProps = {
91
97
  visitButtonClass: '',
92
98
  deleteButtonClass: '',
93
99
  buttonSpanClass: '',
94
- }
100
+ frequencyLabel: 'Email me matching properties:',
101
+ visitSearchLabel: 'Visit',
102
+ removeSearchLabel: 'Remove',
103
+ };
95
104
 
96
105
  const mapStateToProps = (state) => ({
97
106
  userLoggedIn: !!state.user.currentUser.user_id,