@comicrelief/component-library 7.28.0 → 7.30.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.
- package/README.md +2 -2
- package/dist/components/Organisms/Donate/Donate.js +12 -9
- package/dist/components/Organisms/Donate/Donate.md +27 -21
- package/dist/components/Organisms/Donate/Donate.style.js +37 -33
- package/dist/components/Organisms/Donate/Form/Form.js +11 -7
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +39 -10
- package/dist/components/Organisms/Donate/_utils.js +8 -3
- package/dist/components/Organisms/Header/Header.md +13 -0
- package/dist/components/Organisms/Header/assets/PayIn.svg +3 -0
- package/package.json +3 -2
- package/playwright/components/organisms/donate.spec.js +73 -79
- package/src/components/Organisms/Donate/Donate.js +33 -27
- package/src/components/Organisms/Donate/Donate.md +27 -21
- package/src/components/Organisms/Donate/Donate.style.js +12 -6
- package/src/components/Organisms/Donate/Form/Form.js +15 -10
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +39 -10
- package/src/components/Organisms/Donate/_utils.js +9 -3
- package/src/components/Organisms/Header/Header.md +13 -0
- package/src/components/Organisms/Header/assets/PayIn.svg +3 -0
package/README.md
CHANGED
|
@@ -40,13 +40,13 @@ $ yarn styleguide
|
|
|
40
40
|
|
|
41
41
|
To test:
|
|
42
42
|
```
|
|
43
|
-
$ yarn test
|
|
43
|
+
$ yarn test:unit
|
|
44
44
|
```
|
|
45
45
|
_Test will run through all Jest tests and watch for any changes on snapshots._
|
|
46
46
|
|
|
47
47
|
To update snapshots with desired changes brought in through your work:
|
|
48
48
|
```
|
|
49
|
-
$ yarn test
|
|
49
|
+
$ yarn test:unit-update
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
To publish
|
|
@@ -71,7 +71,8 @@ const Donate = _ref => {
|
|
|
71
71
|
const {
|
|
72
72
|
showCopy,
|
|
73
73
|
thisTitle,
|
|
74
|
-
thisSubtitle
|
|
74
|
+
thisSubtitle,
|
|
75
|
+
noTitlesAtAll
|
|
75
76
|
} = (0, _utils.handleTitles)(givingType, title, subtitle, monthlyTitle, monthlySubtitle);
|
|
76
77
|
const {
|
|
77
78
|
thisOtherAmountText,
|
|
@@ -103,10 +104,12 @@ const Donate = _ref => {
|
|
|
103
104
|
isBackgroundImage: true
|
|
104
105
|
}) : null, /*#__PURE__*/_react.default.createElement(_Donate.Wrapper, {
|
|
105
106
|
formAlignRight: formAlignRight,
|
|
106
|
-
"aria-live": "polite"
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
"aria-live": "polite",
|
|
108
|
+
noTitlesAtAll: noTitlesAtAll
|
|
109
|
+
}, !noTitlesAtAll && /*#__PURE__*/_react.default.createElement(_Donate.TitleWrapperOuter, {
|
|
110
|
+
formAlignRight: formAlignRight,
|
|
111
|
+
"data-test": "this-one-here"
|
|
112
|
+
}, /*#__PURE__*/_react.default.createElement(_Donate.TitleWrapperInner, null, showCopy && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
110
113
|
tag: "h2",
|
|
111
114
|
color: textColor,
|
|
112
115
|
size: "big",
|
|
@@ -163,9 +166,9 @@ Donate.defaultProps = {
|
|
|
163
166
|
additionalSingleCopy: null,
|
|
164
167
|
additionalMonthlyCopy: null,
|
|
165
168
|
defaultGivingType: null,
|
|
166
|
-
monthlyTitle:
|
|
167
|
-
monthlySubtitle:
|
|
168
|
-
monthlyChooseAmountText:
|
|
169
|
-
monthlyOtherAmountText:
|
|
169
|
+
monthlyTitle: '',
|
|
170
|
+
monthlySubtitle: '',
|
|
171
|
+
monthlyChooseAmountText: '',
|
|
172
|
+
monthlyOtherAmountText: ''
|
|
170
173
|
};
|
|
171
174
|
var _default = exports.default = Donate;
|
|
@@ -131,7 +131,7 @@ setTimeout(()=>{
|
|
|
131
131
|
mobileImageLow={mobilePictures.imageLow}
|
|
132
132
|
mobileImages={mobilePictures.images}
|
|
133
133
|
data={data}
|
|
134
|
-
mbshipID="mship-
|
|
134
|
+
mbshipID="mship-5"
|
|
135
135
|
donateLink="https://donation.comicrelief.com/"
|
|
136
136
|
clientID="donate"
|
|
137
137
|
cartID="default-comicrelief"
|
|
@@ -139,6 +139,8 @@ setTimeout(()=>{
|
|
|
139
139
|
noMoneyBuys
|
|
140
140
|
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
141
141
|
otherAmountValue={amountDonate}
|
|
142
|
+
otherAmountText="Here's an otherAmountText override"
|
|
143
|
+
|
|
142
144
|
/>;
|
|
143
145
|
```
|
|
144
146
|
|
|
@@ -166,7 +168,7 @@ setTimeout(()=>{
|
|
|
166
168
|
mobileImageLow={mobilePictures.imageLow}
|
|
167
169
|
mobileImages={mobilePictures.images}
|
|
168
170
|
data={data}
|
|
169
|
-
mbshipID="mship-
|
|
171
|
+
mbshipID="mship-6"
|
|
170
172
|
donateLink="https://donation.comicrelief.com/"
|
|
171
173
|
clientID="donate"
|
|
172
174
|
cartID="default-comicrelief"
|
|
@@ -191,7 +193,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
191
193
|
mobileImageLow={mobilePictures.imageLow}
|
|
192
194
|
mobileImages={mobilePictures.images}
|
|
193
195
|
data={data}
|
|
194
|
-
mbshipID="mship-
|
|
196
|
+
mbshipID="mship-7"
|
|
195
197
|
donateLink="https://donation.comicrelief.com/"
|
|
196
198
|
clientID="donate"
|
|
197
199
|
cartID="default-comicrelief"
|
|
@@ -202,7 +204,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
202
204
|
```
|
|
203
205
|
|
|
204
206
|
|
|
205
|
-
## Form align right
|
|
207
|
+
## Form align right, but no copy, so ACTUALLY centre-aligns
|
|
206
208
|
|
|
207
209
|
```js
|
|
208
210
|
import data from './dev-data/data';
|
|
@@ -220,12 +222,16 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
220
222
|
mobileImageLow={mobilePictures.imageLow}
|
|
221
223
|
mobileImages={mobilePictures.images}
|
|
222
224
|
data={data}
|
|
223
|
-
mbshipID="mship-
|
|
225
|
+
mbshipID="mship-8"
|
|
224
226
|
donateLink="https://donation.comicrelief.com/"
|
|
225
227
|
clientID="donate"
|
|
226
228
|
cartID="default-comicrelief"
|
|
227
|
-
|
|
229
|
+
// Directly omiting values for these to centre-align
|
|
230
|
+
title=""
|
|
228
231
|
subtitle=""
|
|
232
|
+
chooseAmountText=""
|
|
233
|
+
monthlyTitle=""
|
|
234
|
+
monthlySubtitle=""
|
|
229
235
|
/>;
|
|
230
236
|
```
|
|
231
237
|
|
|
@@ -245,7 +251,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
245
251
|
mobileImageLow={mobilePictures.imageLow}
|
|
246
252
|
mobileImages={mobilePictures.images}
|
|
247
253
|
data={data}
|
|
248
|
-
mbshipID="mship-
|
|
254
|
+
mbshipID="mship-9"
|
|
249
255
|
donateLink="https://donation.comicrelief.com/"
|
|
250
256
|
clientID="donate"
|
|
251
257
|
cartID="default-comicrelief"
|
|
@@ -270,7 +276,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
270
276
|
mobileImageLow={mobilePictures.imageLow}
|
|
271
277
|
mobileImages={mobilePictures.images}
|
|
272
278
|
data={data}
|
|
273
|
-
mbshipID="mship-
|
|
279
|
+
mbshipID="mship-10"
|
|
274
280
|
donateLink="https://donation.comicrelief.com/"
|
|
275
281
|
clientID="donate"
|
|
276
282
|
cartID="default-comicrelief"
|
|
@@ -295,7 +301,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
295
301
|
mobileImageLow={mobilePictures.imageLow}
|
|
296
302
|
mobileImages={mobilePictures.images}
|
|
297
303
|
data={data}
|
|
298
|
-
mbshipID="mship-
|
|
304
|
+
mbshipID="mship-11"
|
|
299
305
|
donateLink="https://donation.comicrelief.com/"
|
|
300
306
|
clientID="donate"
|
|
301
307
|
cartID="default-comicrelief"
|
|
@@ -316,7 +322,7 @@ import data from './dev-data/data-single';
|
|
|
316
322
|
mobileBackgroundColor="blue_dark"
|
|
317
323
|
formAlignRight={false}
|
|
318
324
|
data={data}
|
|
319
|
-
mbshipID="mship-
|
|
325
|
+
mbshipID="mship-12"
|
|
320
326
|
donateLink="https://donation.comicrelief.com/"
|
|
321
327
|
clientID="donate"
|
|
322
328
|
cartID="default-comicrelief"
|
|
@@ -345,7 +351,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
345
351
|
mobileImageLow={mobilePictures.imageLow}
|
|
346
352
|
mobileImages={mobilePictures.images}
|
|
347
353
|
data={data}
|
|
348
|
-
mbshipID="mship-
|
|
354
|
+
mbshipID="mship-13"
|
|
349
355
|
donateLink="https://donation.comicrelief.com/"
|
|
350
356
|
clientID="donate"
|
|
351
357
|
cartID="default-comicrelief"
|
|
@@ -373,7 +379,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
373
379
|
mobileImageLow={mobilePictures.imageLow}
|
|
374
380
|
mobileImages={mobilePictures.images}
|
|
375
381
|
data={data}
|
|
376
|
-
mbshipID="mship-
|
|
382
|
+
mbshipID="mship-14"
|
|
377
383
|
donateLink="https://donation.comicrelief.com/"
|
|
378
384
|
clientID="donate"
|
|
379
385
|
cartID="default-comicrelief"
|
|
@@ -402,7 +408,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
402
408
|
mobileImageLow={mobilePictures.imageLow}
|
|
403
409
|
mobileImages={mobilePictures.images}
|
|
404
410
|
data={data}
|
|
405
|
-
mbshipID="mship-
|
|
411
|
+
mbshipID="mship-15"
|
|
406
412
|
donateLink="https://donation.comicrelief.com/"
|
|
407
413
|
clientID="donate"
|
|
408
414
|
cartID="default-comicrelief"
|
|
@@ -430,7 +436,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
430
436
|
mobileImageLow={mobilePictures.imageLow}
|
|
431
437
|
mobileImages={mobilePictures.images}
|
|
432
438
|
data={data}
|
|
433
|
-
mbshipID="mship-
|
|
439
|
+
mbshipID="mship-16"
|
|
434
440
|
donateLink="https://donation.comicrelief.com/"
|
|
435
441
|
clientID="donate"
|
|
436
442
|
cartID="default-comicrelief"
|
|
@@ -458,7 +464,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
458
464
|
mobileImageLow={mobilePictures.imageLow}
|
|
459
465
|
mobileImages={mobilePictures.images}
|
|
460
466
|
data={data}
|
|
461
|
-
mbshipID="mship-
|
|
467
|
+
mbshipID="mship-17"
|
|
462
468
|
donateLink="https://donation.comicrelief.com/"
|
|
463
469
|
clientID="donate"
|
|
464
470
|
cartID="default-comicrelief"
|
|
@@ -486,7 +492,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
486
492
|
mobileImageLow={mobilePictures.imageLow}
|
|
487
493
|
mobileImages={mobilePictures.images}
|
|
488
494
|
data={data}
|
|
489
|
-
mbshipID="mship-
|
|
495
|
+
mbshipID="mship-18"
|
|
490
496
|
donateLink="https://donation.comicrelief.com/"
|
|
491
497
|
clientID="donate"
|
|
492
498
|
cartID="default-comicrelief"
|
|
@@ -513,7 +519,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
513
519
|
mobileImageLow={mobilePictures.imageLow}
|
|
514
520
|
mobileImages={mobilePictures.images}
|
|
515
521
|
data={data}
|
|
516
|
-
mbshipID="mship-
|
|
522
|
+
mbshipID="mship-19"
|
|
517
523
|
donateLink="https://donation.comicrelief.com/"
|
|
518
524
|
clientID="donate"
|
|
519
525
|
cartID="default-comicrelief"
|
|
@@ -541,7 +547,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
541
547
|
mobileImageLow={mobilePictures.imageLow}
|
|
542
548
|
mobileImages={mobilePictures.images}
|
|
543
549
|
data={data}
|
|
544
|
-
mbshipID="mship-
|
|
550
|
+
mbshipID="mship-20"
|
|
545
551
|
donateLink="https://donation.comicrelief.com/"
|
|
546
552
|
clientID="donate"
|
|
547
553
|
cartID="default-comicrelief"
|
|
@@ -572,7 +578,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
572
578
|
mobileImageLow={mobilePictures.imageLow}
|
|
573
579
|
mobileImages={mobilePictures.images}
|
|
574
580
|
data={data}
|
|
575
|
-
mbshipID="mship-
|
|
581
|
+
mbshipID="mship-21"
|
|
576
582
|
donateLink="https://donation.comicrelief.com/"
|
|
577
583
|
clientID="donate"
|
|
578
584
|
cartID="default-comicrelief"
|
|
@@ -603,7 +609,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
603
609
|
mobileImageLow={mobilePictures.imageLow}
|
|
604
610
|
mobileImages={mobilePictures.images}
|
|
605
611
|
data={data}
|
|
606
|
-
mbshipID="mship-
|
|
612
|
+
mbshipID="mship-22"
|
|
607
613
|
donateLink="https://donation.comicrelief.com/"
|
|
608
614
|
clientID="donate"
|
|
609
615
|
cartID="default-comicrelief"
|
|
@@ -616,4 +622,4 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
616
622
|
monthlyChooseAmountText="monthlyChooseAmountText here"
|
|
617
623
|
monthlyOtherAmountText="monthlyOtherAmountText here"
|
|
618
624
|
/>;
|
|
619
|
-
```
|
|
625
|
+
```
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
|
-
exports.Wrapper = exports.
|
|
8
|
-
var _styledComponents =
|
|
8
|
+
exports.Wrapper = exports.TitleWrapperOuter = exports.TitleWrapperInner = exports.PopUp = exports.OuterFieldset = exports.MoneyBuys = exports.Legend = exports.Label = exports.FormWrapper = exports.FormFieldset = exports.Form = exports.Error = exports.Copy = exports.Container = exports.Button = exports.BgImage = exports.AmountField = void 0;
|
|
9
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
10
|
var _Input = _interopRequireDefault(require("../../Atoms/Input/Input"));
|
|
10
11
|
var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
|
|
11
12
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
12
13
|
var _size = require("../../../theme/shared/size");
|
|
13
14
|
var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
14
15
|
var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
15
|
-
// import styled, { css } from 'styled-components';
|
|
16
|
-
|
|
17
16
|
const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
18
17
|
displayName: "Donatestyle__Container",
|
|
19
18
|
componentId: "sc-8rjm3t-0"
|
|
@@ -46,55 +45,60 @@ const BgImage = exports.BgImage = (0, _styledComponents.default)(_Picture.defaul
|
|
|
46
45
|
const Wrapper = exports.Wrapper = _styledComponents.default.div.withConfig({
|
|
47
46
|
displayName: "Donatestyle__Wrapper",
|
|
48
47
|
componentId: "sc-8rjm3t-3"
|
|
49
|
-
})(["position:relative;text-align:center;padding:", " ", ";flex-direction:row;align-items:center;display:block;width:100%;flex-direction:", ";", "{padding:", " ", ";}", "{display:flex;padding:", " 0;}"], (0, _spacing.default)('l'), (0, _spacing.default)('md'), _ref4 => {
|
|
48
|
+
})(["position:relative;text-align:center;padding:", " ", ";flex-direction:row;align-items:center;display:block;width:100%;flex-direction:", ";", ";", "{padding:", " ", ";}", "{display:flex;padding:", " 0;}"], (0, _spacing.default)('l'), (0, _spacing.default)('md'), _ref4 => {
|
|
50
49
|
let {
|
|
51
50
|
formAlignRight
|
|
52
51
|
} = _ref4;
|
|
53
52
|
return formAlignRight === true ? 'row-reverse' : 'row';
|
|
53
|
+
}, _ref5 => {
|
|
54
|
+
let {
|
|
55
|
+
noTitlesAtAll
|
|
56
|
+
} = _ref5;
|
|
57
|
+
return noTitlesAtAll === true && (0, _styledComponents.css)(["justify-content:center;"]);
|
|
54
58
|
}, (0, _size.media)('small'), (0, _spacing.default)('xl'), (0, _spacing.default)('md'), (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
55
|
-
const
|
|
56
|
-
displayName: "
|
|
59
|
+
const TitleWrapperOuter = exports.TitleWrapperOuter = _styledComponents.default.div.withConfig({
|
|
60
|
+
displayName: "Donatestyle__TitleWrapperOuter",
|
|
57
61
|
componentId: "sc-8rjm3t-4"
|
|
58
|
-
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"],
|
|
62
|
+
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"], _ref6 => {
|
|
59
63
|
let {
|
|
60
64
|
theme
|
|
61
|
-
} =
|
|
65
|
+
} = _ref6;
|
|
62
66
|
return theme.fontFamilies(theme.font.regular);
|
|
63
67
|
}, (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
64
|
-
const
|
|
65
|
-
displayName: "
|
|
68
|
+
const TitleWrapperInner = exports.TitleWrapperInner = _styledComponents.default.div.withConfig({
|
|
69
|
+
displayName: "Donatestyle__TitleWrapperInner",
|
|
66
70
|
componentId: "sc-8rjm3t-5"
|
|
67
71
|
})(["position:relative;text-align:left;"]);
|
|
68
72
|
const FormWrapper = exports.FormWrapper = _styledComponents.default.div.withConfig({
|
|
69
73
|
displayName: "Donatestyle__FormWrapper",
|
|
70
74
|
componentId: "sc-8rjm3t-6"
|
|
71
|
-
})(["position:relative;font-family:", ";", "{width:50%;}"],
|
|
75
|
+
})(["position:relative;font-family:", ";", "{width:50%;}"], _ref7 => {
|
|
72
76
|
let {
|
|
73
77
|
theme
|
|
74
|
-
} =
|
|
78
|
+
} = _ref7;
|
|
75
79
|
return theme.fontFamilies(theme.font.regular);
|
|
76
80
|
}, (0, _size.media)('medium'));
|
|
77
81
|
const Error = exports.Error = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
78
82
|
displayName: "Donatestyle__Error",
|
|
79
83
|
componentId: "sc-8rjm3t-7"
|
|
80
|
-
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"],
|
|
84
|
+
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"], _ref8 => {
|
|
81
85
|
let {
|
|
82
86
|
theme
|
|
83
|
-
} =
|
|
87
|
+
} = _ref8;
|
|
84
88
|
return theme.color('red');
|
|
85
|
-
},
|
|
89
|
+
}, _ref9 => {
|
|
86
90
|
let {
|
|
87
91
|
theme
|
|
88
|
-
} =
|
|
92
|
+
} = _ref9;
|
|
89
93
|
return theme.fontSize('s');
|
|
90
94
|
}, (0, _spacing.default)('l'));
|
|
91
95
|
const Form = exports.Form = _styledComponents.default.form.withConfig({
|
|
92
96
|
displayName: "Donatestyle__Form",
|
|
93
97
|
componentId: "sc-8rjm3t-8"
|
|
94
|
-
})(["position:relative;width:100%;background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:10px;margin-top:", ";h3{margin-top:", ";}input{max-width:100%;margin:0;}input[type='submit']{margin:", " 0;}", "{width:450px;margin-right:auto;margin-left:auto;}"],
|
|
98
|
+
})(["position:relative;width:100%;background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:10px;margin-top:", ";h3{margin-top:", ";}input{max-width:100%;margin:0;}input[type='submit']{margin:", " 0;}", "{width:450px;margin-right:auto;margin-left:auto;}"], _ref10 => {
|
|
95
99
|
let {
|
|
96
100
|
theme
|
|
97
|
-
} =
|
|
101
|
+
} = _ref10;
|
|
98
102
|
return theme.color('white');
|
|
99
103
|
}, (0, _spacing.default)('md'), (0, _spacing.default)('md'), (0, _spacing.default)('l'), (0, _size.media)('small'));
|
|
100
104
|
const OuterFieldset = exports.OuterFieldset = _styledComponents.default.fieldset.withConfig({
|
|
@@ -120,20 +124,20 @@ const Label = exports.Label = (0, _styledComponents.default)(_Text.default).with
|
|
|
120
124
|
const AmountField = exports.AmountField = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
121
125
|
displayName: "Donatestyle__AmountField",
|
|
122
126
|
componentId: "sc-8rjm3t-14"
|
|
123
|
-
})(["position:relative;flex-basis:50%;flex-shrink:0;flex-grow:0;font-weight:400;display:block;", "{flex-basis:60%;}span{position:absolute;font-size:20px;top:50%;transform:translateY(-50%);left:0px;font-weight:500;padding:0px 15px;", ";}input{height:48px;border:2px solid ", ";background:", ";border-radius:10px;padding:", " ", " ", " ", ";&:focus{outline:none;border:2px solid ", ";}}"], (0, _size.media)('small'), (0, _zIndex.default)('high'),
|
|
127
|
+
})(["position:relative;flex-basis:50%;flex-shrink:0;flex-grow:0;font-weight:400;display:block;", "{flex-basis:60%;}span{position:absolute;font-size:20px;top:50%;transform:translateY(-50%);left:0px;font-weight:500;padding:0px 15px;", ";}input{height:48px;border:2px solid ", ";background:", ";border-radius:10px;padding:", " ", " ", " ", ";&:focus{outline:none;border:2px solid ", ";}}"], (0, _size.media)('small'), (0, _zIndex.default)('high'), _ref11 => {
|
|
124
128
|
let {
|
|
125
129
|
theme
|
|
126
|
-
} =
|
|
130
|
+
} = _ref11;
|
|
127
131
|
return theme.color('grey');
|
|
128
|
-
},
|
|
132
|
+
}, _ref12 => {
|
|
129
133
|
let {
|
|
130
134
|
theme
|
|
131
|
-
} =
|
|
135
|
+
} = _ref12;
|
|
132
136
|
return theme.color('grey_light');
|
|
133
|
-
}, (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('sm'), (0, _spacing.default)('l'),
|
|
137
|
+
}, (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('sm'), (0, _spacing.default)('l'), _ref13 => {
|
|
134
138
|
let {
|
|
135
139
|
theme
|
|
136
|
-
} =
|
|
140
|
+
} = _ref13;
|
|
137
141
|
return theme.color('grey');
|
|
138
142
|
});
|
|
139
143
|
const Copy = exports.Copy = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
@@ -143,25 +147,25 @@ const Copy = exports.Copy = (0, _styledComponents.default)(_Text.default).withCo
|
|
|
143
147
|
const Button = exports.Button = _styledComponents.default.button.withConfig({
|
|
144
148
|
displayName: "Donatestyle__Button",
|
|
145
149
|
componentId: "sc-8rjm3t-16"
|
|
146
|
-
})(["width:100%;margin:", " 0 ", ";color:", ";font-size:", ";font-weight:bold;cursor:pointer;min-height:48px;background:", ";text-decoration:none;border-radius:2rem;border:none;box-shadow:0px 0px 16px rgba(0,0,0,0.15);appearance:none;:active,:focus,:hover{outline:none;background-color:", ";}", "{padding:", " ", ";}"], (0, _spacing.default)('l'), (0, _spacing.default)('l'),
|
|
150
|
+
})(["width:100%;margin:", " 0 ", ";color:", ";font-size:", ";font-weight:bold;cursor:pointer;min-height:48px;background:", ";text-decoration:none;border-radius:2rem;border:none;box-shadow:0px 0px 16px rgba(0,0,0,0.15);appearance:none;:active,:focus,:hover{outline:none;background-color:", ";}", "{padding:", " ", ";}"], (0, _spacing.default)('l'), (0, _spacing.default)('l'), _ref14 => {
|
|
147
151
|
let {
|
|
148
152
|
theme
|
|
149
|
-
} =
|
|
153
|
+
} = _ref14;
|
|
150
154
|
return theme.color('white');
|
|
151
|
-
},
|
|
155
|
+
}, _ref15 => {
|
|
152
156
|
let {
|
|
153
157
|
theme
|
|
154
|
-
} =
|
|
158
|
+
} = _ref15;
|
|
155
159
|
return theme.fontSize('s');
|
|
156
|
-
},
|
|
160
|
+
}, _ref16 => {
|
|
157
161
|
let {
|
|
158
162
|
theme,
|
|
159
163
|
color
|
|
160
|
-
} =
|
|
164
|
+
} = _ref16;
|
|
161
165
|
return theme.color(color);
|
|
162
|
-
},
|
|
166
|
+
}, _ref17 => {
|
|
163
167
|
let {
|
|
164
168
|
theme
|
|
165
|
-
} =
|
|
169
|
+
} = _ref17;
|
|
166
170
|
return theme.color('coral_dark');
|
|
167
171
|
}, (0, _size.media)('small'), (0, _spacing.default)('md'), (0, _spacing.default)('l'));
|
|
@@ -65,10 +65,11 @@ const Signup = _ref => {
|
|
|
65
65
|
(0, _react.useEffect)(() => {
|
|
66
66
|
if (givingType) {
|
|
67
67
|
const givingData = givingType === 'single' ? singleGiving : regularGiving;
|
|
68
|
-
let
|
|
68
|
+
let moneyBuyUpdatedDescription = otherAmountText;
|
|
69
69
|
givingData.moneybuys.map((moneyBuy, index) => {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
// Only show the MB-associated copy when we're actually showing moneybuys
|
|
71
|
+
if (moneyBuy.value === amountDonate && !noMoneyBuys) {
|
|
72
|
+
moneyBuyUpdatedDescription = moneyBuy.description;
|
|
72
73
|
}
|
|
73
74
|
return index === 1 && amountDonate === undefined && (setMoneyBuyCopy(moneyBuy.description), setAmountDonate(moneyBuy.value));
|
|
74
75
|
});
|
|
@@ -77,10 +78,10 @@ const Signup = _ref => {
|
|
|
77
78
|
if (!errorMsg) setErrorMsg(true);
|
|
78
79
|
} else {
|
|
79
80
|
if (errorMsg) setErrorMsg(false);
|
|
80
|
-
setMoneyBuyCopy(
|
|
81
|
+
setMoneyBuyCopy(moneyBuyUpdatedDescription);
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
}, [errorMsg, moneyBuyCopy, singleGiving, regularGiving, givingType, amountDonate, otherAmountText]);
|
|
84
|
+
}, [errorMsg, moneyBuyCopy, singleGiving, regularGiving, givingType, amountDonate, otherAmountText, noMoneyBuys]);
|
|
84
85
|
|
|
85
86
|
// Updates our flag that differentiates between the popup
|
|
86
87
|
// being *currently* open and it *ever* having been shown to user
|
|
@@ -214,7 +215,7 @@ const Signup = _ref => {
|
|
|
214
215
|
onChange: e => setAmountDonate(e.target.value.trim()),
|
|
215
216
|
"aria-label": "Input a different amount",
|
|
216
217
|
ref: amountRef
|
|
217
|
-
}))), amountDonate >= 1 &&
|
|
218
|
+
}))), amountDonate >= 1 && moneyBuyCopy && /*#__PURE__*/_react.default.createElement(_Donate.Copy, {
|
|
218
219
|
as: "p"
|
|
219
220
|
}, /*#__PURE__*/_react.default.createElement("strong", null, "\xA3".concat(amountDonate, " ")), moneyBuyCopy), errorMsg && /*#__PURE__*/_react.default.createElement(_Donate.Error, {
|
|
220
221
|
className: "error--amount",
|
|
@@ -233,6 +234,9 @@ Signup.defaultProps = {
|
|
|
233
234
|
data: {},
|
|
234
235
|
additionalSingleCopy: null,
|
|
235
236
|
additionalMonthlyCopy: null,
|
|
236
|
-
defaultGivingType: null
|
|
237
|
+
defaultGivingType: null,
|
|
238
|
+
monthlyChooseAmountCopy: null,
|
|
239
|
+
monthlyOtherAmountCopy: null,
|
|
240
|
+
givingType: null
|
|
237
241
|
};
|
|
238
242
|
var _default = exports.default = Signup;
|
|
@@ -239,6 +239,11 @@ exports[`"Single Giving, No Money Buys, with overridden manual input value" rend
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
.c24 {
|
|
242
|
+
line-height: 1.5;
|
|
243
|
+
margin-top: 2rem;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.c25 {
|
|
242
247
|
width: 100%;
|
|
243
248
|
margin: 2rem 0 2rem;
|
|
244
249
|
color: #FFFFFF;
|
|
@@ -257,9 +262,9 @@ exports[`"Single Giving, No Money Buys, with overridden manual input value" rend
|
|
|
257
262
|
appearance: none;
|
|
258
263
|
}
|
|
259
264
|
|
|
260
|
-
.
|
|
261
|
-
.
|
|
262
|
-
.
|
|
265
|
+
.c25:active,
|
|
266
|
+
.c25:focus,
|
|
267
|
+
.c25:hover {
|
|
263
268
|
outline: none;
|
|
264
269
|
background-color: #961D35;
|
|
265
270
|
}
|
|
@@ -492,7 +497,7 @@ exports[`"Single Giving, No Money Buys, with overridden manual input value" rend
|
|
|
492
497
|
}
|
|
493
498
|
|
|
494
499
|
@media (min-width:740px) {
|
|
495
|
-
.
|
|
500
|
+
.c25 {
|
|
496
501
|
padding: 1rem 2rem;
|
|
497
502
|
}
|
|
498
503
|
}
|
|
@@ -514,6 +519,7 @@ exports[`"Single Giving, No Money Buys, with overridden manual input value" rend
|
|
|
514
519
|
>
|
|
515
520
|
<div
|
|
516
521
|
className="c2"
|
|
522
|
+
data-test="this-one-here"
|
|
517
523
|
>
|
|
518
524
|
<div
|
|
519
525
|
className="c3"
|
|
@@ -639,8 +645,16 @@ exports[`"Single Giving, No Money Buys, with overridden manual input value" rend
|
|
|
639
645
|
|
|
640
646
|
</label>
|
|
641
647
|
</div>
|
|
642
|
-
<
|
|
648
|
+
<p
|
|
643
649
|
className="c24"
|
|
650
|
+
>
|
|
651
|
+
<strong>
|
|
652
|
+
£345.67
|
|
653
|
+
</strong>
|
|
654
|
+
will help us fund amazing projects in the UK and around the world.
|
|
655
|
+
</p>
|
|
656
|
+
<button
|
|
657
|
+
className="c25"
|
|
644
658
|
color="red"
|
|
645
659
|
type="submit"
|
|
646
660
|
>
|
|
@@ -1142,6 +1156,7 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
1142
1156
|
>
|
|
1143
1157
|
<div
|
|
1144
1158
|
className="c2"
|
|
1159
|
+
data-test="this-one-here"
|
|
1145
1160
|
>
|
|
1146
1161
|
<div
|
|
1147
1162
|
className="c3"
|
|
@@ -1803,6 +1818,7 @@ exports[`Single donation renders correctly 1`] = `
|
|
|
1803
1818
|
>
|
|
1804
1819
|
<div
|
|
1805
1820
|
className="c2"
|
|
1821
|
+
data-test="this-one-here"
|
|
1806
1822
|
>
|
|
1807
1823
|
<div
|
|
1808
1824
|
className="c3"
|
|
@@ -2256,6 +2272,11 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
2256
2272
|
}
|
|
2257
2273
|
|
|
2258
2274
|
.c18 {
|
|
2275
|
+
line-height: 1.5;
|
|
2276
|
+
margin-top: 2rem;
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
.c19 {
|
|
2259
2280
|
width: 100%;
|
|
2260
2281
|
margin: 2rem 0 2rem;
|
|
2261
2282
|
color: #FFFFFF;
|
|
@@ -2274,9 +2295,9 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
2274
2295
|
appearance: none;
|
|
2275
2296
|
}
|
|
2276
2297
|
|
|
2277
|
-
.
|
|
2278
|
-
.
|
|
2279
|
-
.
|
|
2298
|
+
.c19:active,
|
|
2299
|
+
.c19:focus,
|
|
2300
|
+
.c19:hover {
|
|
2280
2301
|
outline: none;
|
|
2281
2302
|
background-color: #961D35;
|
|
2282
2303
|
}
|
|
@@ -2366,7 +2387,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
2366
2387
|
}
|
|
2367
2388
|
|
|
2368
2389
|
@media (min-width:740px) {
|
|
2369
|
-
.
|
|
2390
|
+
.c19 {
|
|
2370
2391
|
padding: 1rem 2rem;
|
|
2371
2392
|
}
|
|
2372
2393
|
}
|
|
@@ -2381,6 +2402,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
2381
2402
|
>
|
|
2382
2403
|
<div
|
|
2383
2404
|
className="c2"
|
|
2405
|
+
data-test="this-one-here"
|
|
2384
2406
|
>
|
|
2385
2407
|
<div
|
|
2386
2408
|
className="c3"
|
|
@@ -2463,8 +2485,15 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
2463
2485
|
|
|
2464
2486
|
</label>
|
|
2465
2487
|
</div>
|
|
2466
|
-
<
|
|
2488
|
+
<p
|
|
2467
2489
|
className="c18"
|
|
2490
|
+
>
|
|
2491
|
+
<strong>
|
|
2492
|
+
£10
|
|
2493
|
+
</strong>
|
|
2494
|
+
</p>
|
|
2495
|
+
<button
|
|
2496
|
+
className="c19"
|
|
2468
2497
|
color="red"
|
|
2469
2498
|
type="submit"
|
|
2470
2499
|
>
|
|
@@ -7,9 +7,13 @@ exports.handleTitles = exports.handleCopy = void 0;
|
|
|
7
7
|
const handleTitles = (givingType, title, subtitle, monthlyTitle, monthlySubtitle) => {
|
|
8
8
|
let thisTitle;
|
|
9
9
|
let thisSubtitle;
|
|
10
|
+
const showSingleCopy = Boolean(subtitle) && Boolean(title);
|
|
10
11
|
const showMonthlyCopy = givingType === 'monthly' && Boolean(monthlySubtitle) && Boolean(monthlyTitle);
|
|
11
|
-
// Overall flag as to whether we render copy
|
|
12
|
-
const showCopy = showMonthlyCopy ||
|
|
12
|
+
// Overall flag as to whether we render copy for the currently selected givingType
|
|
13
|
+
const showCopy = showMonthlyCopy || showSingleCopy;
|
|
14
|
+
|
|
15
|
+
// Acts as a flag to centre the form when no copy is supplied *at all*
|
|
16
|
+
const noTitlesAtAll = showSingleCopy === false && showMonthlyCopy === false;
|
|
13
17
|
|
|
14
18
|
// Apply the override if we've got monthly content AND giving type:
|
|
15
19
|
if (showMonthlyCopy) {
|
|
@@ -23,7 +27,8 @@ const handleTitles = (givingType, title, subtitle, monthlyTitle, monthlySubtitle
|
|
|
23
27
|
return {
|
|
24
28
|
showCopy,
|
|
25
29
|
thisTitle,
|
|
26
|
-
thisSubtitle
|
|
30
|
+
thisSubtitle,
|
|
31
|
+
noTitlesAtAll
|
|
27
32
|
};
|
|
28
33
|
};
|
|
29
34
|
exports.handleTitles = handleTitles;
|
|
@@ -116,6 +116,8 @@ import data from './data/data';
|
|
|
116
116
|
import Link from '../../Atoms/Link/Link';
|
|
117
117
|
import searchIcon from './assets/icon--search--2023.svg';
|
|
118
118
|
import shopIcon from './assets/icon--shop--2023.svg';
|
|
119
|
+
import payinIcon from './assets/PayIn.svg';
|
|
120
|
+
|
|
119
121
|
import Icon from '../../Atoms/SocialIcons/Icon/Icon';
|
|
120
122
|
import RichText from '../../Atoms/RichText/RichText';
|
|
121
123
|
|
|
@@ -170,6 +172,17 @@ const [success, setSuccess] = React.useState(false);
|
|
|
170
172
|
tabIndex="0"
|
|
171
173
|
/>
|
|
172
174
|
</div>
|
|
175
|
+
<div>
|
|
176
|
+
<Icon
|
|
177
|
+
icon={payinIcon}
|
|
178
|
+
title="Payin"
|
|
179
|
+
target="_blank"
|
|
180
|
+
role="button"
|
|
181
|
+
href="https://donation.comicrelief.com/?cartId=rnd23-fundraisingpayin"
|
|
182
|
+
brand="comicrelief"
|
|
183
|
+
tabIndex="0"
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
173
186
|
</>
|
|
174
187
|
}
|
|
175
188
|
/>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M22 1H2C1.448 1 1 1.448 1 2V7C1 7.552 1.448 8 2 8H4V19V19.5V22C4 22.552 4.448 23 5 23H19C19.552 23 20 22.552 20 22V19.5V19V8H22C22.552 8 23 7.552 23 7V2C23 1.448 22.552 1 22 1ZM6 21V20.5H18V21H6ZM18 18.5H6V6.0625H18V18.5ZM21 6H20V5.0625C20 4.5105 19.552 4.0625 19 4.0625H5C4.448 4.0625 4 4.5105 4 5.0625V6H3V3H21V6ZM8.293 12.2695C7.9025 11.879 7.9025 11.246 8.293 10.8555L11.2925 7.856C11.339 7.809 11.3905 7.7675 11.446 7.7305C11.4695 7.7145 11.4955 7.704 11.52 7.69C11.5525 7.672 11.5835 7.6525 11.618 7.6385C11.6505 7.625 11.6845 7.6175 11.718 7.6075C11.747 7.599 11.7745 7.588 11.8045 7.582C11.934 7.556 12.067 7.556 12.196 7.582C12.226 7.588 12.2535 7.599 12.2825 7.6075C12.316 7.6175 12.35 7.625 12.3825 7.6385C12.417 7.6525 12.448 7.672 12.4805 7.69C12.5055 7.7035 12.531 7.7145 12.5545 7.7305C12.6095 7.7675 12.661 7.809 12.708 7.856L15.7075 10.8555C16.098 11.246 16.098 11.879 15.7075 12.2695C15.512 12.465 15.2565 12.5625 15.0005 12.5625C14.7445 12.5625 14.489 12.465 14.2935 12.2695L13 10.9765V15.5C13 16.052 12.552 16.5 12 16.5C11.448 16.5 11 16.052 11 15.5V10.9765L9.707 12.2695C9.3165 12.66 8.6835 12.66 8.293 12.2695Z" fill="#222222"/>
|
|
3
|
+
</svg>
|