homeflowjs 1.0.52 → 1.0.53
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/package.json +3 -2
- package/search/address-lookup-input/address-lookup-input.component.jsx +4 -1
- package/search/address-lookup-input/clear-button.component.jsx +1 -1
- package/search/address-lookup-input/input.jsx +1 -3
- package/shared/{loading-icon.component.jsx → loading-icon/loading-icon.component.jsx} +1 -0
- package/shared/loading-icon/loading-icon.styles.scss +13 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "homeflowjs",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.53",
|
4
4
|
"sideEffects": [
|
5
5
|
"modal/**/*",
|
6
6
|
"user/default-profile/**/*",
|
@@ -10,7 +10,8 @@
|
|
10
10
|
"properties/property-streetview/**/*",
|
11
11
|
"properties/stamp-duty-calculator/**/*",
|
12
12
|
"search/range-controller/**/*",
|
13
|
-
"properties/property-results-pagination/**/*"
|
13
|
+
"properties/property-results-pagination/**/*",
|
14
|
+
"shared/loading-icon/**/*"
|
14
15
|
],
|
15
16
|
"description": "JavaScript toolkit for Homeflow themes",
|
16
17
|
"main": "index.js",
|
@@ -18,6 +18,7 @@ const AddressLookupInput = ({
|
|
18
18
|
required,
|
19
19
|
setSelectedAddress,
|
20
20
|
iconStokeInherit,
|
21
|
+
errorMessage
|
21
22
|
}) => {
|
22
23
|
const [locationQuery, setLocationQuery] = useState('');
|
23
24
|
const [suggestions, setSuggestions] = useState([]);
|
@@ -35,7 +36,7 @@ const AddressLookupInput = ({
|
|
35
36
|
if (json.suggestions.length === 0) {
|
36
37
|
setAddress({
|
37
38
|
value: address.value,
|
38
|
-
error:
|
39
|
+
error: errorMessage,
|
39
40
|
});
|
40
41
|
}
|
41
42
|
if (json.suggestions.length !== 0) {
|
@@ -194,6 +195,7 @@ AddressLookupInput.propTypes = {
|
|
194
195
|
className: PropTypes.string,
|
195
196
|
setSelectedAddress: PropTypes.func,
|
196
197
|
iconStokeInherit: PropTypes.bool,
|
198
|
+
errorMessage: PropTypes.node,
|
197
199
|
};
|
198
200
|
|
199
201
|
AddressLookupInput.defaultProps = {
|
@@ -204,6 +206,7 @@ AddressLookupInput.defaultProps = {
|
|
204
206
|
className: '',
|
205
207
|
setSelectedAddress: null,
|
206
208
|
iconStokeInherit: true,
|
209
|
+
errorMessage: <span className="input__error">Sorry we couldn't find that address</span>,
|
207
210
|
};
|
208
211
|
|
209
212
|
export default AddressLookupInput;
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import SearchIcon from '../../shared/search-icon.component';
|
4
4
|
import CloseIcon from '../../shared/close-icon.component';
|
5
|
-
import LoadingIcon from '../../shared/loading-icon.component';
|
5
|
+
import LoadingIcon from '../../shared/loading-icon/loading-icon.component';
|
6
6
|
|
7
7
|
const ClearButton = ({ address, loading, onClear, iconStokeInherit }) => (
|
8
8
|
<button
|
@@ -44,9 +44,7 @@ const Input = ({
|
|
44
44
|
/>
|
45
45
|
<ClearButton address={address} loading={loading} onClear={onClear} iconStokeInherit={iconStokeInherit} />
|
46
46
|
</div>
|
47
|
-
{address?.error &&
|
48
|
-
<span className="input__error">{address.error}</span>
|
49
|
-
)}
|
47
|
+
{address?.error && address.error}
|
50
48
|
</div>
|
51
49
|
);
|
52
50
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
|
+
import './loading-icon.styles.scss';
|
3
4
|
|
4
5
|
const LoadingIcon = ({inherit}) => (
|
5
6
|
<svg role="img" className="loading-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|