homeflowjs 1.0.55 → 1.0.56
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
CHANGED
@@ -22,6 +22,15 @@ const PropertiesDisplay = ({
|
|
22
22
|
...other
|
23
23
|
}) => {
|
24
24
|
if (!properties?.length) {
|
25
|
+
if (inserts.length > 0) {
|
26
|
+
return (
|
27
|
+
<>
|
28
|
+
{noResultsMessage}
|
29
|
+
{inserts[0]?.component}
|
30
|
+
</>
|
31
|
+
);
|
32
|
+
}
|
33
|
+
|
25
34
|
return noResultsMessage;
|
26
35
|
}
|
27
36
|
|
@@ -73,25 +82,22 @@ const PropertiesDisplay = ({
|
|
73
82
|
&& loadingNextProperties;
|
74
83
|
|
75
84
|
const insertsAvailable = Array.isArray(inserts) && inserts.length > 0;
|
76
|
-
const insertsFrequency =
|
77
|
-
|
78
|
-
|
85
|
+
const insertsFrequency = insertsAvailable && inserts[0]?.frequency > 0
|
86
|
+
? inserts[0].frequency
|
87
|
+
: null;
|
88
|
+
|
79
89
|
const { propertiesInsertsMap, insertablePropertiesIDList } = useMemo(() => {
|
80
90
|
const propertiesLength = properties.length;
|
81
|
-
const
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
return { propertiesInsertsMap, insertablePropertiesIDList };
|
93
|
-
}
|
94
|
-
return {};
|
91
|
+
const propertiesInsertsMap = new Map();
|
92
|
+
|
93
|
+
inserts.forEach((insert) => {
|
94
|
+
const property = properties[insert.index - 1] || properties[propertiesLength - 1];
|
95
|
+
propertiesInsertsMap.set(property.property_id, insert);
|
96
|
+
});
|
97
|
+
|
98
|
+
const insertablePropertiesIDList = Array.from(propertiesInsertsMap.keys());
|
99
|
+
|
100
|
+
return { propertiesInsertsMap, insertablePropertiesIDList };
|
95
101
|
}, [properties]);
|
96
102
|
|
97
103
|
const handleListElementClick = (id = null) => {
|
@@ -140,8 +146,8 @@ const PropertiesDisplay = ({
|
|
140
146
|
if (findResult) {
|
141
147
|
return (
|
142
148
|
<React.Fragment key={property.property_id}>
|
143
|
-
{findResult.component}
|
144
149
|
<Item property={property} onClick={() => visitPropertyUpdate(property.property_id)} {...other} />
|
150
|
+
{findResult.component}
|
145
151
|
</React.Fragment>
|
146
152
|
);
|
147
153
|
}
|
@@ -199,7 +205,7 @@ PropertiesDisplay.propTypes = {
|
|
199
205
|
};
|
200
206
|
|
201
207
|
PropertiesDisplay.defaultProps = {
|
202
|
-
inserts:
|
208
|
+
inserts: [],
|
203
209
|
InfiniteScrollLoader: null,
|
204
210
|
includePreviousBtn: false,
|
205
211
|
noResultsMessage: <p>There were no properties matching your search.</p>,
|