@comicrelief/component-library 7.24.2 → 7.25.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.
@@ -40,7 +40,9 @@ const Donate = _ref => {
40
40
  PopUpText,
41
41
  chooseAmountText,
42
42
  isDesktopOverride,
43
- otherAmountValue
43
+ otherAmountValue,
44
+ additionalSingleCopy,
45
+ additionalMonthlyCopy
44
46
  } = _ref;
45
47
  let isDesktop = (0, _reactResponsive.useMediaQuery)({
46
48
  query: "(min-width: ".concat(_size.screen.medium, ")")
@@ -107,7 +109,9 @@ const Donate = _ref => {
107
109
  PopUpText: PopUpText,
108
110
  chooseAmountText: chooseAmountText,
109
111
  submitButtonColor: submitButtonColor,
110
- otherAmountValue: otherAmountValue
112
+ otherAmountValue: otherAmountValue,
113
+ additionalSingleCopy: additionalSingleCopy,
114
+ additionalMonthlyCopy: additionalMonthlyCopy
111
115
  })));
112
116
  };
113
117
  Donate.defaultProps = {
@@ -133,6 +137,8 @@ Donate.defaultProps = {
133
137
  chooseAmountText: '',
134
138
  isDesktopOverride: null,
135
139
  otherAmountValue: null,
136
- title: null
140
+ title: null,
141
+ additionalSingleCopy: null,
142
+ additionalMonthlyCopy: null
137
143
  };
138
144
  var _default = exports.default = Donate;
@@ -354,3 +354,88 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
354
354
  isDesktopOverride={false}
355
355
  />;
356
356
  ```
357
+
358
+ ## Additional copy for BOTH giving types
359
+
360
+ ```js
361
+ import data from './dev-data/data';
362
+ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
363
+ const desktopPictures = require('../../../styleguide/data/data').defaultData;
364
+
365
+ <Donate
366
+ alt="Background image"
367
+ mobileBackgroundColor="deep_violet_dark"
368
+ desktopOverlayColor="red"
369
+ submitButtonColor="blue_dark"
370
+ formAlignRight={true}
371
+ imageLow={desktopPictures.imageLow}
372
+ images={desktopPictures.images}
373
+ mobileImageLow={mobilePictures.imageLow}
374
+ mobileImages={mobilePictures.images}
375
+ data={data}
376
+ mbshipID="mship-11"
377
+ donateLink="https://donation.comicrelief.com/"
378
+ clientID="donate"
379
+ cartID="default-comicrelief"
380
+ title="Donate Now"
381
+ subtitle="Please help us fund life-changing projects in the UK and around the world."
382
+ additionalSingleCopy="Some additional single giving copy - Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa."
383
+ additionalMonthlyCopy="Some additional regular giving copy! - Quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos."
384
+ />;
385
+ ```
386
+
387
+ ## Additional copy for monthly only
388
+
389
+ ```js
390
+ import data from './dev-data/data';
391
+ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
392
+ const desktopPictures = require('../../../styleguide/data/data').defaultData;
393
+
394
+ <Donate
395
+ alt="Background image"
396
+ mobileBackgroundColor="deep_violet_dark"
397
+ desktopOverlayColor="red"
398
+ submitButtonColor="blue_dark"
399
+ formAlignRight={true}
400
+ imageLow={desktopPictures.imageLow}
401
+ images={desktopPictures.images}
402
+ mobileImageLow={mobilePictures.imageLow}
403
+ mobileImages={mobilePictures.images}
404
+ data={data}
405
+ mbshipID="mship-12"
406
+ donateLink="https://donation.comicrelief.com/"
407
+ clientID="donate"
408
+ cartID="default-comicrelief"
409
+ title="Donate Now"
410
+ subtitle="Please help us fund life-changing projects in the UK and around the world."
411
+ additionalMonthlyCopy="Some additional regular giving copy! - Quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos."
412
+ />;
413
+ ```
414
+
415
+ ## Additional copy for single only
416
+
417
+ ```js
418
+ import data from './dev-data/data';
419
+ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
420
+ const desktopPictures = require('../../../styleguide/data/data').defaultData;
421
+
422
+ <Donate
423
+ alt="Background image"
424
+ mobileBackgroundColor="deep_violet_dark"
425
+ desktopOverlayColor="red"
426
+ submitButtonColor="blue_dark"
427
+ formAlignRight={true}
428
+ imageLow={desktopPictures.imageLow}
429
+ images={desktopPictures.images}
430
+ mobileImageLow={mobilePictures.imageLow}
431
+ mobileImages={mobilePictures.images}
432
+ data={data}
433
+ mbshipID="mship-13"
434
+ donateLink="https://donation.comicrelief.com/"
435
+ clientID="donate"
436
+ cartID="default-comicrelief"
437
+ title="Donate Now"
438
+ subtitle="Please help us fund life-changing projects in the UK and around the world."
439
+ additionalSingleCopy="Some additional single giving copy - Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa."
440
+ />;
441
+ ```
@@ -29,6 +29,8 @@ const Signup = _ref => {
29
29
  chooseAmountText,
30
30
  submitButtonColor,
31
31
  otherAmountValue,
32
+ additionalSingleCopy,
33
+ additionalMonthlyCopy,
32
34
  ...rest
33
35
  } = _ref;
34
36
  const [givingType, setGivingType] = (0, _react.useState)('single');
@@ -137,6 +139,9 @@ const Signup = _ref => {
137
139
  }
138
140
  return "Donate \xA3".concat(amountDonate, " monthly");
139
141
  };
142
+ const showAdditionalSingleCopy = givingType === 'single' && additionalSingleCopy;
143
+ const showAdditionalMonthlyCopy = givingType === 'monthly' && additionalMonthlyCopy;
144
+ const additionalCopy = showAdditionalSingleCopy || showAdditionalMonthlyCopy;
140
145
  return /*#__PURE__*/_react.default.createElement(_Donate.FormWrapper, null, showGivingSelector && /*#__PURE__*/_react.default.createElement(_GivingSelector.default, {
141
146
  givingType: givingType,
142
147
  changeGivingType: data => setGivingType(data),
@@ -191,7 +196,9 @@ const Signup = _ref => {
191
196
  }, /*#__PURE__*/_react.default.createElement("strong", null, "\xA3".concat(amountDonate, " ")), moneyBuyCopy), errorMsg && /*#__PURE__*/_react.default.createElement(_Donate.Error, {
192
197
  className: "error--amount",
193
198
  tag: "p"
194
- }, "Please enter an amount between \xA31 and \xA325000 and up to 2 decimal places"), noMoneyBuys ? /*#__PURE__*/_react.default.createElement(_Donate.Button, {
199
+ }, "Please enter an amount between \xA31 and \xA325000 and up to 2 decimal places"), additionalCopy && /*#__PURE__*/_react.default.createElement("p", {
200
+ className: "additional-copy"
201
+ }, /*#__PURE__*/_react.default.createElement("strong", null, additionalCopy)), noMoneyBuys ? /*#__PURE__*/_react.default.createElement(_Donate.Button, {
195
202
  type: "submit",
196
203
  color: submitButtonColor
197
204
  }, errorMsg ? 'Donate' : "Donate \xA3".concat(amountDonate)) : /*#__PURE__*/_react.default.createElement(_Donate.Button, {
@@ -203,6 +210,8 @@ const Signup = _ref => {
203
210
  Signup.defaultProps = {
204
211
  noMoneyBuys: false,
205
212
  otherAmountValue: null,
206
- data: {}
213
+ data: {},
214
+ additionalSingleCopy: null,
215
+ additionalMonthlyCopy: null
207
216
  };
208
217
  var _default = exports.default = Signup;
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.24.2",
4
+ "version": "7.25.0",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -40,7 +40,9 @@ const Donate = ({
40
40
  PopUpText,
41
41
  chooseAmountText,
42
42
  isDesktopOverride,
43
- otherAmountValue
43
+ otherAmountValue,
44
+ additionalSingleCopy,
45
+ additionalMonthlyCopy
44
46
  }) => {
45
47
  let isDesktop = useMediaQuery({ query: `(min-width: ${screen.medium})` });
46
48
 
@@ -127,6 +129,8 @@ const Donate = ({
127
129
  chooseAmountText={chooseAmountText}
128
130
  submitButtonColor={submitButtonColor}
129
131
  otherAmountValue={otherAmountValue}
132
+ additionalSingleCopy={additionalSingleCopy}
133
+ additionalMonthlyCopy={additionalMonthlyCopy}
130
134
  />
131
135
  </Wrapper>
132
136
  </Container>
@@ -159,7 +163,9 @@ Donate.propTypes = {
159
163
  PopUpText: PropTypes.string,
160
164
  chooseAmountText: PropTypes.string,
161
165
  isDesktopOverride: PropTypes.bool,
162
- otherAmountValue: PropTypes.number
166
+ otherAmountValue: PropTypes.number,
167
+ additionalSingleCopy: PropTypes.string,
168
+ additionalMonthlyCopy: PropTypes.string
163
169
  };
164
170
 
165
171
  Donate.defaultProps = {
@@ -186,7 +192,9 @@ Donate.defaultProps = {
186
192
  chooseAmountText: '',
187
193
  isDesktopOverride: null,
188
194
  otherAmountValue: null,
189
- title: null
195
+ title: null,
196
+ additionalSingleCopy: null,
197
+ additionalMonthlyCopy: null
190
198
  };
191
199
 
192
200
  export default Donate;
@@ -354,3 +354,88 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
354
354
  isDesktopOverride={false}
355
355
  />;
356
356
  ```
357
+
358
+ ## Additional copy for BOTH giving types
359
+
360
+ ```js
361
+ import data from './dev-data/data';
362
+ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
363
+ const desktopPictures = require('../../../styleguide/data/data').defaultData;
364
+
365
+ <Donate
366
+ alt="Background image"
367
+ mobileBackgroundColor="deep_violet_dark"
368
+ desktopOverlayColor="red"
369
+ submitButtonColor="blue_dark"
370
+ formAlignRight={true}
371
+ imageLow={desktopPictures.imageLow}
372
+ images={desktopPictures.images}
373
+ mobileImageLow={mobilePictures.imageLow}
374
+ mobileImages={mobilePictures.images}
375
+ data={data}
376
+ mbshipID="mship-11"
377
+ donateLink="https://donation.comicrelief.com/"
378
+ clientID="donate"
379
+ cartID="default-comicrelief"
380
+ title="Donate Now"
381
+ subtitle="Please help us fund life-changing projects in the UK and around the world."
382
+ additionalSingleCopy="Some additional single giving copy - Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa."
383
+ additionalMonthlyCopy="Some additional regular giving copy! - Quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos."
384
+ />;
385
+ ```
386
+
387
+ ## Additional copy for monthly only
388
+
389
+ ```js
390
+ import data from './dev-data/data';
391
+ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
392
+ const desktopPictures = require('../../../styleguide/data/data').defaultData;
393
+
394
+ <Donate
395
+ alt="Background image"
396
+ mobileBackgroundColor="deep_violet_dark"
397
+ desktopOverlayColor="red"
398
+ submitButtonColor="blue_dark"
399
+ formAlignRight={true}
400
+ imageLow={desktopPictures.imageLow}
401
+ images={desktopPictures.images}
402
+ mobileImageLow={mobilePictures.imageLow}
403
+ mobileImages={mobilePictures.images}
404
+ data={data}
405
+ mbshipID="mship-12"
406
+ donateLink="https://donation.comicrelief.com/"
407
+ clientID="donate"
408
+ cartID="default-comicrelief"
409
+ title="Donate Now"
410
+ subtitle="Please help us fund life-changing projects in the UK and around the world."
411
+ additionalMonthlyCopy="Some additional regular giving copy! - Quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos."
412
+ />;
413
+ ```
414
+
415
+ ## Additional copy for single only
416
+
417
+ ```js
418
+ import data from './dev-data/data';
419
+ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
420
+ const desktopPictures = require('../../../styleguide/data/data').defaultData;
421
+
422
+ <Donate
423
+ alt="Background image"
424
+ mobileBackgroundColor="deep_violet_dark"
425
+ desktopOverlayColor="red"
426
+ submitButtonColor="blue_dark"
427
+ formAlignRight={true}
428
+ imageLow={desktopPictures.imageLow}
429
+ images={desktopPictures.images}
430
+ mobileImageLow={mobilePictures.imageLow}
431
+ mobileImages={mobilePictures.images}
432
+ data={data}
433
+ mbshipID="mship-13"
434
+ donateLink="https://donation.comicrelief.com/"
435
+ clientID="donate"
436
+ cartID="default-comicrelief"
437
+ title="Donate Now"
438
+ subtitle="Please help us fund life-changing projects in the UK and around the world."
439
+ additionalSingleCopy="Some additional single giving copy - Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa."
440
+ />;
441
+ ```
@@ -38,6 +38,8 @@ const Signup = ({
38
38
  chooseAmountText,
39
39
  submitButtonColor,
40
40
  otherAmountValue,
41
+ additionalSingleCopy,
42
+ additionalMonthlyCopy,
41
43
  ...rest
42
44
  }) => {
43
45
  const [givingType, setGivingType] = useState('single');
@@ -191,6 +193,10 @@ const Signup = ({
191
193
  return `Donate £${amountDonate} monthly`;
192
194
  };
193
195
 
196
+ const showAdditionalSingleCopy = givingType === 'single' && additionalSingleCopy;
197
+ const showAdditionalMonthlyCopy = givingType === 'monthly' && additionalMonthlyCopy;
198
+ const additionalCopy = showAdditionalSingleCopy || showAdditionalMonthlyCopy;
199
+
194
200
  return (
195
201
  <FormWrapper>
196
202
  {showGivingSelector && (
@@ -276,6 +282,14 @@ const Signup = ({
276
282
  </Error>
277
283
  )}
278
284
 
285
+ {additionalCopy && (
286
+ <p className="additional-copy">
287
+ <strong>
288
+ {additionalCopy}
289
+ </strong>
290
+ </p>
291
+ )}
292
+
279
293
  {noMoneyBuys ? (
280
294
  <Button
281
295
  type="submit"
@@ -313,13 +327,17 @@ Signup.propTypes = {
313
327
  PopUpText: PropTypes.string.isRequired,
314
328
  chooseAmountText: PropTypes.string.isRequired,
315
329
  submitButtonColor: PropTypes.string.isRequired,
316
- otherAmountValue: PropTypes.number
330
+ otherAmountValue: PropTypes.number,
331
+ additionalSingleCopy: PropTypes.string,
332
+ additionalMonthlyCopy: PropTypes.string
317
333
  };
318
334
 
319
335
  Signup.defaultProps = {
320
336
  noMoneyBuys: false,
321
337
  otherAmountValue: null,
322
- data: {}
338
+ data: {},
339
+ additionalSingleCopy: null,
340
+ additionalMonthlyCopy: null
323
341
  };
324
342
 
325
343
  export default Signup;