@comicrelief/component-library 7.3.0 → 7.4.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.
@@ -36,7 +36,7 @@ var Donate = function Donate(_ref) {
36
36
  data = _ref.data,
37
37
  title = _ref.title,
38
38
  subtitle = _ref.subtitle,
39
- otherDescription = _ref.otherDescription,
39
+ otherAmountText = _ref.otherAmountText,
40
40
  formAlignRight = _ref.formAlignRight,
41
41
  images = _ref.images,
42
42
  image = _ref.image,
@@ -107,7 +107,7 @@ var Donate = function Donate(_ref) {
107
107
  size: "m"
108
108
  }, subtitle)))), /*#__PURE__*/_react.default.createElement(_Form.default, {
109
109
  data: data,
110
- otherDescription: otherDescription,
110
+ otherAmountText: otherAmountText,
111
111
  cartID: cartID,
112
112
  clientID: clientID,
113
113
  mbshipID: mbshipID,
@@ -131,7 +131,7 @@ Donate.defaultProps = {
131
131
  mobileAlt: '',
132
132
  backgroundColor: 'blue_dark',
133
133
  mbshipID: null,
134
- otherDescription: 'will help us fund amazing projects in the UK and around the world.',
134
+ otherAmountText: 'will help us fund amazing projects in the UK and around the world.',
135
135
  subtitle: '',
136
136
  noMoneyBuys: false,
137
137
  PopUpText: 'Help us deliver long-term impact by converting your single donation into a monthly gift.',
@@ -22,11 +22,10 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
22
22
  cartID="default-comicrelief"
23
23
  title="Donate Now"
24
24
  subtitle="Please help us fund life-changing projects in the UK and around the world."
25
- otherDescription="will help us fund amazing projects in the UK and around the world."
26
25
  />;
27
26
  ```
28
27
 
29
- ## Form align left
28
+ ## Form align left, with custom message after choosing an "Other amount" to donate.
30
29
 
31
30
  ```js
32
31
  import data from './dev-data/data';
@@ -47,7 +46,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
47
46
  cartID="default-comicrelief"
48
47
  title="Donate Now"
49
48
  subtitle="Please help us fund life-changing projects in the UK and around the world."
50
- otherDescription="will help us fund amazing projects in the UK and around the world."
49
+ otherAmountText="Overridden via the 'Other amount text' prop"
51
50
  />;
52
51
  ```
53
52
 
@@ -72,7 +71,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
72
71
  cartID="default-comicrelief"
73
72
  title="Donate Now"
74
73
  subtitle="Please help us fund life-changing projects in the UK and around the world."
75
- otherDescription="will help us fund amazing projects in the UK and around the world."
76
74
  />;
77
75
  ```
78
76
 
@@ -98,7 +96,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
98
96
  title="Donate Now"
99
97
  noMoneyBuys
100
98
  subtitle="Please help us fund life-changing projects in the UK and around the world."
101
- otherDescription="will help us fund amazing projects in the UK and around the world."
102
99
  />;
103
100
  ```
104
101
 
@@ -124,7 +121,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
124
121
  cartID="default-comicrelief"
125
122
  title="Donate Now"
126
123
  subtitle=""
127
- otherDescription="will help us fund amazing projects in the UK and around the world."
128
124
  />;
129
125
  ```
130
126
 
@@ -149,7 +145,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
149
145
  cartID="default-comicrelief"
150
146
  title="Donate Now"
151
147
  subtitle=""
152
- otherDescription="will help us fund amazing projects in the UK and around the world."
153
148
  />;
154
149
  ```
155
150
 
@@ -174,7 +169,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
174
169
  cartID="default-comicrelief"
175
170
  title="Donate Now"
176
171
  subtitle=""
177
- otherDescription="will help us fund amazing projects in the UK and around the world."
178
172
  />;
179
173
  ```
180
174
 
@@ -200,7 +194,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
200
194
  title="Donate Now"
201
195
  noMoneyBuys
202
196
  subtitle=""
203
- otherDescription="will help us fund amazing projects in the UK and around the world."
204
197
  />;
205
198
  ```
206
199
 
@@ -220,8 +213,7 @@ import data from './dev-data/data-single';
220
213
  title="Donate Now"
221
214
  noMoneyBuys
222
215
  subtitle=""
223
- otherDescription="will help us fund amazing projects in the UK and around the world."
224
- chooseAmountText="Overridden via the 'choose amount text' props"
216
+ chooseAmountText="Overridden via the 'choose amount text' prop"
225
217
  />;
226
218
  ```
227
219
 
@@ -247,7 +239,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
247
239
  cartID="default-comicrelief"
248
240
  title="Donate Now"
249
241
  subtitle="Please help us fund life-changing projects in the UK and around the world."
250
- otherDescription="will help us fund amazing projects in the UK and around the world."
251
242
  isDesktopOverride={false}
252
243
  />;
253
244
  ```
@@ -25,7 +25,7 @@ var _Donate = require("../Donate.style");
25
25
 
26
26
  var _GivingSelector = _interopRequireDefault(require("../GivingSelector/GivingSelector"));
27
27
 
28
- var _excluded = ["data", "donateLink", "otherDescription", "clientID", "cartID", "mbshipID", "noMoneyBuys", "PopUpText", "chooseAmountText"];
28
+ var _excluded = ["data", "donateLink", "otherAmountText", "clientID", "cartID", "mbshipID", "noMoneyBuys", "PopUpText", "chooseAmountText"];
29
29
 
30
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
31
 
@@ -36,7 +36,7 @@ var Signup = function Signup(_ref) {
36
36
  singleGiving = _ref$data.singleGiving,
37
37
  regularGiving = _ref$data.regularGiving,
38
38
  donateLink = _ref.donateLink,
39
- otherDescription = _ref.otherDescription,
39
+ otherAmountText = _ref.otherAmountText,
40
40
  clientID = _ref.clientID,
41
41
  cartID = _ref.cartID,
42
42
  mbshipID = _ref.mbshipID,
@@ -86,7 +86,7 @@ var Signup = function Signup(_ref) {
86
86
  }, [givingType, singleGiving, regularGiving]);
87
87
  (0, _react.useEffect)(function () {
88
88
  var givingData = givingType === 'single' ? singleGiving : regularGiving;
89
- var moneyBuyNewDescription = otherDescription;
89
+ var moneyBuyNewDescription = otherAmountText;
90
90
  givingData.moneybuys.map(function (moneyBuy, index) {
91
91
  if (moneyBuy.value === amountDonate) {
92
92
  moneyBuyNewDescription = moneyBuy.description;
@@ -102,7 +102,7 @@ var Signup = function Signup(_ref) {
102
102
  if (errorMsg) setErrorMsg(false);
103
103
  setMoneyBuyCopy(moneyBuyNewDescription);
104
104
  }
105
- }, [errorMsg, moneyBuyCopy, singleGiving, regularGiving, givingType, amountDonate, otherDescription]); // Updates our flag that differentiates between the popup
105
+ }, [errorMsg, moneyBuyCopy, singleGiving, regularGiving, givingType, amountDonate, otherAmountText]); // Updates our flag that differentiates between the popup
106
106
  // being *currently* open and it *ever* having been shown to user
107
107
 
108
108
  (0, _react.useEffect)(function () {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comicrelief/component-library",
3
3
  "author": "Comic Relief Engineering Team",
4
- "version": "7.3.0",
4
+ "version": "7.4.0",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -23,7 +23,7 @@ const Donate = ({
23
23
  data,
24
24
  title,
25
25
  subtitle,
26
- otherDescription,
26
+ otherAmountText,
27
27
  formAlignRight,
28
28
  images,
29
29
  image,
@@ -105,7 +105,7 @@ const Donate = ({
105
105
 
106
106
  <Form
107
107
  data={data}
108
- otherDescription={otherDescription}
108
+ otherAmountText={otherAmountText}
109
109
  cartID={cartID}
110
110
  clientID={clientID}
111
111
  mbshipID={mbshipID}
@@ -126,7 +126,7 @@ Donate.propTypes = {
126
126
  clientID: PropTypes.string.isRequired,
127
127
  donateLink: PropTypes.string.isRequired,
128
128
  title: PropTypes.string.isRequired,
129
- otherDescription: PropTypes.string,
129
+ otherAmountText: PropTypes.string,
130
130
  subtitle: PropTypes.string,
131
131
  formAlignRight: PropTypes.bool,
132
132
  imageLow: PropTypes.string,
@@ -157,7 +157,7 @@ Donate.defaultProps = {
157
157
  mobileAlt: '',
158
158
  backgroundColor: 'blue_dark',
159
159
  mbshipID: null,
160
- otherDescription:
160
+ otherAmountText:
161
161
  'will help us fund amazing projects in the UK and around the world.',
162
162
  subtitle: '',
163
163
  noMoneyBuys: false,
@@ -22,11 +22,10 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
22
22
  cartID="default-comicrelief"
23
23
  title="Donate Now"
24
24
  subtitle="Please help us fund life-changing projects in the UK and around the world."
25
- otherDescription="will help us fund amazing projects in the UK and around the world."
26
25
  />;
27
26
  ```
28
27
 
29
- ## Form align left
28
+ ## Form align left, with custom message after choosing an "Other amount" to donate.
30
29
 
31
30
  ```js
32
31
  import data from './dev-data/data';
@@ -47,7 +46,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
47
46
  cartID="default-comicrelief"
48
47
  title="Donate Now"
49
48
  subtitle="Please help us fund life-changing projects in the UK and around the world."
50
- otherDescription="will help us fund amazing projects in the UK and around the world."
49
+ otherAmountText="Overridden via the 'Other amount text' prop"
51
50
  />;
52
51
  ```
53
52
 
@@ -72,7 +71,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
72
71
  cartID="default-comicrelief"
73
72
  title="Donate Now"
74
73
  subtitle="Please help us fund life-changing projects in the UK and around the world."
75
- otherDescription="will help us fund amazing projects in the UK and around the world."
76
74
  />;
77
75
  ```
78
76
 
@@ -98,7 +96,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
98
96
  title="Donate Now"
99
97
  noMoneyBuys
100
98
  subtitle="Please help us fund life-changing projects in the UK and around the world."
101
- otherDescription="will help us fund amazing projects in the UK and around the world."
102
99
  />;
103
100
  ```
104
101
 
@@ -124,7 +121,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
124
121
  cartID="default-comicrelief"
125
122
  title="Donate Now"
126
123
  subtitle=""
127
- otherDescription="will help us fund amazing projects in the UK and around the world."
128
124
  />;
129
125
  ```
130
126
 
@@ -149,7 +145,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
149
145
  cartID="default-comicrelief"
150
146
  title="Donate Now"
151
147
  subtitle=""
152
- otherDescription="will help us fund amazing projects in the UK and around the world."
153
148
  />;
154
149
  ```
155
150
 
@@ -174,7 +169,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
174
169
  cartID="default-comicrelief"
175
170
  title="Donate Now"
176
171
  subtitle=""
177
- otherDescription="will help us fund amazing projects in the UK and around the world."
178
172
  />;
179
173
  ```
180
174
 
@@ -200,7 +194,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
200
194
  title="Donate Now"
201
195
  noMoneyBuys
202
196
  subtitle=""
203
- otherDescription="will help us fund amazing projects in the UK and around the world."
204
197
  />;
205
198
  ```
206
199
 
@@ -220,8 +213,7 @@ import data from './dev-data/data-single';
220
213
  title="Donate Now"
221
214
  noMoneyBuys
222
215
  subtitle=""
223
- otherDescription="will help us fund amazing projects in the UK and around the world."
224
- chooseAmountText="Overridden via the 'choose amount text' props"
216
+ chooseAmountText="Overridden via the 'choose amount text' prop"
225
217
  />;
226
218
  ```
227
219
 
@@ -247,7 +239,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
247
239
  cartID="default-comicrelief"
248
240
  title="Donate Now"
249
241
  subtitle="Please help us fund life-changing projects in the UK and around the world."
250
- otherDescription="will help us fund amazing projects in the UK and around the world."
251
242
  isDesktopOverride={false}
252
243
  />;
253
244
  ```
@@ -26,7 +26,7 @@ import GivingSelector from '../GivingSelector/GivingSelector';
26
26
  const Signup = ({
27
27
  data: { singleGiving, regularGiving },
28
28
  donateLink,
29
- otherDescription,
29
+ otherAmountText,
30
30
  clientID,
31
31
  cartID,
32
32
  mbshipID,
@@ -59,7 +59,7 @@ const Signup = ({
59
59
  useEffect(() => {
60
60
  const givingData = givingType === 'single' ? singleGiving : regularGiving;
61
61
 
62
- let moneyBuyNewDescription = otherDescription;
62
+ let moneyBuyNewDescription = otherAmountText;
63
63
 
64
64
  givingData.moneybuys.map((moneyBuy, index) => {
65
65
  if (moneyBuy.value === amountDonate) {
@@ -88,7 +88,7 @@ const Signup = ({
88
88
  regularGiving,
89
89
  givingType,
90
90
  amountDonate,
91
- otherDescription
91
+ otherAmountText
92
92
  ]);
93
93
 
94
94
  // Updates our flag that differentiates between the popup
@@ -230,7 +230,7 @@ Signup.propTypes = {
230
230
  clientID: PropTypes.string.isRequired,
231
231
  cartID: PropTypes.string.isRequired,
232
232
  donateLink: PropTypes.string.isRequired,
233
- otherDescription: PropTypes.string.isRequired,
233
+ otherAmountText: PropTypes.string.isRequired,
234
234
  mbshipID: PropTypes.string.isRequired,
235
235
  noMoneyBuys: PropTypes.bool,
236
236
  data: PropTypes.objectOf(PropTypes.shape),