homeflowjs 0.13.4 → 0.13.5

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.
@@ -8,7 +8,6 @@ import { flatten } from 'q-flat';
8
8
 
9
9
  import IntroStep from '../intro-step/intro-step.component';
10
10
  import YourDetailsStep from '../your-details-step/your-details-step.component';
11
- import SimilarPropertiesStep from '../similar-properties-step/similar-properties-step.component';
12
11
  import ResultStep from '../result-step/result-step.component';
13
12
  import { DEBOUNCE_DELAY } from '../../utils';
14
13
 
@@ -19,7 +18,6 @@ const INITIAL_STATE = {
19
18
  loading: false,
20
19
  addresses: [],
21
20
  message: null,
22
- similarProperties: [],
23
21
  recentSales: [],
24
22
  search: {
25
23
  paon: '',
@@ -55,8 +53,7 @@ const INITIAL_STATE = {
55
53
  const stepComponents = {
56
54
  1: IntroStep,
57
55
  2: YourDetailsStep,
58
- 3: SimilarPropertiesStep,
59
- 4: ResultStep,
56
+ 3: ResultStep,
60
57
  };
61
58
 
62
59
  class InstantValuation extends Component {
@@ -80,8 +77,6 @@ class InstantValuation extends Component {
80
77
 
81
78
  this.updateState = this.updateState.bind(this);
82
79
  this.setStep = this.setStep.bind(this);
83
- this.getSimilarProperties = this.getSimilarProperties.bind(this);
84
- this.toggleSimilarProperty = this.toggleSimilarProperty.bind(this);
85
80
  this.getValuation = this.getValuation.bind(this);
86
81
  this.addressLookup = debounce(this.addressLookup, DEBOUNCE_DELAY).bind(this);
87
82
  this.reset = this.reset.bind(this);
@@ -92,14 +87,6 @@ class InstantValuation extends Component {
92
87
  this.setState({ step });
93
88
  }
94
89
 
95
- getSimilarProperties() {
96
- this.setState({ loading: true });
97
- const { search } = this.state;
98
- fetch(`/properties/similar_properties?bedrooms=${search.bedrooms}&postcode=${search.postcode}&channel=sales`)
99
- .then((response) => response.json())
100
- .then((json) => this.setState({ similarProperties: json, loading: false }));
101
- }
102
-
103
90
  getRecentSales() {
104
91
  const { search: { postcode, property_type } } = this.state;
105
92
 
@@ -252,7 +239,6 @@ class InstantValuation extends Component {
252
239
  search,
253
240
  lead,
254
241
  message,
255
- similarProperties,
256
242
  valuation,
257
243
  recentSales,
258
244
  loading,
@@ -267,7 +253,7 @@ class InstantValuation extends Component {
267
253
  return (
268
254
  <div
269
255
  className="instant-valuation hf-modal"
270
- style={step === 4 ? largeModalStyles : {}}
256
+ style={step === 3 ? largeModalStyles : {}}
271
257
  >
272
258
  <div id="valuation-section">
273
259
  <Link to="/" className="valuations-modal-close">
@@ -291,9 +277,6 @@ class InstantValuation extends Component {
291
277
  addressLookup={this.addressLookup}
292
278
  message={message}
293
279
  setStep={this.setStep}
294
- similarProperties={similarProperties}
295
- getSimilarProperties={this.getSimilarProperties}
296
- toggleSimilarProperty={this.toggleSimilarProperty}
297
280
  getValuation={this.getValuation}
298
281
  valuation={valuation}
299
282
  recentSales={recentSales}
@@ -290,7 +290,6 @@
290
290
  #valuation-section #price_1 {
291
291
  font-size: 3rem;
292
292
  margin: 20px 50px;
293
- background-color: white;
294
293
  }
295
294
 
296
295
  #valuation-section #valuation-wrapper {
@@ -149,7 +149,7 @@ const ResultStep = ({
149
149
  </div>
150
150
  )}
151
151
 
152
- <ValuationMap recentSales={recentSales} />
152
+ { recentSales && <ValuationMap recentSales={recentSales} /> }
153
153
 
154
154
  <div style={{ clear: 'both' }} />
155
155
 
@@ -158,7 +158,7 @@ const ResultStep = ({
158
158
  <p>These properties near you were sold recently.</p>
159
159
 
160
160
  <ul id="recently-sold-list">
161
- {recentSales.map((property) => recentSale(property))}
161
+ {recentSales?.map((property) => recentSale(property))}
162
162
  </ul>
163
163
  </div>
164
164
 
@@ -21,7 +21,7 @@ const ValuationMap = ({ recentSales }) => {
21
21
  parseFloat(recentSales[0].longitude),
22
22
  ]);
23
23
 
24
- const markers = recentSales.map((property) => {
24
+ const markers = recentSales?.map((property) => {
25
25
  bounds.extend([property.latitude, property.longitude]);
26
26
 
27
27
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "0.13.4",
3
+ "version": "0.13.5",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",