@comicrelief/component-library 7.4.0 → 7.6.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 +16 -8
- package/dist/components/Organisms/Donate/Donate.md +21 -13
- package/dist/components/Organisms/Donate/Donate.style.js +8 -6
- package/dist/components/Organisms/Donate/Form/Form.js +6 -3
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +6 -3
- package/package.json +1 -1
- package/src/components/Organisms/Donate/Donate.js +23 -8
- package/src/components/Organisms/Donate/Donate.md +21 -13
- package/src/components/Organisms/Donate/Donate.style.js +3 -3
- package/src/components/Organisms/Donate/Form/Form.js +5 -2
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +6 -3
|
@@ -31,7 +31,10 @@ var Donate = function Donate(_ref) {
|
|
|
31
31
|
var alt = _ref.alt,
|
|
32
32
|
cartID = _ref.cartID,
|
|
33
33
|
clientID = _ref.clientID,
|
|
34
|
-
|
|
34
|
+
desktopOverlayColor = _ref.desktopOverlayColor,
|
|
35
|
+
mobileBackgroundColor = _ref.mobileBackgroundColor,
|
|
36
|
+
submitButtonColor = _ref.submitButtonColor,
|
|
37
|
+
textColor = _ref.textColor,
|
|
35
38
|
donateLink = _ref.donateLink,
|
|
36
39
|
data = _ref.data,
|
|
37
40
|
title = _ref.title,
|
|
@@ -67,11 +70,12 @@ var Donate = function Donate(_ref) {
|
|
|
67
70
|
|
|
68
71
|
isDesktop = overrideValue !== null ? overrideValue : isDesktop;
|
|
69
72
|
return /*#__PURE__*/_react.default.createElement(_Donate.Container, {
|
|
70
|
-
|
|
73
|
+
mobileBackgroundColor: mobileBackgroundColor,
|
|
74
|
+
desktopOverlayColor: desktopOverlayColor,
|
|
71
75
|
id: mbshipID,
|
|
72
76
|
key: overrideValue
|
|
73
77
|
}, !isDesktop && mobileImages ? /*#__PURE__*/_react.default.createElement(_Picture.default, {
|
|
74
|
-
backgroundColor:
|
|
78
|
+
backgroundColor: mobileBackgroundColor,
|
|
75
79
|
image: mobileImage,
|
|
76
80
|
images: mobileImages,
|
|
77
81
|
imageLow: mobileImageLow,
|
|
@@ -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: desktopOverlayColor,
|
|
84
88
|
image: image,
|
|
85
89
|
images: images,
|
|
86
90
|
imageLow: imageLow,
|
|
@@ -96,14 +100,14 @@ 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,
|
|
@@ -114,7 +118,8 @@ var Donate = function Donate(_ref) {
|
|
|
114
118
|
donateLink: donateLink,
|
|
115
119
|
noMoneyBuys: noMoneyBuys,
|
|
116
120
|
PopUpText: PopUpText,
|
|
117
|
-
chooseAmountText: chooseAmountText
|
|
121
|
+
chooseAmountText: chooseAmountText,
|
|
122
|
+
submitButtonColor: submitButtonColor
|
|
118
123
|
})));
|
|
119
124
|
};
|
|
120
125
|
|
|
@@ -129,7 +134,10 @@ Donate.defaultProps = {
|
|
|
129
134
|
mobileImage: null,
|
|
130
135
|
mobileImages: null,
|
|
131
136
|
mobileAlt: '',
|
|
132
|
-
|
|
137
|
+
desktopOverlayColor: 'transparent',
|
|
138
|
+
mobileBackgroundColor: 'blue_dark',
|
|
139
|
+
submitButtonColor: '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: '',
|
|
@@ -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, with a blue submit button
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import data from './dev-data/data';
|
|
@@ -9,7 +9,9 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
9
9
|
|
|
10
10
|
<Donate
|
|
11
11
|
alt="Background image"
|
|
12
|
-
|
|
12
|
+
mobileBackgroundColor="deep_violet_dark"
|
|
13
|
+
desktopOverlayColor="red"
|
|
14
|
+
submitButtonColor="blue_dark"
|
|
13
15
|
formAlignRight={true}
|
|
14
16
|
imageLow={desktopPictures.imageLow}
|
|
15
17
|
images={desktopPictures.images}
|
|
@@ -33,7 +35,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
33
35
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
34
36
|
|
|
35
37
|
<Donate
|
|
36
|
-
|
|
38
|
+
mobileBackgroundColor="blue_dark"
|
|
39
|
+
desktopOverlayColor="blue_dark"
|
|
37
40
|
formAlignRight={false}
|
|
38
41
|
imageLow={desktopPictures.imageLow}
|
|
39
42
|
images={desktopPictures.images}
|
|
@@ -58,7 +61,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
58
61
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
59
62
|
|
|
60
63
|
<Donate
|
|
61
|
-
|
|
64
|
+
mobileBackgroundColor="blue_dark"
|
|
65
|
+
desktopOverlayColor="blue_dark"
|
|
62
66
|
formAlignRight={false}
|
|
63
67
|
imageLow={desktopPictures.imageLow}
|
|
64
68
|
images={desktopPictures.images}
|
|
@@ -82,7 +86,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
82
86
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
83
87
|
|
|
84
88
|
<Donate
|
|
85
|
-
|
|
89
|
+
mobileBackgroundColor="blue_dark"
|
|
90
|
+
desktopOverlayColor="blue_dark"
|
|
86
91
|
formAlignRight={false}
|
|
87
92
|
imageLow={desktopPictures.imageLow}
|
|
88
93
|
images={desktopPictures.images}
|
|
@@ -108,7 +113,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
108
113
|
|
|
109
114
|
<Donate
|
|
110
115
|
alt="Background image"
|
|
111
|
-
|
|
116
|
+
mobileBackgroundColor="transparent"
|
|
117
|
+
desktopOverlayColor="transparent"
|
|
112
118
|
formAlignRight={true}
|
|
113
119
|
imageLow={desktopPictures.imageLow}
|
|
114
120
|
images={desktopPictures.images}
|
|
@@ -132,7 +138,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
132
138
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
133
139
|
|
|
134
140
|
<Donate
|
|
135
|
-
|
|
141
|
+
mobileBackgroundColor="transparent"
|
|
136
142
|
formAlignRight={false}
|
|
137
143
|
imageLow={desktopPictures.imageLow}
|
|
138
144
|
images={desktopPictures.images}
|
|
@@ -156,7 +162,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
156
162
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
157
163
|
|
|
158
164
|
<Donate
|
|
159
|
-
|
|
165
|
+
mobileBackgroundColor="blue_dark"
|
|
160
166
|
formAlignRight={false}
|
|
161
167
|
imageLow={desktopPictures.imageLow}
|
|
162
168
|
images={desktopPictures.images}
|
|
@@ -180,7 +186,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
180
186
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
181
187
|
|
|
182
188
|
<Donate
|
|
183
|
-
|
|
189
|
+
mobileBackgroundColor="blue_dark"
|
|
184
190
|
formAlignRight={false}
|
|
185
191
|
imageLow={desktopPictures.imageLow}
|
|
186
192
|
images={desktopPictures.images}
|
|
@@ -197,13 +203,14 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
197
203
|
/>;
|
|
198
204
|
```
|
|
199
205
|
|
|
200
|
-
## Single Giving "No Money Buys", no background image, overriding 'choose amount' text
|
|
206
|
+
## Single Giving "No Money Buys", no background image, blue background; overriding 'choose amount' text
|
|
201
207
|
|
|
202
208
|
```js
|
|
203
209
|
import data from './dev-data/data-single';
|
|
204
210
|
|
|
205
211
|
<Donate
|
|
206
|
-
|
|
212
|
+
desktopOverlayColor="blue_dark"
|
|
213
|
+
mobileBackgroundColor="blue_dark"
|
|
207
214
|
formAlignRight={false}
|
|
208
215
|
data={data}
|
|
209
216
|
mbshipID="mship-9"
|
|
@@ -217,7 +224,7 @@ import data from './dev-data/data-single';
|
|
|
217
224
|
/>;
|
|
218
225
|
```
|
|
219
226
|
|
|
220
|
-
## Forcing mobile layout via isDesktop override; needed to pass parent prop for external media queries
|
|
227
|
+
## Forcing mobile layout via isDesktop override; needed to pass parent prop for external media queries, red background
|
|
221
228
|
|
|
222
229
|
```js
|
|
223
230
|
import data from './dev-data/data';
|
|
@@ -226,7 +233,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
226
233
|
|
|
227
234
|
<Donate
|
|
228
235
|
alt="Background image"
|
|
229
|
-
|
|
236
|
+
mobileBackgroundColor="red"
|
|
237
|
+
desktopOverlayColor="red"
|
|
230
238
|
formAlignRight={true}
|
|
231
239
|
imageLow={desktopPictures.imageLow}
|
|
232
240
|
images={desktopPictures.images}
|
|
@@ -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
|
+
mobileBackgroundColor = _ref.mobileBackgroundColor;
|
|
31
|
+
return theme.color(mobileBackgroundColor);
|
|
31
32
|
}, (0, _size.media)('medium'), function (_ref2) {
|
|
32
33
|
var theme = _ref2.theme,
|
|
33
|
-
|
|
34
|
-
return theme.color(
|
|
34
|
+
desktopOverlayColor = _ref2.desktopOverlayColor;
|
|
35
|
+
return theme.color(desktopOverlayColor);
|
|
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
|
+
color = _ref15.color;
|
|
177
|
+
return theme.color(color);
|
|
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", "otherAmountText", "clientID", "cartID", "mbshipID", "noMoneyBuys", "PopUpText", "chooseAmountText"];
|
|
28
|
+
var _excluded = ["data", "donateLink", "otherAmountText", "clientID", "cartID", "mbshipID", "noMoneyBuys", "PopUpText", "chooseAmountText", "submitButtonColor"];
|
|
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
|
|
|
@@ -43,6 +43,7 @@ var Signup = function Signup(_ref) {
|
|
|
43
43
|
noMoneyBuys = _ref.noMoneyBuys,
|
|
44
44
|
PopUpText = _ref.PopUpText,
|
|
45
45
|
chooseAmountText = _ref.chooseAmountText,
|
|
46
|
+
submitButtonColor = _ref.submitButtonColor,
|
|
46
47
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
47
48
|
|
|
48
49
|
var _useState = (0, _react.useState)('single'),
|
|
@@ -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
|
+
color: submitButtonColor
|
|
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
|
+
color: submitButtonColor
|
|
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
|
|
|
@@ -835,6 +835,7 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
835
835
|
</div>
|
|
836
836
|
<input
|
|
837
837
|
className="c28"
|
|
838
|
+
color="red"
|
|
838
839
|
type="submit"
|
|
839
840
|
value="Donate now"
|
|
840
841
|
/>
|
|
@@ -1251,7 +1252,7 @@ exports[`Single donation renders correctly 1`] = `
|
|
|
1251
1252
|
-webkit-justify-content: inherit;
|
|
1252
1253
|
-ms-flex-pack: inherit;
|
|
1253
1254
|
justify-content: inherit;
|
|
1254
|
-
background-color:
|
|
1255
|
+
background-color: transparent;
|
|
1255
1256
|
}
|
|
1256
1257
|
}
|
|
1257
1258
|
|
|
@@ -1546,6 +1547,7 @@ exports[`Single donation renders correctly 1`] = `
|
|
|
1546
1547
|
</p>
|
|
1547
1548
|
<input
|
|
1548
1549
|
className="c24"
|
|
1550
|
+
color="red"
|
|
1549
1551
|
type="submit"
|
|
1550
1552
|
value="Donate now"
|
|
1551
1553
|
/>
|
|
@@ -1845,7 +1847,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
1845
1847
|
-webkit-justify-content: inherit;
|
|
1846
1848
|
-ms-flex-pack: inherit;
|
|
1847
1849
|
justify-content: inherit;
|
|
1848
|
-
background-color:
|
|
1850
|
+
background-color: transparent;
|
|
1849
1851
|
}
|
|
1850
1852
|
}
|
|
1851
1853
|
|
|
@@ -2004,6 +2006,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
2004
2006
|
</div>
|
|
2005
2007
|
<input
|
|
2006
2008
|
className="c18"
|
|
2009
|
+
color="red"
|
|
2007
2010
|
type="submit"
|
|
2008
2011
|
value="Donate"
|
|
2009
2012
|
/>
|
package/package.json
CHANGED
|
@@ -18,7 +18,10 @@ const Donate = ({
|
|
|
18
18
|
alt,
|
|
19
19
|
cartID,
|
|
20
20
|
clientID,
|
|
21
|
-
|
|
21
|
+
desktopOverlayColor,
|
|
22
|
+
mobileBackgroundColor,
|
|
23
|
+
submitButtonColor,
|
|
24
|
+
textColor,
|
|
22
25
|
donateLink,
|
|
23
26
|
data,
|
|
24
27
|
title,
|
|
@@ -52,10 +55,15 @@ const Donate = ({
|
|
|
52
55
|
isDesktop = overrideValue !== null ? overrideValue : isDesktop;
|
|
53
56
|
|
|
54
57
|
return (
|
|
55
|
-
<Container
|
|
58
|
+
<Container
|
|
59
|
+
mobileBackgroundColor={mobileBackgroundColor}
|
|
60
|
+
desktopOverlayColor={desktopOverlayColor}
|
|
61
|
+
id={mbshipID}
|
|
62
|
+
key={overrideValue}
|
|
63
|
+
>
|
|
56
64
|
{!isDesktop && mobileImages ? (
|
|
57
65
|
<Picture
|
|
58
|
-
backgroundColor={
|
|
66
|
+
backgroundColor={mobileBackgroundColor}
|
|
59
67
|
image={mobileImage}
|
|
60
68
|
images={mobileImages}
|
|
61
69
|
imageLow={mobileImageLow}
|
|
@@ -68,7 +76,7 @@ const Donate = ({
|
|
|
68
76
|
|
|
69
77
|
{isDesktop && images ? (
|
|
70
78
|
<BgImage
|
|
71
|
-
backgroundColor={
|
|
79
|
+
backgroundColor={desktopOverlayColor}
|
|
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
|
</>
|
|
@@ -113,6 +121,7 @@ const Donate = ({
|
|
|
113
121
|
noMoneyBuys={noMoneyBuys}
|
|
114
122
|
PopUpText={PopUpText}
|
|
115
123
|
chooseAmountText={chooseAmountText}
|
|
124
|
+
submitButtonColor={submitButtonColor}
|
|
116
125
|
/>
|
|
117
126
|
</Wrapper>
|
|
118
127
|
</Container>
|
|
@@ -136,7 +145,10 @@ Donate.propTypes = {
|
|
|
136
145
|
mobileImage: PropTypes.string,
|
|
137
146
|
mobileImages: PropTypes.string,
|
|
138
147
|
mobileAlt: PropTypes.string,
|
|
139
|
-
|
|
148
|
+
mobileBackgroundColor: PropTypes.string,
|
|
149
|
+
desktopOverlayColor: PropTypes.string,
|
|
150
|
+
submitButtonColor: PropTypes.string,
|
|
151
|
+
textColor: PropTypes.string,
|
|
140
152
|
mbshipID: PropTypes.string,
|
|
141
153
|
noMoneyBuys: PropTypes.bool,
|
|
142
154
|
PopUpText: PropTypes.string,
|
|
@@ -155,7 +167,10 @@ Donate.defaultProps = {
|
|
|
155
167
|
mobileImage: null,
|
|
156
168
|
mobileImages: null,
|
|
157
169
|
mobileAlt: '',
|
|
158
|
-
|
|
170
|
+
desktopOverlayColor: 'transparent',
|
|
171
|
+
mobileBackgroundColor: 'blue_dark',
|
|
172
|
+
submitButtonColor: '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.',
|
|
@@ -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, with a blue submit button
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import data from './dev-data/data';
|
|
@@ -9,7 +9,9 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
9
9
|
|
|
10
10
|
<Donate
|
|
11
11
|
alt="Background image"
|
|
12
|
-
|
|
12
|
+
mobileBackgroundColor="deep_violet_dark"
|
|
13
|
+
desktopOverlayColor="red"
|
|
14
|
+
submitButtonColor="blue_dark"
|
|
13
15
|
formAlignRight={true}
|
|
14
16
|
imageLow={desktopPictures.imageLow}
|
|
15
17
|
images={desktopPictures.images}
|
|
@@ -33,7 +35,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
33
35
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
34
36
|
|
|
35
37
|
<Donate
|
|
36
|
-
|
|
38
|
+
mobileBackgroundColor="blue_dark"
|
|
39
|
+
desktopOverlayColor="blue_dark"
|
|
37
40
|
formAlignRight={false}
|
|
38
41
|
imageLow={desktopPictures.imageLow}
|
|
39
42
|
images={desktopPictures.images}
|
|
@@ -58,7 +61,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
58
61
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
59
62
|
|
|
60
63
|
<Donate
|
|
61
|
-
|
|
64
|
+
mobileBackgroundColor="blue_dark"
|
|
65
|
+
desktopOverlayColor="blue_dark"
|
|
62
66
|
formAlignRight={false}
|
|
63
67
|
imageLow={desktopPictures.imageLow}
|
|
64
68
|
images={desktopPictures.images}
|
|
@@ -82,7 +86,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
82
86
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
83
87
|
|
|
84
88
|
<Donate
|
|
85
|
-
|
|
89
|
+
mobileBackgroundColor="blue_dark"
|
|
90
|
+
desktopOverlayColor="blue_dark"
|
|
86
91
|
formAlignRight={false}
|
|
87
92
|
imageLow={desktopPictures.imageLow}
|
|
88
93
|
images={desktopPictures.images}
|
|
@@ -108,7 +113,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
108
113
|
|
|
109
114
|
<Donate
|
|
110
115
|
alt="Background image"
|
|
111
|
-
|
|
116
|
+
mobileBackgroundColor="transparent"
|
|
117
|
+
desktopOverlayColor="transparent"
|
|
112
118
|
formAlignRight={true}
|
|
113
119
|
imageLow={desktopPictures.imageLow}
|
|
114
120
|
images={desktopPictures.images}
|
|
@@ -132,7 +138,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
132
138
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
133
139
|
|
|
134
140
|
<Donate
|
|
135
|
-
|
|
141
|
+
mobileBackgroundColor="transparent"
|
|
136
142
|
formAlignRight={false}
|
|
137
143
|
imageLow={desktopPictures.imageLow}
|
|
138
144
|
images={desktopPictures.images}
|
|
@@ -156,7 +162,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
156
162
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
157
163
|
|
|
158
164
|
<Donate
|
|
159
|
-
|
|
165
|
+
mobileBackgroundColor="blue_dark"
|
|
160
166
|
formAlignRight={false}
|
|
161
167
|
imageLow={desktopPictures.imageLow}
|
|
162
168
|
images={desktopPictures.images}
|
|
@@ -180,7 +186,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
180
186
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
181
187
|
|
|
182
188
|
<Donate
|
|
183
|
-
|
|
189
|
+
mobileBackgroundColor="blue_dark"
|
|
184
190
|
formAlignRight={false}
|
|
185
191
|
imageLow={desktopPictures.imageLow}
|
|
186
192
|
images={desktopPictures.images}
|
|
@@ -197,13 +203,14 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
197
203
|
/>;
|
|
198
204
|
```
|
|
199
205
|
|
|
200
|
-
## Single Giving "No Money Buys", no background image, overriding 'choose amount' text
|
|
206
|
+
## Single Giving "No Money Buys", no background image, blue background; overriding 'choose amount' text
|
|
201
207
|
|
|
202
208
|
```js
|
|
203
209
|
import data from './dev-data/data-single';
|
|
204
210
|
|
|
205
211
|
<Donate
|
|
206
|
-
|
|
212
|
+
desktopOverlayColor="blue_dark"
|
|
213
|
+
mobileBackgroundColor="blue_dark"
|
|
207
214
|
formAlignRight={false}
|
|
208
215
|
data={data}
|
|
209
216
|
mbshipID="mship-9"
|
|
@@ -217,7 +224,7 @@ import data from './dev-data/data-single';
|
|
|
217
224
|
/>;
|
|
218
225
|
```
|
|
219
226
|
|
|
220
|
-
## Forcing mobile layout via isDesktop override; needed to pass parent prop for external media queries
|
|
227
|
+
## Forcing mobile layout via isDesktop override; needed to pass parent prop for external media queries, red background
|
|
221
228
|
|
|
222
229
|
```js
|
|
223
230
|
import data from './dev-data/data';
|
|
@@ -226,7 +233,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
226
233
|
|
|
227
234
|
<Donate
|
|
228
235
|
alt="Background image"
|
|
229
|
-
|
|
236
|
+
mobileBackgroundColor="red"
|
|
237
|
+
desktopOverlayColor="red"
|
|
230
238
|
formAlignRight={true}
|
|
231
239
|
imageLow={desktopPictures.imageLow}
|
|
232
240
|
images={desktopPictures.images}
|
|
@@ -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, mobileBackgroundColor }) => theme.color(mobileBackgroundColor)};
|
|
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, desktopOverlayColor }) => theme.color(desktopOverlayColor)};
|
|
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, color }) => theme.color(color)};
|
|
219
219
|
text-decoration: none;
|
|
220
220
|
border-radius: 2rem;
|
|
221
221
|
border: none;
|
|
@@ -33,6 +33,7 @@ const Signup = ({
|
|
|
33
33
|
noMoneyBuys,
|
|
34
34
|
PopUpText,
|
|
35
35
|
chooseAmountText,
|
|
36
|
+
submitButtonColor,
|
|
36
37
|
...rest
|
|
37
38
|
}) => {
|
|
38
39
|
const [givingType, setGivingType] = useState('single');
|
|
@@ -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" color={submitButtonColor} />
|
|
215
216
|
) : (
|
|
216
217
|
<Button
|
|
217
218
|
type="submit"
|
|
218
219
|
as="input"
|
|
219
220
|
value={givingType === 'single' ? 'Donate now' : 'Donate monthly'}
|
|
221
|
+
color={submitButtonColor}
|
|
220
222
|
/>
|
|
221
223
|
)}
|
|
222
224
|
|
|
@@ -235,7 +237,8 @@ Signup.propTypes = {
|
|
|
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
|
+
submitButtonColor: 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
|
|
|
@@ -835,6 +835,7 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
835
835
|
</div>
|
|
836
836
|
<input
|
|
837
837
|
className="c28"
|
|
838
|
+
color="red"
|
|
838
839
|
type="submit"
|
|
839
840
|
value="Donate now"
|
|
840
841
|
/>
|
|
@@ -1251,7 +1252,7 @@ exports[`Single donation renders correctly 1`] = `
|
|
|
1251
1252
|
-webkit-justify-content: inherit;
|
|
1252
1253
|
-ms-flex-pack: inherit;
|
|
1253
1254
|
justify-content: inherit;
|
|
1254
|
-
background-color:
|
|
1255
|
+
background-color: transparent;
|
|
1255
1256
|
}
|
|
1256
1257
|
}
|
|
1257
1258
|
|
|
@@ -1546,6 +1547,7 @@ exports[`Single donation renders correctly 1`] = `
|
|
|
1546
1547
|
</p>
|
|
1547
1548
|
<input
|
|
1548
1549
|
className="c24"
|
|
1550
|
+
color="red"
|
|
1549
1551
|
type="submit"
|
|
1550
1552
|
value="Donate now"
|
|
1551
1553
|
/>
|
|
@@ -1845,7 +1847,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
1845
1847
|
-webkit-justify-content: inherit;
|
|
1846
1848
|
-ms-flex-pack: inherit;
|
|
1847
1849
|
justify-content: inherit;
|
|
1848
|
-
background-color:
|
|
1850
|
+
background-color: transparent;
|
|
1849
1851
|
}
|
|
1850
1852
|
}
|
|
1851
1853
|
|
|
@@ -2004,6 +2006,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
2004
2006
|
</div>
|
|
2005
2007
|
<input
|
|
2006
2008
|
className="c18"
|
|
2009
|
+
color="red"
|
|
2007
2010
|
type="submit"
|
|
2008
2011
|
value="Donate"
|
|
2009
2012
|
/>
|