@financial-times/n-conversion-forms 28.6.0 → 28.7.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,5 +1,125 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`B2CPartnershipConfirmation renders Premium access for premium subscription 1`] = `
4
+ <div class="ncf ncf__wrapper">
5
+ <div class="ncf__center">
6
+ <div class="ncf__icon ncf__icon--tick ncf__icon--large">
7
+ </div>
8
+ <div class="ncf__paragraph">
9
+ <h1 class="ncf__header ncf__header--confirmation">
10
+ Welcome to your Premium access
11
+ </h1>
12
+ </div>
13
+ </div>
14
+ <p class="ncf__paragraph">
15
+ Please check your email to confirm your account and set your password.
16
+ </p>
17
+ <p class="ncf__paragraph">
18
+ Explore the homepage &amp; enjoy your unlimited access &amp; exclusive content.
19
+ </p>
20
+ hello
21
+ <p class="ncf__paragraph ncf__center">
22
+ <a href="/"
23
+ class="ncf__link"
24
+ >
25
+ Start reading
26
+ </a>
27
+ </p>
28
+ <p class="ncf__paragraph">
29
+ <div class="ncf__strong">
30
+ Can we help?
31
+ </div>
32
+ For any queries about your Premium subscription please
33
+ <a href="https://help.ft.com/"
34
+ class="ncf__link"
35
+ >
36
+ contact Customer Care
37
+ </a>
38
+ .
39
+ </p>
40
+ </div>
41
+ `;
42
+
43
+ exports[`B2CPartnershipConfirmation renders Premium access if subscription prop is null 1`] = `
44
+ <div class="ncf ncf__wrapper">
45
+ <div class="ncf__center">
46
+ <div class="ncf__icon ncf__icon--tick ncf__icon--large">
47
+ </div>
48
+ <div class="ncf__paragraph">
49
+ <h1 class="ncf__header ncf__header--confirmation">
50
+ Welcome to your Premium access
51
+ </h1>
52
+ </div>
53
+ </div>
54
+ <p class="ncf__paragraph">
55
+ Please check your email to confirm your account and set your password.
56
+ </p>
57
+ <p class="ncf__paragraph">
58
+ Explore the homepage &amp; enjoy your unlimited access &amp; exclusive content.
59
+ </p>
60
+ hello
61
+ <p class="ncf__paragraph ncf__center">
62
+ <a href="/"
63
+ class="ncf__link"
64
+ >
65
+ Start reading
66
+ </a>
67
+ </p>
68
+ <p class="ncf__paragraph">
69
+ <div class="ncf__strong">
70
+ Can we help?
71
+ </div>
72
+ For any queries about your Premium subscription please
73
+ <a href="https://help.ft.com/"
74
+ class="ncf__link"
75
+ >
76
+ contact Customer Care
77
+ </a>
78
+ .
79
+ </p>
80
+ </div>
81
+ `;
82
+
83
+ exports[`B2CPartnershipConfirmation renders Standard access for standard subscription 1`] = `
84
+ <div class="ncf ncf__wrapper">
85
+ <div class="ncf__center">
86
+ <div class="ncf__icon ncf__icon--tick ncf__icon--large">
87
+ </div>
88
+ <div class="ncf__paragraph">
89
+ <h1 class="ncf__header ncf__header--confirmation">
90
+ Welcome to your Standard access
91
+ </h1>
92
+ </div>
93
+ </div>
94
+ <p class="ncf__paragraph">
95
+ Please check your email to confirm your account and set your password.
96
+ </p>
97
+ <p class="ncf__paragraph">
98
+ Explore the homepage &amp; enjoy your unlimited access &amp; exclusive content.
99
+ </p>
100
+ hello
101
+ <p class="ncf__paragraph ncf__center">
102
+ <a href="/"
103
+ class="ncf__link"
104
+ >
105
+ Start reading
106
+ </a>
107
+ </p>
108
+ <p class="ncf__paragraph">
109
+ <div class="ncf__strong">
110
+ Can we help?
111
+ </div>
112
+ For any queries about your Premium subscription please
113
+ <a href="https://help.ft.com/"
114
+ class="ncf__link"
115
+ >
116
+ contact Customer Care
117
+ </a>
118
+ .
119
+ </p>
120
+ </div>
121
+ `;
122
+
3
123
  exports[`B2CPartnershipConfirmation renders as default 1`] = `
4
124
  <div class="ncf ncf__wrapper">
5
125
  <div class="ncf__center">
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- export function B2CPartnershipConfirmation({ ctaElement = null }) {
4
+ export function B2CPartnershipConfirmation({
5
+ ctaElement = null,
6
+ productCode = null,
7
+ }) {
5
8
  const readingLinkProps = {
6
9
  href: '/',
7
10
  className: 'ncf__link',
@@ -12,6 +15,9 @@ export function B2CPartnershipConfirmation({ ctaElement = null }) {
12
15
  className: 'ncf__link',
13
16
  };
14
17
 
18
+ const accessType =
19
+ productCode?.toUpperCase() === 'P1' ? 'Standard' : 'Premium';
20
+
15
21
  return (
16
22
  <div className="ncf ncf__wrapper">
17
23
  <div className="ncf__center">
@@ -19,7 +25,7 @@ export function B2CPartnershipConfirmation({ ctaElement = null }) {
19
25
  <div className="ncf__paragraph">
20
26
  {
21
27
  <h1 className="ncf__header ncf__header--confirmation">
22
- {'Welcome to your Premium access'}
28
+ {`Welcome to your ${accessType} access`}
23
29
  </h1>
24
30
  }
25
31
  </div>
@@ -57,4 +63,5 @@ export function B2CPartnershipConfirmation({ ctaElement = null }) {
57
63
 
58
64
  B2CPartnershipConfirmation.propTypes = {
59
65
  ctaElement: PropTypes.node,
66
+ productCode: PropTypes.string,
60
67
  };
@@ -9,4 +9,22 @@ describe('B2CPartnershipConfirmation', () => {
9
9
 
10
10
  expect(B2CPartnershipConfirmation).toRenderCorrectly(props);
11
11
  });
12
+
13
+ it('renders Premium access for premium subscription', () => {
14
+ const props = { ctaElement: 'hello', productCode: 'p2' };
15
+
16
+ expect(B2CPartnershipConfirmation).toRenderCorrectly(props);
17
+ });
18
+
19
+ it('renders Standard access for standard subscription', () => {
20
+ const props = { ctaElement: 'hello', productCode: 'p1' };
21
+
22
+ expect(B2CPartnershipConfirmation).toRenderCorrectly(props);
23
+ });
24
+
25
+ it('renders Premium access if subscription prop is null', () => {
26
+ const props = { ctaElement: 'hello', productCode: null };
27
+
28
+ expect(B2CPartnershipConfirmation).toRenderCorrectly(props);
29
+ });
12
30
  });
@@ -9,7 +9,9 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  function B2CPartnershipConfirmation(_ref) {
11
11
  var _ref$ctaElement = _ref.ctaElement,
12
- ctaElement = _ref$ctaElement === void 0 ? null : _ref$ctaElement;
12
+ ctaElement = _ref$ctaElement === void 0 ? null : _ref$ctaElement,
13
+ _ref$productCode = _ref.productCode,
14
+ productCode = _ref$productCode === void 0 ? null : _ref$productCode;
13
15
  var readingLinkProps = {
14
16
  href: '/',
15
17
  className: 'ncf__link'
@@ -18,6 +20,7 @@ function B2CPartnershipConfirmation(_ref) {
18
20
  href: 'https://help.ft.com/',
19
21
  className: 'ncf__link'
20
22
  };
23
+ var accessType = (productCode === null || productCode === void 0 ? void 0 : productCode.toUpperCase()) === 'P1' ? 'Standard' : 'Premium';
21
24
  return /*#__PURE__*/_react["default"].createElement("div", {
22
25
  className: "ncf ncf__wrapper"
23
26
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -28,7 +31,7 @@ function B2CPartnershipConfirmation(_ref) {
28
31
  className: "ncf__paragraph"
29
32
  }, /*#__PURE__*/_react["default"].createElement("h1", {
30
33
  className: "ncf__header ncf__header--confirmation"
31
- }, 'Welcome to your Premium access'))), /*#__PURE__*/_react["default"].createElement("p", {
34
+ }, "Welcome to your ".concat(accessType, " access")))), /*#__PURE__*/_react["default"].createElement("p", {
32
35
  className: "ncf__paragraph"
33
36
  }, "Please check your email to confirm your account and set your password."), /*#__PURE__*/_react["default"].createElement("p", {
34
37
  className: "ncf__paragraph"
@@ -46,5 +49,6 @@ function B2CPartnershipConfirmation(_ref) {
46
49
  }, "Can we help?"), "For any queries about your Premium subscription please", ' ', /*#__PURE__*/_react["default"].createElement("a", customerCareProps, "contact Customer Care"), "."));
47
50
  }
48
51
  B2CPartnershipConfirmation.propTypes = {
49
- ctaElement: _propTypes["default"].node
52
+ ctaElement: _propTypes["default"].node,
53
+ productCode: _propTypes["default"].string
50
54
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-conversion-forms",
3
- "version": "28.6.0",
3
+ "version": "28.7.0",
4
4
  "description": "Containing jsx components and styles for forms included on Accounts and Acqusition apps (next-signup, next-profile, next-retention, etc).",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {