@financial-times/n-conversion-forms 44.4.3 → 44.5.1
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/.toolkitstate/ci.json
CHANGED
|
@@ -27,7 +27,7 @@ exports[`PaymentTerm When using custom options renders when not using an option
|
|
|
27
27
|
</span>
|
|
28
28
|
<div>
|
|
29
29
|
<span class="ncf__payment-term__large-price">
|
|
30
|
-
€
|
|
30
|
+
€270.00
|
|
31
31
|
</span>
|
|
32
32
|
<p class="ncf__payment-term__charge-on-text">
|
|
33
33
|
You will be charged on May 1, 2021
|
|
@@ -54,7 +54,7 @@ exports[`PaymentTerm When using custom options renders when not using an option
|
|
|
54
54
|
</span>
|
|
55
55
|
<div>
|
|
56
56
|
<span class="ncf__payment-term__large-price">
|
|
57
|
-
€
|
|
57
|
+
€300.00
|
|
58
58
|
</span>
|
|
59
59
|
<p class="ncf__payment-term__charge-on-text">
|
|
60
60
|
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
|
-
{
|
|
256
|
+
{new Price({
|
|
257
|
+
value: option.price,
|
|
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,7 @@ describe('PaymentTerm', () => {
|
|
|
265
265
|
title: 'Annual',
|
|
266
266
|
subTitle: '(Renews annually unless cancelled)',
|
|
267
267
|
price: '€ 270.00',
|
|
268
|
+
symbol: '€',
|
|
268
269
|
value: 270.0,
|
|
269
270
|
isTrial: false,
|
|
270
271
|
discount: '33%',
|
|
@@ -275,6 +276,7 @@ describe('PaymentTerm', () => {
|
|
|
275
276
|
{
|
|
276
277
|
title: '12 Month Subscription',
|
|
277
278
|
price: '€ 300.00',
|
|
279
|
+
symbol: '€',
|
|
278
280
|
value: 300.0,
|
|
279
281
|
isTrial: false,
|
|
280
282
|
discount: '10%',
|
package/dist/payment-term.jsx
CHANGED
|
@@ -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
|
-
},
|
|
207
|
+
}, new _nPricing.Price({
|
|
208
|
+
value: option.price,
|
|
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.
|
|
3
|
+
"version": "44.5.1",
|
|
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": {
|