@comicrelief/component-library 7.3.0 → 7.5.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 +15 -7
- package/dist/components/Organisms/Donate/Donate.md +14 -16
- package/dist/components/Organisms/Donate/Donate.style.js +8 -6
- package/dist/components/Organisms/Donate/Form/Form.js +9 -6
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +3 -3
- package/package.json +1 -1
- package/src/components/Organisms/Donate/Donate.js +23 -8
- package/src/components/Organisms/Donate/Donate.md +14 -16
- package/src/components/Organisms/Donate/Donate.style.js +3 -3
- package/src/components/Organisms/Donate/Form/Form.js +9 -6
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +3 -3
|
@@ -31,12 +31,15 @@ var Donate = function Donate(_ref) {
|
|
|
31
31
|
var alt = _ref.alt,
|
|
32
32
|
cartID = _ref.cartID,
|
|
33
33
|
clientID = _ref.clientID,
|
|
34
|
+
overlayColor = _ref.overlayColor,
|
|
34
35
|
backgroundColor = _ref.backgroundColor,
|
|
36
|
+
buttonColor = _ref.buttonColor,
|
|
37
|
+
textColor = _ref.textColor,
|
|
35
38
|
donateLink = _ref.donateLink,
|
|
36
39
|
data = _ref.data,
|
|
37
40
|
title = _ref.title,
|
|
38
41
|
subtitle = _ref.subtitle,
|
|
39
|
-
|
|
42
|
+
otherAmountText = _ref.otherAmountText,
|
|
40
43
|
formAlignRight = _ref.formAlignRight,
|
|
41
44
|
images = _ref.images,
|
|
42
45
|
image = _ref.image,
|
|
@@ -68,6 +71,7 @@ var Donate = function Donate(_ref) {
|
|
|
68
71
|
isDesktop = overrideValue !== null ? overrideValue : isDesktop;
|
|
69
72
|
return /*#__PURE__*/_react.default.createElement(_Donate.Container, {
|
|
70
73
|
backgroundColor: backgroundColor,
|
|
74
|
+
overlayColor: overlayColor,
|
|
71
75
|
id: mbshipID,
|
|
72
76
|
key: overrideValue
|
|
73
77
|
}, !isDesktop && mobileImages ? /*#__PURE__*/_react.default.createElement(_Picture.default, {
|
|
@@ -80,7 +84,7 @@ var Donate = function Donate(_ref) {
|
|
|
80
84
|
height: "100%",
|
|
81
85
|
alt: mobileAlt
|
|
82
86
|
}) : null, isDesktop && images ? /*#__PURE__*/_react.default.createElement(_Donate.BgImage, {
|
|
83
|
-
backgroundColor:
|
|
87
|
+
backgroundColor: overlayColor,
|
|
84
88
|
image: image,
|
|
85
89
|
images: images,
|
|
86
90
|
imageLow: imageLow,
|
|
@@ -96,25 +100,26 @@ var Donate = function Donate(_ref) {
|
|
|
96
100
|
formAlignRight: formAlignRight
|
|
97
101
|
}, /*#__PURE__*/_react.default.createElement(_Donate.HeaderInner, null, subtitle && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
98
102
|
tag: "h2",
|
|
99
|
-
color:
|
|
103
|
+
color: textColor,
|
|
100
104
|
size: "big",
|
|
101
105
|
family: "Anton",
|
|
102
106
|
weight: "normal",
|
|
103
107
|
uppercase: true
|
|
104
108
|
}, title), /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
105
109
|
tag: "p",
|
|
106
|
-
color:
|
|
110
|
+
color: textColor,
|
|
107
111
|
size: "m"
|
|
108
112
|
}, subtitle)))), /*#__PURE__*/_react.default.createElement(_Form.default, {
|
|
109
113
|
data: data,
|
|
110
|
-
|
|
114
|
+
otherAmountText: otherAmountText,
|
|
111
115
|
cartID: cartID,
|
|
112
116
|
clientID: clientID,
|
|
113
117
|
mbshipID: mbshipID,
|
|
114
118
|
donateLink: donateLink,
|
|
115
119
|
noMoneyBuys: noMoneyBuys,
|
|
116
120
|
PopUpText: PopUpText,
|
|
117
|
-
chooseAmountText: chooseAmountText
|
|
121
|
+
chooseAmountText: chooseAmountText,
|
|
122
|
+
buttonColor: buttonColor
|
|
118
123
|
})));
|
|
119
124
|
};
|
|
120
125
|
|
|
@@ -129,9 +134,12 @@ Donate.defaultProps = {
|
|
|
129
134
|
mobileImage: null,
|
|
130
135
|
mobileImages: null,
|
|
131
136
|
mobileAlt: '',
|
|
137
|
+
overlayColor: 'transparent',
|
|
132
138
|
backgroundColor: 'blue_dark',
|
|
139
|
+
buttonColor: 'red',
|
|
140
|
+
textColor: 'white',
|
|
133
141
|
mbshipID: null,
|
|
134
|
-
|
|
142
|
+
otherAmountText: 'will help us fund amazing projects in the UK and around the world.',
|
|
135
143
|
subtitle: '',
|
|
136
144
|
noMoneyBuys: false,
|
|
137
145
|
PopUpText: 'Help us deliver long-term impact by converting your single donation into a monthly gift.',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Donate
|
|
2
2
|
|
|
3
|
-
## Form align right, with red
|
|
3
|
+
## Form align right, with red desktop overlay and purple mobile background colour
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import data from './dev-data/data';
|
|
@@ -9,7 +9,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
9
9
|
|
|
10
10
|
<Donate
|
|
11
11
|
alt="Background image"
|
|
12
|
-
backgroundColor="
|
|
12
|
+
backgroundColor="deep_violet_dark"
|
|
13
|
+
overlayColor="red"
|
|
13
14
|
formAlignRight={true}
|
|
14
15
|
imageLow={desktopPictures.imageLow}
|
|
15
16
|
images={desktopPictures.images}
|
|
@@ -22,11 +23,10 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
22
23
|
cartID="default-comicrelief"
|
|
23
24
|
title="Donate Now"
|
|
24
25
|
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
26
|
/>;
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
## Form align left
|
|
29
|
+
## Form align left, with custom message after choosing an "Other amount" to donate.
|
|
30
30
|
|
|
31
31
|
```js
|
|
32
32
|
import data from './dev-data/data';
|
|
@@ -35,6 +35,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
35
35
|
|
|
36
36
|
<Donate
|
|
37
37
|
backgroundColor="blue_dark"
|
|
38
|
+
overlayColor="blue_dark"
|
|
38
39
|
formAlignRight={false}
|
|
39
40
|
imageLow={desktopPictures.imageLow}
|
|
40
41
|
images={desktopPictures.images}
|
|
@@ -47,7 +48,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
47
48
|
cartID="default-comicrelief"
|
|
48
49
|
title="Donate Now"
|
|
49
50
|
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
50
|
-
|
|
51
|
+
otherAmountText="Overridden via the 'Other amount text' prop"
|
|
51
52
|
/>;
|
|
52
53
|
```
|
|
53
54
|
|
|
@@ -60,6 +61,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
60
61
|
|
|
61
62
|
<Donate
|
|
62
63
|
backgroundColor="blue_dark"
|
|
64
|
+
overlayColor="blue_dark"
|
|
63
65
|
formAlignRight={false}
|
|
64
66
|
imageLow={desktopPictures.imageLow}
|
|
65
67
|
images={desktopPictures.images}
|
|
@@ -72,7 +74,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
72
74
|
cartID="default-comicrelief"
|
|
73
75
|
title="Donate Now"
|
|
74
76
|
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
77
|
/>;
|
|
77
78
|
```
|
|
78
79
|
|
|
@@ -85,6 +86,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
85
86
|
|
|
86
87
|
<Donate
|
|
87
88
|
backgroundColor="blue_dark"
|
|
89
|
+
overlayColor="blue_dark"
|
|
88
90
|
formAlignRight={false}
|
|
89
91
|
imageLow={desktopPictures.imageLow}
|
|
90
92
|
images={desktopPictures.images}
|
|
@@ -98,7 +100,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
98
100
|
title="Donate Now"
|
|
99
101
|
noMoneyBuys
|
|
100
102
|
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
103
|
/>;
|
|
103
104
|
```
|
|
104
105
|
|
|
@@ -112,6 +113,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
112
113
|
<Donate
|
|
113
114
|
alt="Background image"
|
|
114
115
|
backgroundColor="transparent"
|
|
116
|
+
overlayColor="transparent"
|
|
115
117
|
formAlignRight={true}
|
|
116
118
|
imageLow={desktopPictures.imageLow}
|
|
117
119
|
images={desktopPictures.images}
|
|
@@ -124,7 +126,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
124
126
|
cartID="default-comicrelief"
|
|
125
127
|
title="Donate Now"
|
|
126
128
|
subtitle=""
|
|
127
|
-
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
128
129
|
/>;
|
|
129
130
|
```
|
|
130
131
|
|
|
@@ -149,7 +150,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
149
150
|
cartID="default-comicrelief"
|
|
150
151
|
title="Donate Now"
|
|
151
152
|
subtitle=""
|
|
152
|
-
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
153
153
|
/>;
|
|
154
154
|
```
|
|
155
155
|
|
|
@@ -174,7 +174,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
174
174
|
cartID="default-comicrelief"
|
|
175
175
|
title="Donate Now"
|
|
176
176
|
subtitle=""
|
|
177
|
-
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
178
177
|
/>;
|
|
179
178
|
```
|
|
180
179
|
|
|
@@ -200,16 +199,16 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
200
199
|
title="Donate Now"
|
|
201
200
|
noMoneyBuys
|
|
202
201
|
subtitle=""
|
|
203
|
-
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
204
202
|
/>;
|
|
205
203
|
```
|
|
206
204
|
|
|
207
|
-
## Single Giving "No Money Buys", no background image, overriding 'choose amount' text
|
|
205
|
+
## Single Giving "No Money Buys", no background image, blue background; overriding 'choose amount' text
|
|
208
206
|
|
|
209
207
|
```js
|
|
210
208
|
import data from './dev-data/data-single';
|
|
211
209
|
|
|
212
210
|
<Donate
|
|
211
|
+
overlayColor="blue_dark"
|
|
213
212
|
backgroundColor="blue_dark"
|
|
214
213
|
formAlignRight={false}
|
|
215
214
|
data={data}
|
|
@@ -220,12 +219,11 @@ import data from './dev-data/data-single';
|
|
|
220
219
|
title="Donate Now"
|
|
221
220
|
noMoneyBuys
|
|
222
221
|
subtitle=""
|
|
223
|
-
|
|
224
|
-
chooseAmountText="Overridden via the 'choose amount text' props"
|
|
222
|
+
chooseAmountText="Overridden via the 'choose amount text' prop"
|
|
225
223
|
/>;
|
|
226
224
|
```
|
|
227
225
|
|
|
228
|
-
## Forcing mobile layout via isDesktop override; needed to pass parent prop for external media queries
|
|
226
|
+
## Forcing mobile layout via isDesktop override; needed to pass parent prop for external media queries, red background
|
|
229
227
|
|
|
230
228
|
```js
|
|
231
229
|
import data from './dev-data/data';
|
|
@@ -235,6 +233,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
235
233
|
<Donate
|
|
236
234
|
alt="Background image"
|
|
237
235
|
backgroundColor="red"
|
|
236
|
+
overlayColor="red"
|
|
238
237
|
formAlignRight={true}
|
|
239
238
|
imageLow={desktopPictures.imageLow}
|
|
240
239
|
images={desktopPictures.images}
|
|
@@ -247,7 +246,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
247
246
|
cartID="default-comicrelief"
|
|
248
247
|
title="Donate Now"
|
|
249
248
|
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
249
|
isDesktopOverride={false}
|
|
252
250
|
/>;
|
|
253
251
|
```
|
|
@@ -26,12 +26,13 @@ var Container = _styledComponents.default.div.withConfig({
|
|
|
26
26
|
displayName: "Donatestyle__Container",
|
|
27
27
|
componentId: "sc-8rjm3t-0"
|
|
28
28
|
})(["position:relative;display:flex;flex-direction:column;justify-content:center;height:auto;background-color:", ";", "{flex-direction:row;align-items:center;justify-content:inherit;background-color:", ";}"], function (_ref) {
|
|
29
|
-
var theme = _ref.theme
|
|
30
|
-
|
|
29
|
+
var theme = _ref.theme,
|
|
30
|
+
backgroundColor = _ref.backgroundColor;
|
|
31
|
+
return theme.color(backgroundColor);
|
|
31
32
|
}, (0, _size.media)('medium'), function (_ref2) {
|
|
32
33
|
var theme = _ref2.theme,
|
|
33
|
-
|
|
34
|
-
return theme.color(
|
|
34
|
+
overlayColor = _ref2.overlayColor;
|
|
35
|
+
return theme.color(overlayColor);
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
exports.Container = Container;
|
|
@@ -171,8 +172,9 @@ var Button = _styledComponents.default.button.withConfig({
|
|
|
171
172
|
var theme = _ref14.theme;
|
|
172
173
|
return theme.fontSize('s');
|
|
173
174
|
}, function (_ref15) {
|
|
174
|
-
var theme = _ref15.theme
|
|
175
|
-
|
|
175
|
+
var theme = _ref15.theme,
|
|
176
|
+
buttonColor = _ref15.buttonColor;
|
|
177
|
+
return theme.color(buttonColor);
|
|
176
178
|
}, function (_ref16) {
|
|
177
179
|
var theme = _ref16.theme;
|
|
178
180
|
return theme.color('coral_dark');
|
|
@@ -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", "buttonColor"];
|
|
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,13 +36,14 @@ 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,
|
|
43
43
|
noMoneyBuys = _ref.noMoneyBuys,
|
|
44
44
|
PopUpText = _ref.PopUpText,
|
|
45
45
|
chooseAmountText = _ref.chooseAmountText,
|
|
46
|
+
buttonColor = _ref.buttonColor,
|
|
46
47
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
47
48
|
|
|
48
49
|
var _useState = (0, _react.useState)('single'),
|
|
@@ -86,7 +87,7 @@ var Signup = function Signup(_ref) {
|
|
|
86
87
|
}, [givingType, singleGiving, regularGiving]);
|
|
87
88
|
(0, _react.useEffect)(function () {
|
|
88
89
|
var givingData = givingType === 'single' ? singleGiving : regularGiving;
|
|
89
|
-
var moneyBuyNewDescription =
|
|
90
|
+
var moneyBuyNewDescription = otherAmountText;
|
|
90
91
|
givingData.moneybuys.map(function (moneyBuy, index) {
|
|
91
92
|
if (moneyBuy.value === amountDonate) {
|
|
92
93
|
moneyBuyNewDescription = moneyBuy.description;
|
|
@@ -102,7 +103,7 @@ var Signup = function Signup(_ref) {
|
|
|
102
103
|
if (errorMsg) setErrorMsg(false);
|
|
103
104
|
setMoneyBuyCopy(moneyBuyNewDescription);
|
|
104
105
|
}
|
|
105
|
-
}, [errorMsg, moneyBuyCopy, singleGiving, regularGiving, givingType, amountDonate,
|
|
106
|
+
}, [errorMsg, moneyBuyCopy, singleGiving, regularGiving, givingType, amountDonate, otherAmountText]); // Updates our flag that differentiates between the popup
|
|
106
107
|
// being *currently* open and it *ever* having been shown to user
|
|
107
108
|
|
|
108
109
|
(0, _react.useEffect)(function () {
|
|
@@ -184,11 +185,13 @@ var Signup = function Signup(_ref) {
|
|
|
184
185
|
}, "Please enter an amount between \xA31 and \xA325000 and up to 2 decimal places"), noMoneyBuys ? /*#__PURE__*/_react.default.createElement(_Donate.Button, {
|
|
185
186
|
type: "submit",
|
|
186
187
|
as: "input",
|
|
187
|
-
value: "Donate"
|
|
188
|
+
value: "Donate",
|
|
189
|
+
buttonColor: buttonColor
|
|
188
190
|
}) : /*#__PURE__*/_react.default.createElement(_Donate.Button, {
|
|
189
191
|
type: "submit",
|
|
190
192
|
as: "input",
|
|
191
|
-
value: givingType === 'single' ? 'Donate now' : 'Donate monthly'
|
|
193
|
+
value: givingType === 'single' ? 'Donate now' : 'Donate monthly',
|
|
194
|
+
buttonColor: buttonColor
|
|
192
195
|
}))));
|
|
193
196
|
};
|
|
194
197
|
|
|
@@ -500,7 +500,7 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
500
500
|
-webkit-justify-content: inherit;
|
|
501
501
|
-ms-flex-pack: inherit;
|
|
502
502
|
justify-content: inherit;
|
|
503
|
-
background-color:
|
|
503
|
+
background-color: transparent;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
|
|
@@ -1251,7 +1251,7 @@ exports[`Single donation renders correctly 1`] = `
|
|
|
1251
1251
|
-webkit-justify-content: inherit;
|
|
1252
1252
|
-ms-flex-pack: inherit;
|
|
1253
1253
|
justify-content: inherit;
|
|
1254
|
-
background-color:
|
|
1254
|
+
background-color: transparent;
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
1257
|
|
|
@@ -1845,7 +1845,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
1845
1845
|
-webkit-justify-content: inherit;
|
|
1846
1846
|
-ms-flex-pack: inherit;
|
|
1847
1847
|
justify-content: inherit;
|
|
1848
|
-
background-color:
|
|
1848
|
+
background-color: transparent;
|
|
1849
1849
|
}
|
|
1850
1850
|
}
|
|
1851
1851
|
|
package/package.json
CHANGED
|
@@ -18,12 +18,15 @@ const Donate = ({
|
|
|
18
18
|
alt,
|
|
19
19
|
cartID,
|
|
20
20
|
clientID,
|
|
21
|
+
overlayColor,
|
|
21
22
|
backgroundColor,
|
|
23
|
+
buttonColor,
|
|
24
|
+
textColor,
|
|
22
25
|
donateLink,
|
|
23
26
|
data,
|
|
24
27
|
title,
|
|
25
28
|
subtitle,
|
|
26
|
-
|
|
29
|
+
otherAmountText,
|
|
27
30
|
formAlignRight,
|
|
28
31
|
images,
|
|
29
32
|
image,
|
|
@@ -52,7 +55,12 @@ const Donate = ({
|
|
|
52
55
|
isDesktop = overrideValue !== null ? overrideValue : isDesktop;
|
|
53
56
|
|
|
54
57
|
return (
|
|
55
|
-
<Container
|
|
58
|
+
<Container
|
|
59
|
+
backgroundColor={backgroundColor}
|
|
60
|
+
overlayColor={overlayColor}
|
|
61
|
+
id={mbshipID}
|
|
62
|
+
key={overrideValue}
|
|
63
|
+
>
|
|
56
64
|
{!isDesktop && mobileImages ? (
|
|
57
65
|
<Picture
|
|
58
66
|
backgroundColor={backgroundColor}
|
|
@@ -68,7 +76,7 @@ const Donate = ({
|
|
|
68
76
|
|
|
69
77
|
{isDesktop && images ? (
|
|
70
78
|
<BgImage
|
|
71
|
-
backgroundColor={
|
|
79
|
+
backgroundColor={overlayColor}
|
|
72
80
|
image={image}
|
|
73
81
|
images={images}
|
|
74
82
|
imageLow={imageLow}
|
|
@@ -87,7 +95,7 @@ const Donate = ({
|
|
|
87
95
|
<>
|
|
88
96
|
<Text
|
|
89
97
|
tag="h2"
|
|
90
|
-
color=
|
|
98
|
+
color={textColor}
|
|
91
99
|
size="big"
|
|
92
100
|
family="Anton"
|
|
93
101
|
weight="normal"
|
|
@@ -95,7 +103,7 @@ const Donate = ({
|
|
|
95
103
|
>
|
|
96
104
|
{title}
|
|
97
105
|
</Text>
|
|
98
|
-
<Text tag="p" color=
|
|
106
|
+
<Text tag="p" color={textColor} size="m">
|
|
99
107
|
{subtitle}
|
|
100
108
|
</Text>
|
|
101
109
|
</>
|
|
@@ -105,7 +113,7 @@ const Donate = ({
|
|
|
105
113
|
|
|
106
114
|
<Form
|
|
107
115
|
data={data}
|
|
108
|
-
|
|
116
|
+
otherAmountText={otherAmountText}
|
|
109
117
|
cartID={cartID}
|
|
110
118
|
clientID={clientID}
|
|
111
119
|
mbshipID={mbshipID}
|
|
@@ -113,6 +121,7 @@ const Donate = ({
|
|
|
113
121
|
noMoneyBuys={noMoneyBuys}
|
|
114
122
|
PopUpText={PopUpText}
|
|
115
123
|
chooseAmountText={chooseAmountText}
|
|
124
|
+
buttonColor={buttonColor}
|
|
116
125
|
/>
|
|
117
126
|
</Wrapper>
|
|
118
127
|
</Container>
|
|
@@ -126,7 +135,7 @@ Donate.propTypes = {
|
|
|
126
135
|
clientID: PropTypes.string.isRequired,
|
|
127
136
|
donateLink: PropTypes.string.isRequired,
|
|
128
137
|
title: PropTypes.string.isRequired,
|
|
129
|
-
|
|
138
|
+
otherAmountText: PropTypes.string,
|
|
130
139
|
subtitle: PropTypes.string,
|
|
131
140
|
formAlignRight: PropTypes.bool,
|
|
132
141
|
imageLow: PropTypes.string,
|
|
@@ -137,6 +146,9 @@ Donate.propTypes = {
|
|
|
137
146
|
mobileImages: PropTypes.string,
|
|
138
147
|
mobileAlt: PropTypes.string,
|
|
139
148
|
backgroundColor: PropTypes.string,
|
|
149
|
+
overlayColor: PropTypes.string,
|
|
150
|
+
buttonColor: PropTypes.string,
|
|
151
|
+
textColor: PropTypes.string,
|
|
140
152
|
mbshipID: PropTypes.string,
|
|
141
153
|
noMoneyBuys: PropTypes.bool,
|
|
142
154
|
PopUpText: PropTypes.string,
|
|
@@ -155,9 +167,12 @@ Donate.defaultProps = {
|
|
|
155
167
|
mobileImage: null,
|
|
156
168
|
mobileImages: null,
|
|
157
169
|
mobileAlt: '',
|
|
170
|
+
overlayColor: 'transparent',
|
|
158
171
|
backgroundColor: 'blue_dark',
|
|
172
|
+
buttonColor: 'red',
|
|
173
|
+
textColor: 'white',
|
|
159
174
|
mbshipID: null,
|
|
160
|
-
|
|
175
|
+
otherAmountText:
|
|
161
176
|
'will help us fund amazing projects in the UK and around the world.',
|
|
162
177
|
subtitle: '',
|
|
163
178
|
noMoneyBuys: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Donate
|
|
2
2
|
|
|
3
|
-
## Form align right, with red
|
|
3
|
+
## Form align right, with red desktop overlay and purple mobile background colour
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import data from './dev-data/data';
|
|
@@ -9,7 +9,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
9
9
|
|
|
10
10
|
<Donate
|
|
11
11
|
alt="Background image"
|
|
12
|
-
backgroundColor="
|
|
12
|
+
backgroundColor="deep_violet_dark"
|
|
13
|
+
overlayColor="red"
|
|
13
14
|
formAlignRight={true}
|
|
14
15
|
imageLow={desktopPictures.imageLow}
|
|
15
16
|
images={desktopPictures.images}
|
|
@@ -22,11 +23,10 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
22
23
|
cartID="default-comicrelief"
|
|
23
24
|
title="Donate Now"
|
|
24
25
|
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
26
|
/>;
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
## Form align left
|
|
29
|
+
## Form align left, with custom message after choosing an "Other amount" to donate.
|
|
30
30
|
|
|
31
31
|
```js
|
|
32
32
|
import data from './dev-data/data';
|
|
@@ -35,6 +35,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
35
35
|
|
|
36
36
|
<Donate
|
|
37
37
|
backgroundColor="blue_dark"
|
|
38
|
+
overlayColor="blue_dark"
|
|
38
39
|
formAlignRight={false}
|
|
39
40
|
imageLow={desktopPictures.imageLow}
|
|
40
41
|
images={desktopPictures.images}
|
|
@@ -47,7 +48,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
47
48
|
cartID="default-comicrelief"
|
|
48
49
|
title="Donate Now"
|
|
49
50
|
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
50
|
-
|
|
51
|
+
otherAmountText="Overridden via the 'Other amount text' prop"
|
|
51
52
|
/>;
|
|
52
53
|
```
|
|
53
54
|
|
|
@@ -60,6 +61,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
60
61
|
|
|
61
62
|
<Donate
|
|
62
63
|
backgroundColor="blue_dark"
|
|
64
|
+
overlayColor="blue_dark"
|
|
63
65
|
formAlignRight={false}
|
|
64
66
|
imageLow={desktopPictures.imageLow}
|
|
65
67
|
images={desktopPictures.images}
|
|
@@ -72,7 +74,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
72
74
|
cartID="default-comicrelief"
|
|
73
75
|
title="Donate Now"
|
|
74
76
|
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
77
|
/>;
|
|
77
78
|
```
|
|
78
79
|
|
|
@@ -85,6 +86,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
85
86
|
|
|
86
87
|
<Donate
|
|
87
88
|
backgroundColor="blue_dark"
|
|
89
|
+
overlayColor="blue_dark"
|
|
88
90
|
formAlignRight={false}
|
|
89
91
|
imageLow={desktopPictures.imageLow}
|
|
90
92
|
images={desktopPictures.images}
|
|
@@ -98,7 +100,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
98
100
|
title="Donate Now"
|
|
99
101
|
noMoneyBuys
|
|
100
102
|
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
103
|
/>;
|
|
103
104
|
```
|
|
104
105
|
|
|
@@ -112,6 +113,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
112
113
|
<Donate
|
|
113
114
|
alt="Background image"
|
|
114
115
|
backgroundColor="transparent"
|
|
116
|
+
overlayColor="transparent"
|
|
115
117
|
formAlignRight={true}
|
|
116
118
|
imageLow={desktopPictures.imageLow}
|
|
117
119
|
images={desktopPictures.images}
|
|
@@ -124,7 +126,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
124
126
|
cartID="default-comicrelief"
|
|
125
127
|
title="Donate Now"
|
|
126
128
|
subtitle=""
|
|
127
|
-
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
128
129
|
/>;
|
|
129
130
|
```
|
|
130
131
|
|
|
@@ -149,7 +150,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
149
150
|
cartID="default-comicrelief"
|
|
150
151
|
title="Donate Now"
|
|
151
152
|
subtitle=""
|
|
152
|
-
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
153
153
|
/>;
|
|
154
154
|
```
|
|
155
155
|
|
|
@@ -174,7 +174,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
174
174
|
cartID="default-comicrelief"
|
|
175
175
|
title="Donate Now"
|
|
176
176
|
subtitle=""
|
|
177
|
-
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
178
177
|
/>;
|
|
179
178
|
```
|
|
180
179
|
|
|
@@ -200,16 +199,16 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
200
199
|
title="Donate Now"
|
|
201
200
|
noMoneyBuys
|
|
202
201
|
subtitle=""
|
|
203
|
-
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
204
202
|
/>;
|
|
205
203
|
```
|
|
206
204
|
|
|
207
|
-
## Single Giving "No Money Buys", no background image, overriding 'choose amount' text
|
|
205
|
+
## Single Giving "No Money Buys", no background image, blue background; overriding 'choose amount' text
|
|
208
206
|
|
|
209
207
|
```js
|
|
210
208
|
import data from './dev-data/data-single';
|
|
211
209
|
|
|
212
210
|
<Donate
|
|
211
|
+
overlayColor="blue_dark"
|
|
213
212
|
backgroundColor="blue_dark"
|
|
214
213
|
formAlignRight={false}
|
|
215
214
|
data={data}
|
|
@@ -220,12 +219,11 @@ import data from './dev-data/data-single';
|
|
|
220
219
|
title="Donate Now"
|
|
221
220
|
noMoneyBuys
|
|
222
221
|
subtitle=""
|
|
223
|
-
|
|
224
|
-
chooseAmountText="Overridden via the 'choose amount text' props"
|
|
222
|
+
chooseAmountText="Overridden via the 'choose amount text' prop"
|
|
225
223
|
/>;
|
|
226
224
|
```
|
|
227
225
|
|
|
228
|
-
## Forcing mobile layout via isDesktop override; needed to pass parent prop for external media queries
|
|
226
|
+
## Forcing mobile layout via isDesktop override; needed to pass parent prop for external media queries, red background
|
|
229
227
|
|
|
230
228
|
```js
|
|
231
229
|
import data from './dev-data/data';
|
|
@@ -235,6 +233,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
235
233
|
<Donate
|
|
236
234
|
alt="Background image"
|
|
237
235
|
backgroundColor="red"
|
|
236
|
+
overlayColor="red"
|
|
238
237
|
formAlignRight={true}
|
|
239
238
|
imageLow={desktopPictures.imageLow}
|
|
240
239
|
images={desktopPictures.images}
|
|
@@ -247,7 +246,6 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
247
246
|
cartID="default-comicrelief"
|
|
248
247
|
title="Donate Now"
|
|
249
248
|
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
249
|
isDesktopOverride={false}
|
|
252
250
|
/>;
|
|
253
251
|
```
|
|
@@ -14,12 +14,12 @@ const Container = styled.div`
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
justify-content: center;
|
|
16
16
|
height: auto;
|
|
17
|
-
background-color: ${({ theme }) => theme.color(
|
|
17
|
+
background-color: ${({ theme, backgroundColor }) => theme.color(backgroundColor)};
|
|
18
18
|
${media('medium')} {
|
|
19
19
|
flex-direction: row;
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: inherit;
|
|
22
|
-
background-color: ${({ theme,
|
|
22
|
+
background-color: ${({ theme, overlayColor }) => theme.color(overlayColor)};
|
|
23
23
|
}
|
|
24
24
|
`;
|
|
25
25
|
|
|
@@ -215,7 +215,7 @@ const Button = styled.button`
|
|
|
215
215
|
font-weight: bold;
|
|
216
216
|
cursor: pointer;
|
|
217
217
|
min-height: 48px;
|
|
218
|
-
background: ${({ theme }) => theme.color(
|
|
218
|
+
background: ${({ theme, buttonColor }) => theme.color(buttonColor)};
|
|
219
219
|
text-decoration: none;
|
|
220
220
|
border-radius: 2rem;
|
|
221
221
|
border: none;
|
|
@@ -26,13 +26,14 @@ 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,
|
|
33
33
|
noMoneyBuys,
|
|
34
34
|
PopUpText,
|
|
35
35
|
chooseAmountText,
|
|
36
|
+
buttonColor,
|
|
36
37
|
...rest
|
|
37
38
|
}) => {
|
|
38
39
|
const [givingType, setGivingType] = useState('single');
|
|
@@ -59,7 +60,7 @@ const Signup = ({
|
|
|
59
60
|
useEffect(() => {
|
|
60
61
|
const givingData = givingType === 'single' ? singleGiving : regularGiving;
|
|
61
62
|
|
|
62
|
-
let moneyBuyNewDescription =
|
|
63
|
+
let moneyBuyNewDescription = otherAmountText;
|
|
63
64
|
|
|
64
65
|
givingData.moneybuys.map((moneyBuy, index) => {
|
|
65
66
|
if (moneyBuy.value === amountDonate) {
|
|
@@ -88,7 +89,7 @@ const Signup = ({
|
|
|
88
89
|
regularGiving,
|
|
89
90
|
givingType,
|
|
90
91
|
amountDonate,
|
|
91
|
-
|
|
92
|
+
otherAmountText
|
|
92
93
|
]);
|
|
93
94
|
|
|
94
95
|
// Updates our flag that differentiates between the popup
|
|
@@ -211,12 +212,13 @@ const Signup = ({
|
|
|
211
212
|
)}
|
|
212
213
|
|
|
213
214
|
{noMoneyBuys ? (
|
|
214
|
-
<Button type="submit" as="input" value="Donate" />
|
|
215
|
+
<Button type="submit" as="input" value="Donate" buttonColor={buttonColor} />
|
|
215
216
|
) : (
|
|
216
217
|
<Button
|
|
217
218
|
type="submit"
|
|
218
219
|
as="input"
|
|
219
220
|
value={givingType === 'single' ? 'Donate now' : 'Donate monthly'}
|
|
221
|
+
buttonColor={buttonColor}
|
|
220
222
|
/>
|
|
221
223
|
)}
|
|
222
224
|
|
|
@@ -230,12 +232,13 @@ Signup.propTypes = {
|
|
|
230
232
|
clientID: PropTypes.string.isRequired,
|
|
231
233
|
cartID: PropTypes.string.isRequired,
|
|
232
234
|
donateLink: PropTypes.string.isRequired,
|
|
233
|
-
|
|
235
|
+
otherAmountText: PropTypes.string.isRequired,
|
|
234
236
|
mbshipID: PropTypes.string.isRequired,
|
|
235
237
|
noMoneyBuys: PropTypes.bool,
|
|
236
238
|
data: PropTypes.objectOf(PropTypes.shape),
|
|
237
239
|
PopUpText: PropTypes.string.isRequired,
|
|
238
|
-
chooseAmountText: PropTypes.string.isRequired
|
|
240
|
+
chooseAmountText: PropTypes.string.isRequired,
|
|
241
|
+
buttonColor: PropTypes.string.isRequired
|
|
239
242
|
};
|
|
240
243
|
|
|
241
244
|
Signup.defaultProps = {
|
|
@@ -500,7 +500,7 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
500
500
|
-webkit-justify-content: inherit;
|
|
501
501
|
-ms-flex-pack: inherit;
|
|
502
502
|
justify-content: inherit;
|
|
503
|
-
background-color:
|
|
503
|
+
background-color: transparent;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
|
|
@@ -1251,7 +1251,7 @@ exports[`Single donation renders correctly 1`] = `
|
|
|
1251
1251
|
-webkit-justify-content: inherit;
|
|
1252
1252
|
-ms-flex-pack: inherit;
|
|
1253
1253
|
justify-content: inherit;
|
|
1254
|
-
background-color:
|
|
1254
|
+
background-color: transparent;
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
1257
|
|
|
@@ -1845,7 +1845,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
1845
1845
|
-webkit-justify-content: inherit;
|
|
1846
1846
|
-ms-flex-pack: inherit;
|
|
1847
1847
|
justify-content: inherit;
|
|
1848
|
-
background-color:
|
|
1848
|
+
background-color: transparent;
|
|
1849
1849
|
}
|
|
1850
1850
|
}
|
|
1851
1851
|
|