@woosmap/ui 4.164.5 → 4.164.6
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
|
@@ -14,22 +14,21 @@ class PricingSlider extends Component {
|
|
|
14
14
|
return queries;
|
|
15
15
|
}
|
|
16
16
|
return pricing.reduce((amount, tier, index) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
q -= valueToRemove;
|
|
23
|
-
return amount + (valueToRemove / 1000) * tier[1] * coef;
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
const valueToRemove = Math.min(tier[0], q);
|
|
17
|
+
previousPricingTier = index > 0 ? pricing[index - 1] : null;
|
|
18
|
+
|
|
19
|
+
if (previousPricingTier !== null) {
|
|
20
|
+
const valueToRemove = Math.min(tier[0] - previousPricingTier[0], q);
|
|
21
|
+
if (valueToRemove > 0) {
|
|
27
22
|
q -= valueToRemove;
|
|
28
23
|
return amount + (valueToRemove / 1000) * tier[1] * coef;
|
|
29
24
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
} else {
|
|
26
|
+
const valueToRemove = Math.min(tier[0], q);
|
|
27
|
+
q -= valueToRemove;
|
|
28
|
+
return amount + (valueToRemove / 1000) * tier[1] * coef;
|
|
29
|
+
}
|
|
30
|
+
return Math.floor(amount);
|
|
31
|
+
}, 0);
|
|
33
32
|
};
|
|
34
33
|
|
|
35
34
|
computeQueries = (valueNow) => {
|
|
@@ -171,6 +170,7 @@ class PricingSlider extends Component {
|
|
|
171
170
|
renderMark={this.renderMarks}
|
|
172
171
|
pearling
|
|
173
172
|
min={0}
|
|
173
|
+
step={1000}
|
|
174
174
|
onChange={(_queries) => {
|
|
175
175
|
this.onChange(_queries);
|
|
176
176
|
}}
|