@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.
- package/dist/components/Organisms/Donate/Donate.js +3 -3
- package/dist/components/Organisms/Donate/Donate.md +3 -12
- package/dist/components/Organisms/Donate/Form/Form.js +4 -4
- package/package.json +1 -1
- package/src/components/Organisms/Donate/Donate.js +4 -4
- package/src/components/Organisms/Donate/Donate.md +3 -12
- package/src/components/Organisms/Donate/Form/Form.js +4 -4
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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", "
|
|
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
|
-
|
|
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 =
|
|
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,
|
|
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
|
@@ -23,7 +23,7 @@ const Donate = ({
|
|
|
23
23
|
data,
|
|
24
24
|
title,
|
|
25
25
|
subtitle,
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
233
|
+
otherAmountText: PropTypes.string.isRequired,
|
|
234
234
|
mbshipID: PropTypes.string.isRequired,
|
|
235
235
|
noMoneyBuys: PropTypes.bool,
|
|
236
236
|
data: PropTypes.objectOf(PropTypes.shape),
|