@financial-times/n-conversion-forms 44.4.3 → 44.5.0

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "branch": "",
3
3
  "repo": "n-conversion-forms",
4
- "version": "83abecced3df7a810373dfd78e74132d0b45f14a",
5
- "tag": "v44.4.3",
6
- "buildNumber": "17363"
4
+ "version": "b5701ec726caa486c364874cd38b94dc91b23a04",
5
+ "tag": "v44.5.0",
6
+ "buildNumber": "17440"
7
7
  }
@@ -9,6 +9,7 @@ exports[`PaymentTerm When using custom options renders when not using an option
9
9
  <div class="ncf__payment-term__item o-forms-input--radio-round ncf__payment-term__item--discount">
10
10
  <input type="radio"
11
11
  id="270"
12
+ data-base-amount="270"
12
13
  name="paymentTerm"
13
14
  value="270"
14
15
  class="o-forms-input__radio o-forms-input__radio--right ncf__payment-term__input"
@@ -27,7 +28,7 @@ exports[`PaymentTerm When using custom options renders when not using an option
27
28
  </span>
28
29
  <div>
29
30
  <span class="ncf__payment-term__large-price">
30
- 270.00
31
+ €270.00
31
32
  </span>
32
33
  <p class="ncf__payment-term__charge-on-text">
33
34
  You will be charged on May 1, 2021
@@ -38,6 +39,7 @@ exports[`PaymentTerm When using custom options renders when not using an option
38
39
  <div class="ncf__payment-term__item o-forms-input--radio-round ncf__payment-term__item--discount">
39
40
  <input type="radio"
40
41
  id="300"
42
+ data-base-amount="300"
41
43
  name="paymentTerm"
42
44
  value="300"
43
45
  class="o-forms-input__radio o-forms-input__radio--right ncf__payment-term__input"
@@ -54,7 +56,7 @@ exports[`PaymentTerm When using custom options renders when not using an option
54
56
  </span>
55
57
  <div>
56
58
  <span class="ncf__payment-term__large-price">
57
- 300.00
59
+ €300.00
58
60
  </span>
59
61
  <p class="ncf__payment-term__charge-on-text">
60
62
  You will be charged on May 1, 2021
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
- import { Period, Monthly } from '@financial-times/n-pricing';
4
+ import { Period, Monthly, Price } from '@financial-times/n-pricing';
5
5
 
6
6
  export function PaymentTerm({
7
7
  fieldId = 'paymentTermField',
@@ -210,6 +210,7 @@ export function PaymentTerm({
210
210
  )
211
211
  );
212
212
  };
213
+
213
214
  const createDescription = () => {
214
215
  return option.isTrial ? (
215
216
  <div className="ncf__payment-term__description">
@@ -252,7 +253,10 @@ export function PaymentTerm({
252
253
  <span
253
254
  className={largePrice ? 'ncf__payment-term__large-price' : ''}
254
255
  >
255
- {option.price}
256
+ {new Price({
257
+ value: option.amount,
258
+ symbol: option.symbol,
259
+ }).getAmountFormatted()}
256
260
  </span>
257
261
  {option.chargeOnText && (
258
262
  <p className="ncf__payment-term__charge-on-text">
@@ -265,6 +265,8 @@ describe('PaymentTerm', () => {
265
265
  title: 'Annual',
266
266
  subTitle: '(Renews annually unless cancelled)',
267
267
  price: '€ 270.00',
268
+ symbol: '€',
269
+ amount: 270.0,
268
270
  value: 270.0,
269
271
  isTrial: false,
270
272
  discount: '33%',
@@ -275,6 +277,8 @@ describe('PaymentTerm', () => {
275
277
  {
276
278
  title: '12 Month Subscription',
277
279
  price: '€ 300.00',
280
+ symbol: '€',
281
+ amount: 300.0,
278
282
  value: 300.0,
279
283
  isTrial: false,
280
284
  discount: '10%',
@@ -204,7 +204,10 @@ function PaymentTerm(_ref) {
204
204
  className: "ncf__payment-term__description"
205
205
  }, nameMap['custom'].price(option.price), nameMap['custom'].monthlyPrice(option.monthlyPrice && option.monthlyPrice !== '0' ? Number(option.monthlyPrice) : getMonthlyPriceFromPeriod(option.amount, option.currency, option.value)), nameMap['custom'].renewsText(getTimeFromPeriod(option.value))) : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
206
206
  className: largePrice ? 'ncf__payment-term__large-price' : ''
207
- }, option.price), option.chargeOnText && /*#__PURE__*/_react["default"].createElement("p", {
207
+ }, new _nPricing.Price({
208
+ value: option.amount,
209
+ symbol: option.symbol
210
+ }).getAmountFormatted()), option.chargeOnText && /*#__PURE__*/_react["default"].createElement("p", {
208
211
  className: "ncf__payment-term__charge-on-text"
209
212
  }, option.chargeOnText)));
210
213
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-conversion-forms",
3
- "version": "44.4.3",
3
+ "version": "44.5.0",
4
4
  "description": "Containing jsx components and styles for forms included on Accounts and Acquisition apps (next-signup, next-profile, next-retention, etc).",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {