@woosmap/ui 4.226.11 → 4.226.13

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@woosmap/ui",
3
- "version": "4.226.11",
3
+ "version": "4.226.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/WebGeoServices/ui.git"
@@ -25,8 +25,6 @@ export default class PricingSlider extends Component {
25
25
  };
26
26
 
27
27
  computeAmount = (pricing, queries) => {
28
- const { currency } = this.props;
29
- const coef = currency === '$' ? 0.9 : 1;
30
28
  let q = queries;
31
29
  let previousPricingTier;
32
30
  if (queries === '∞') {
@@ -39,12 +37,12 @@ export default class PricingSlider extends Component {
39
37
  const valueToRemove = Math.min(tier[0] - previousPricingTier[0], q);
40
38
  if (valueToRemove > 0) {
41
39
  q -= valueToRemove;
42
- return amount + ((valueToRemove / 1000) * tier[1]) / coef;
40
+ return amount + (valueToRemove / 1000) * tier[1];
43
41
  }
44
42
  } else {
45
43
  const valueToRemove = Math.min(tier[0], q);
46
44
  q -= valueToRemove;
47
- return amount + ((valueToRemove / 1000) * tier[1]) / coef;
45
+ return amount + (valueToRemove / 1000) * tier[1];
48
46
  }
49
47
  return Math.floor(amount);
50
48
  }, 0);
@@ -169,49 +167,45 @@ export default class PricingSlider extends Component {
169
167
  }
170
168
  };
171
169
 
172
- displayDetails = (displayedPricing, unit) => {
173
- const { currency } = this.props;
174
- const coef = currency === '$' ? 0.9 : 1;
175
- return (
176
- <div className="pricing-slider__detailed-price">
177
- <table>
178
- <tr>
179
- <td>
180
- <strong>{unit}</strong>
181
- </td>
182
- <td>
183
- <strong>{tr('Cost per 1000')}</strong>
184
- </td>
185
- </tr>
186
- {displayedPricing.map((tier, index) => {
187
- const lower = index > 0 ? displayedPricing[index - 1][0] : 0;
188
- if (index === displayedPricing.length - 1) {
189
- return (
190
- <tr>
191
- <td>{`${numeral(lower).format('0.[0]a')}+`}</td>
192
- <td>{tr('Contact us for discount')}</td>
193
- </tr>
194
- );
195
- }
196
- if (index === displayedPricing.length - 2) {
197
- return (
198
- <tr>
199
- <td>{`${numeral(lower).format('0.[0]a')}+`}</td>
200
- <td>{this.displayAmount((tier[1] / coef).toFixed(2))}</td>
201
- </tr>
202
- );
203
- }
170
+ displayDetails = (displayedPricing, unit) => (
171
+ <div className="pricing-slider__detailed-price">
172
+ <table>
173
+ <tr>
174
+ <td>
175
+ <strong>{unit}</strong>
176
+ </td>
177
+ <td>
178
+ <strong>{tr('Cost per 1000')}</strong>
179
+ </td>
180
+ </tr>
181
+ {displayedPricing.map((tier, index) => {
182
+ const lower = index > 0 ? displayedPricing[index - 1][0] : 0;
183
+ if (index === displayedPricing.length - 1) {
204
184
  return (
205
185
  <tr>
206
- <td>{`${numeral(lower).format('0.[0]a')} to ${numeral(tier[0]).format('0.[0]a')}`}</td>
207
- <td>{this.displayAmount((tier[1] / coef).toFixed(2))}</td>
186
+ <td>{`${numeral(lower).format('0.[0]a')}+`}</td>
187
+ <td>{tr('Contact us for discount')}</td>
208
188
  </tr>
209
189
  );
210
- })}
211
- </table>
212
- </div>
213
- );
214
- };
190
+ }
191
+ if (index === displayedPricing.length - 2) {
192
+ return (
193
+ <tr>
194
+ <td>{`${numeral(lower).format('0.[0]a')}+`}</td>
195
+ <td>{this.displayAmount(tier[1].toFixed(2))}</td>
196
+ </tr>
197
+ );
198
+ }
199
+ return (
200
+ <tr>
201
+ <td>{`${numeral(lower).format('0.[0]a')} to ${numeral(tier[0]).format('0.[0]a')}`}</td>
202
+ <td>{this.displayAmount(tier[1].toFixed(2))}</td>
203
+ </tr>
204
+ );
205
+ })}
206
+ </table>
207
+ </div>
208
+ );
215
209
 
216
210
  render() {
217
211
  const { name, productPricing, values, id } = this.props;
@@ -275,7 +269,7 @@ export default class PricingSlider extends Component {
275
269
  {displayedAmount}
276
270
  </div>
277
271
  </div>
278
- {displayedPricing.length > 0 && (
272
+ {displayedPricing.length > 1 && (
279
273
  <div className="pricing-slider__detailed-price-wrapper">
280
274
  <Button
281
275
  className="pricing-slider__detailed-price-btn"