@woosmap/ui 4.162.4 → 4.162.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
|
@@ -2,7 +2,6 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import PricingSlider from './PricingSlider';
|
|
4
4
|
import PricingData from './PricingData';
|
|
5
|
-
import pricingData from './PricingData';
|
|
6
5
|
|
|
7
6
|
class PricingSimulator extends Component {
|
|
8
7
|
constructor(props) {
|
|
@@ -36,14 +35,18 @@ class PricingSimulator extends Component {
|
|
|
36
35
|
Object.keys(sliders).forEach((category) => {
|
|
37
36
|
Object.keys(sliders[category]).forEach((pricingKey) => {
|
|
38
37
|
const { discountEligible } = PricingData[category].pricings[pricingKey];
|
|
38
|
+
const { amount } = sliders[category];
|
|
39
|
+
if (Number.isNaN(amount) || Number.isNaN(sliders[category].queries)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
39
42
|
if (discountEligible) {
|
|
40
43
|
if (!Number.isNaN(freeQueriesTotal)) {
|
|
41
44
|
freeQueriesTotal += sliders[category].queries;
|
|
42
45
|
}
|
|
43
|
-
eligibleTotal +=
|
|
46
|
+
eligibleTotal += amount;
|
|
44
47
|
} else if (sliders[category].queries > 0) {
|
|
45
48
|
freeQueriesTotal = false;
|
|
46
|
-
notEligibleTotal +=
|
|
49
|
+
notEligibleTotal += amount;
|
|
47
50
|
}
|
|
48
51
|
});
|
|
49
52
|
});
|
|
@@ -98,7 +101,7 @@ class PricingSimulator extends Component {
|
|
|
98
101
|
key={`pricing_${pricingKey.replace(' ', '')}`}
|
|
99
102
|
publicMode={publicMode}
|
|
100
103
|
currency={currency}
|
|
101
|
-
values={sliders[category
|
|
104
|
+
values={sliders[category][pricingKey]}
|
|
102
105
|
onChange={this.onChange(category, pricingKey)}
|
|
103
106
|
/>
|
|
104
107
|
);
|