@comicrelief/component-library 6.3.0 → 6.4.1
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 +9 -4
- package/dist/components/Organisms/Donate/Donate.md +4 -3
- package/dist/components/Organisms/Donate/Donate.style.js +44 -46
- package/dist/components/Organisms/Donate/Donate.test.js +2 -1
- package/dist/components/Organisms/Donate/Form/Form.js +3 -2
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +8 -5
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +13 -5
- package/dist/theme/crTheme/colors.js +2 -1
- package/package.json +1 -1
- package/src/components/Organisms/Donate/Donate.js +9 -5
- package/src/components/Organisms/Donate/Donate.md +4 -3
- package/src/components/Organisms/Donate/Donate.style.js +3 -5
- package/src/components/Organisms/Donate/Donate.test.js +1 -0
- package/src/components/Organisms/Donate/Form/Form.js +4 -2
- package/src/components/Organisms/Donate/Form/PopUpComponent.js +11 -4
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +13 -5
- package/src/theme/crTheme/colors.js +2 -1
|
@@ -15,6 +15,8 @@ var _size = require("../../../theme/shared/size");
|
|
|
15
15
|
|
|
16
16
|
var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
|
|
17
17
|
|
|
18
|
+
var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
19
|
+
|
|
18
20
|
var _Form = _interopRequireDefault(require("./Form/Form"));
|
|
19
21
|
|
|
20
22
|
var _Donate = require("./Donate.style");
|
|
@@ -39,14 +41,15 @@ var Donate = function Donate(_ref) {
|
|
|
39
41
|
mobileAlt = _ref.mobileAlt,
|
|
40
42
|
mbshipID = _ref.mbshipID,
|
|
41
43
|
noMoneyBuys = _ref.noMoneyBuys,
|
|
42
|
-
PopUpText = _ref.PopUpText
|
|
44
|
+
PopUpText = _ref.PopUpText,
|
|
45
|
+
chooseAmountText = _ref.chooseAmountText;
|
|
43
46
|
var isDesktop = (0, _reactResponsive.useMediaQuery)({
|
|
44
47
|
query: "(min-width: ".concat(_size.screen.medium, ")")
|
|
45
48
|
});
|
|
46
49
|
return /*#__PURE__*/_react.default.createElement(_Donate.Container, {
|
|
47
50
|
backgroundColor: backgroundColor,
|
|
48
51
|
id: mbshipID
|
|
49
|
-
}, !isDesktop && mobileImages ? /*#__PURE__*/_react.default.createElement(
|
|
52
|
+
}, !isDesktop && mobileImages ? /*#__PURE__*/_react.default.createElement(_Picture.default, {
|
|
50
53
|
backgroundColor: backgroundColor,
|
|
51
54
|
image: mobileImage,
|
|
52
55
|
images: mobileImages,
|
|
@@ -88,7 +91,8 @@ var Donate = function Donate(_ref) {
|
|
|
88
91
|
mbshipID: mbshipID,
|
|
89
92
|
donateLink: donateLink,
|
|
90
93
|
noMoneyBuys: noMoneyBuys,
|
|
91
|
-
PopUpText: PopUpText
|
|
94
|
+
PopUpText: PopUpText,
|
|
95
|
+
chooseAmountText: chooseAmountText
|
|
92
96
|
})));
|
|
93
97
|
};
|
|
94
98
|
|
|
@@ -108,7 +112,8 @@ Donate.defaultProps = {
|
|
|
108
112
|
otherDescription: 'will help us fund amazing projects in the UK and around the world.',
|
|
109
113
|
subtitle: '',
|
|
110
114
|
noMoneyBuys: false,
|
|
111
|
-
PopUpText:
|
|
115
|
+
PopUpText: 'Help us deliver long-term impact by converting your single donation into a monthly gift.',
|
|
116
|
+
chooseAmountText: ''
|
|
112
117
|
};
|
|
113
118
|
var _default = Donate;
|
|
114
119
|
exports.default = _default;
|
|
@@ -111,7 +111,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
111
111
|
|
|
112
112
|
<Donate
|
|
113
113
|
alt="Background image"
|
|
114
|
-
backgroundColor="
|
|
114
|
+
backgroundColor="transparent"
|
|
115
115
|
formAlignRight={true}
|
|
116
116
|
imageLow={desktopPictures.imageLow}
|
|
117
117
|
images={desktopPictures.images}
|
|
@@ -136,7 +136,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
136
136
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
137
137
|
|
|
138
138
|
<Donate
|
|
139
|
-
backgroundColor="
|
|
139
|
+
backgroundColor="transparent"
|
|
140
140
|
formAlignRight={false}
|
|
141
141
|
imageLow={desktopPictures.imageLow}
|
|
142
142
|
images={desktopPictures.images}
|
|
@@ -204,7 +204,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
204
204
|
/>;
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
-
## Single Giving "No Money Buys", no background image
|
|
207
|
+
## Single Giving "No Money Buys", no background image, overriding 'choose amount' text
|
|
208
208
|
|
|
209
209
|
```js
|
|
210
210
|
import data from './dev-data/data-single';
|
|
@@ -221,5 +221,6 @@ import data from './dev-data/data-single';
|
|
|
221
221
|
noMoneyBuys
|
|
222
222
|
subtitle=""
|
|
223
223
|
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
224
|
+
chooseAmountText="Overridden via the 'choose amount text' props"
|
|
224
225
|
/>;
|
|
225
226
|
```
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.Legend = exports.OuterFieldset = exports.AmountField = exports.MoneyBuys = exports.Form = exports.Wrapper = exports.Label = exports.HeaderInner = exports.Header = exports.FormWrapper = exports.FormFieldset = exports.Error = exports.PopUp = exports.Container = exports.Copy = exports.Button = exports.
|
|
8
|
+
exports.Legend = exports.OuterFieldset = exports.AmountField = exports.MoneyBuys = exports.Form = exports.Wrapper = exports.Label = exports.HeaderInner = exports.Header = exports.FormWrapper = exports.FormFieldset = exports.Error = exports.PopUp = exports.Container = exports.Copy = exports.Button = exports.BgImage = void 0;
|
|
9
9
|
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
11
|
|
|
@@ -42,22 +42,20 @@ var PopUp = _styledComponents.default.div.withConfig({
|
|
|
42
42
|
})(["background:green;height:100px;"]);
|
|
43
43
|
|
|
44
44
|
exports.PopUp = PopUp;
|
|
45
|
-
var MobImage = (0, _styledComponents.default)(_Picture.default).withConfig({
|
|
46
|
-
displayName: "Donatestyle__MobImage",
|
|
47
|
-
componentId: "sc-8rjm3t-2"
|
|
48
|
-
})([""]);
|
|
49
|
-
exports.MobImage = MobImage;
|
|
50
45
|
var BgImage = (0, _styledComponents.default)(_Picture.default).withConfig({
|
|
51
46
|
displayName: "Donatestyle__BgImage",
|
|
52
|
-
componentId: "sc-8rjm3t-
|
|
53
|
-
})(["display:block;position:absolute;bottom:0;left:0;right:0;height:100%;
|
|
47
|
+
componentId: "sc-8rjm3t-2"
|
|
48
|
+
})(["display:block;position:absolute;bottom:0;left:0;right:0;height:100%;", ""], function (_ref3) {
|
|
49
|
+
var backgroundColor = _ref3.backgroundColor;
|
|
50
|
+
return backgroundColor !== 'transparent' && "\n opacity: 0.4;\n ";
|
|
51
|
+
});
|
|
54
52
|
exports.BgImage = BgImage;
|
|
55
53
|
|
|
56
54
|
var Wrapper = _styledComponents.default.div.withConfig({
|
|
57
55
|
displayName: "Donatestyle__Wrapper",
|
|
58
|
-
componentId: "sc-8rjm3t-
|
|
59
|
-
})(["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'), function (
|
|
60
|
-
var formAlignRight =
|
|
56
|
+
componentId: "sc-8rjm3t-3"
|
|
57
|
+
})(["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'), function (_ref4) {
|
|
58
|
+
var formAlignRight = _ref4.formAlignRight;
|
|
61
59
|
return formAlignRight === true ? 'row-reverse' : 'row';
|
|
62
60
|
}, (0, _size.media)('small'), (0, _spacing.default)('xl'), (0, _spacing.default)('md'), (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
63
61
|
|
|
@@ -65,9 +63,9 @@ exports.Wrapper = Wrapper;
|
|
|
65
63
|
|
|
66
64
|
var Header = _styledComponents.default.div.withConfig({
|
|
67
65
|
displayName: "Donatestyle__Header",
|
|
68
|
-
componentId: "sc-8rjm3t-
|
|
69
|
-
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"], function (
|
|
70
|
-
var theme =
|
|
66
|
+
componentId: "sc-8rjm3t-4"
|
|
67
|
+
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"], function (_ref5) {
|
|
68
|
+
var theme = _ref5.theme;
|
|
71
69
|
return theme.fontFamilies(theme.font.regular);
|
|
72
70
|
}, (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
73
71
|
|
|
@@ -75,37 +73,37 @@ exports.Header = Header;
|
|
|
75
73
|
|
|
76
74
|
var HeaderInner = _styledComponents.default.div.withConfig({
|
|
77
75
|
displayName: "Donatestyle__HeaderInner",
|
|
78
|
-
componentId: "sc-8rjm3t-
|
|
76
|
+
componentId: "sc-8rjm3t-5"
|
|
79
77
|
})(["position:relative;text-align:left;"]);
|
|
80
78
|
|
|
81
79
|
exports.HeaderInner = HeaderInner;
|
|
82
80
|
|
|
83
81
|
var FormWrapper = _styledComponents.default.div.withConfig({
|
|
84
82
|
displayName: "Donatestyle__FormWrapper",
|
|
85
|
-
componentId: "sc-8rjm3t-
|
|
86
|
-
})(["position:relative;font-family:", ";", "{width:50%;}"], function (
|
|
87
|
-
var theme =
|
|
83
|
+
componentId: "sc-8rjm3t-6"
|
|
84
|
+
})(["position:relative;font-family:", ";", "{width:50%;}"], function (_ref6) {
|
|
85
|
+
var theme = _ref6.theme;
|
|
88
86
|
return theme.fontFamilies(theme.font.regular);
|
|
89
87
|
}, (0, _size.media)('medium'));
|
|
90
88
|
|
|
91
89
|
exports.FormWrapper = FormWrapper;
|
|
92
90
|
var Error = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
93
91
|
displayName: "Donatestyle__Error",
|
|
94
|
-
componentId: "sc-8rjm3t-
|
|
95
|
-
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"], function (
|
|
96
|
-
var theme = _ref6.theme;
|
|
97
|
-
return theme.color('red');
|
|
98
|
-
}, function (_ref7) {
|
|
92
|
+
componentId: "sc-8rjm3t-7"
|
|
93
|
+
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"], function (_ref7) {
|
|
99
94
|
var theme = _ref7.theme;
|
|
95
|
+
return theme.color('red');
|
|
96
|
+
}, function (_ref8) {
|
|
97
|
+
var theme = _ref8.theme;
|
|
100
98
|
return theme.fontSize('s');
|
|
101
99
|
}, (0, _spacing.default)('l'));
|
|
102
100
|
exports.Error = Error;
|
|
103
101
|
|
|
104
102
|
var Form = _styledComponents.default.form.withConfig({
|
|
105
103
|
displayName: "Donatestyle__Form",
|
|
106
|
-
componentId: "sc-8rjm3t-
|
|
107
|
-
})(["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;}"], function (
|
|
108
|
-
var theme =
|
|
104
|
+
componentId: "sc-8rjm3t-8"
|
|
105
|
+
})(["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;}"], function (_ref9) {
|
|
106
|
+
var theme = _ref9.theme;
|
|
109
107
|
return theme.color('white');
|
|
110
108
|
}, (0, _spacing.default)('md'), (0, _spacing.default)('md'), (0, _spacing.default)('l'), (0, _size.media)('small'));
|
|
111
109
|
|
|
@@ -113,70 +111,70 @@ exports.Form = Form;
|
|
|
113
111
|
|
|
114
112
|
var OuterFieldset = _styledComponents.default.fieldset.withConfig({
|
|
115
113
|
displayName: "Donatestyle__OuterFieldset",
|
|
116
|
-
componentId: "sc-8rjm3t-
|
|
114
|
+
componentId: "sc-8rjm3t-9"
|
|
117
115
|
})(["padding:0 ", " ", ";margin:0;border:none;", "{padding:0 ", " ", ";}input[type='submit']{margin-bottom:0;}"], (0, _spacing.default)('md'), (0, _spacing.default)('md'), (0, _size.media)('small'), (0, _spacing.default)('l'), (0, _spacing.default)('l'));
|
|
118
116
|
|
|
119
117
|
exports.OuterFieldset = OuterFieldset;
|
|
120
118
|
|
|
121
119
|
var Legend = _styledComponents.default.legend.withConfig({
|
|
122
120
|
displayName: "Donatestyle__Legend",
|
|
123
|
-
componentId: "sc-8rjm3t-
|
|
121
|
+
componentId: "sc-8rjm3t-10"
|
|
124
122
|
})(["margin:0;padding:", " ", ";display:block;width:100%;"], (0, _spacing.default)('l'), (0, _spacing.default)('sm'));
|
|
125
123
|
|
|
126
124
|
exports.Legend = Legend;
|
|
127
125
|
|
|
128
126
|
var MoneyBuys = _styledComponents.default.div.withConfig({
|
|
129
127
|
displayName: "Donatestyle__MoneyBuys",
|
|
130
|
-
componentId: "sc-8rjm3t-
|
|
128
|
+
componentId: "sc-8rjm3t-11"
|
|
131
129
|
})(["display:flex;justify-content:space-between;flex-direction:column;margin-bottom:", ";", "{flex-direction:row;}label{flex:0 0 30%;margin-bottom:", ";", "{margin-bottom:0;}input{cursor:pointer;}}"], (0, _spacing.default)('l'), (0, _size.media)('small'), (0, _spacing.default)('sm'), (0, _size.media)('small'));
|
|
132
130
|
|
|
133
131
|
exports.MoneyBuys = MoneyBuys;
|
|
134
132
|
|
|
135
133
|
var FormFieldset = _styledComponents.default.div.withConfig({
|
|
136
134
|
displayName: "Donatestyle__FormFieldset",
|
|
137
|
-
componentId: "sc-8rjm3t-
|
|
135
|
+
componentId: "sc-8rjm3t-12"
|
|
138
136
|
})(["display:flex;align-items:center;justify-content:center;"]);
|
|
139
137
|
|
|
140
138
|
exports.FormFieldset = FormFieldset;
|
|
141
139
|
var Label = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
142
140
|
displayName: "Donatestyle__Label",
|
|
143
|
-
componentId: "sc-8rjm3t-
|
|
141
|
+
componentId: "sc-8rjm3t-13"
|
|
144
142
|
})(["margin-right:", ";"], (0, _spacing.default)('sm'));
|
|
145
143
|
exports.Label = Label;
|
|
146
144
|
var AmountField = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
147
145
|
displayName: "Donatestyle__AmountField",
|
|
148
|
-
componentId: "sc-8rjm3t-
|
|
149
|
-
})(["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'), function (
|
|
150
|
-
var theme = _ref9.theme;
|
|
151
|
-
return theme.color('grey');
|
|
152
|
-
}, function (_ref10) {
|
|
146
|
+
componentId: "sc-8rjm3t-14"
|
|
147
|
+
})(["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'), function (_ref10) {
|
|
153
148
|
var theme = _ref10.theme;
|
|
154
|
-
return theme.color('
|
|
155
|
-
},
|
|
149
|
+
return theme.color('grey');
|
|
150
|
+
}, function (_ref11) {
|
|
156
151
|
var theme = _ref11.theme;
|
|
152
|
+
return theme.color('grey_light');
|
|
153
|
+
}, (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('sm'), (0, _spacing.default)('l'), function (_ref12) {
|
|
154
|
+
var theme = _ref12.theme;
|
|
157
155
|
return theme.color('grey');
|
|
158
156
|
});
|
|
159
157
|
exports.AmountField = AmountField;
|
|
160
158
|
var Copy = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
161
159
|
displayName: "Donatestyle__Copy",
|
|
162
|
-
componentId: "sc-8rjm3t-
|
|
160
|
+
componentId: "sc-8rjm3t-15"
|
|
163
161
|
})(["line-height:1.5;margin-top:", ";"], (0, _spacing.default)('l'));
|
|
164
162
|
exports.Copy = Copy;
|
|
165
163
|
|
|
166
164
|
var Button = _styledComponents.default.button.withConfig({
|
|
167
165
|
displayName: "Donatestyle__Button",
|
|
168
|
-
componentId: "sc-8rjm3t-
|
|
169
|
-
})(["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'), function (
|
|
170
|
-
var theme = _ref12.theme;
|
|
171
|
-
return theme.color('white');
|
|
172
|
-
}, function (_ref13) {
|
|
166
|
+
componentId: "sc-8rjm3t-16"
|
|
167
|
+
})(["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'), function (_ref13) {
|
|
173
168
|
var theme = _ref13.theme;
|
|
174
|
-
return theme.
|
|
169
|
+
return theme.color('white');
|
|
175
170
|
}, function (_ref14) {
|
|
176
171
|
var theme = _ref14.theme;
|
|
177
|
-
return theme.
|
|
172
|
+
return theme.fontSize('s');
|
|
178
173
|
}, function (_ref15) {
|
|
179
174
|
var theme = _ref15.theme;
|
|
175
|
+
return theme.color('red');
|
|
176
|
+
}, function (_ref16) {
|
|
177
|
+
var theme = _ref16.theme;
|
|
180
178
|
return theme.color('coral_dark');
|
|
181
179
|
}, (0, _size.media)('small'), (0, _spacing.default)('md'), (0, _spacing.default)('l'));
|
|
182
180
|
|
|
@@ -65,7 +65,8 @@ it('Single donation with no Money Buys renders correctly', function () {
|
|
|
65
65
|
title: "Donate Now",
|
|
66
66
|
noMoneyBuys: true,
|
|
67
67
|
subtitle: "Please help us fund life-changing projects in the UK and around the world.",
|
|
68
|
-
otherDescription: "will help us fund amazing projects in the UK and around the world."
|
|
68
|
+
otherDescription: "will help us fund amazing projects in the UK and around the world.",
|
|
69
|
+
chooseAmountText: "Overridden via the 'choose amount text' props"
|
|
69
70
|
})).toJSON();
|
|
70
71
|
expect(tree).toMatchSnapshot();
|
|
71
72
|
});
|
|
@@ -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", "otherDescription", "clientID", "cartID", "mbshipID", "noMoneyBuys", "PopUpText"];
|
|
28
|
+
var _excluded = ["data", "donateLink", "otherDescription", "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
|
|
|
@@ -42,6 +42,7 @@ var Signup = function Signup(_ref) {
|
|
|
42
42
|
mbshipID = _ref.mbshipID,
|
|
43
43
|
noMoneyBuys = _ref.noMoneyBuys,
|
|
44
44
|
PopUpText = _ref.PopUpText,
|
|
45
|
+
chooseAmountText = _ref.chooseAmountText,
|
|
45
46
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
46
47
|
|
|
47
48
|
var _useState = (0, _react.useState)('single'),
|
|
@@ -121,7 +122,7 @@ var Signup = function Signup(_ref) {
|
|
|
121
122
|
tag: "span",
|
|
122
123
|
size: "l",
|
|
123
124
|
weight: "bold"
|
|
124
|
-
}, "".concat(noMoneyBuys ? 'Enter' : 'Choose', " an amount to give"))), !noMoneyBuys && /*#__PURE__*/_react.default.createElement(_Donate.MoneyBuys, null, givingData.moneybuys.map(function (_ref2, index) {
|
|
125
|
+
}, chooseAmountText || "".concat(noMoneyBuys ? 'Enter' : 'Choose', " an amount to give"))), !noMoneyBuys && /*#__PURE__*/_react.default.createElement(_Donate.MoneyBuys, null, givingData.moneybuys.map(function (_ref2, index) {
|
|
125
126
|
var value = _ref2.value;
|
|
126
127
|
return /*#__PURE__*/_react.default.createElement(_MoneyBox.default, {
|
|
127
128
|
isSelected: amountDonate === value,
|
|
@@ -29,9 +29,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
29
|
var StyledPopUp = _styledComponents.default.div.withConfig({
|
|
30
30
|
displayName: "PopUpComponent__StyledPopUp",
|
|
31
31
|
componentId: "sc-1d7imlo-0"
|
|
32
|
-
})(["display:", ";
|
|
32
|
+
})(["display:", ";background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:8px;", "{width:450px;margin-right:auto;margin-left:auto;}"], function (props) {
|
|
33
33
|
return props.isPop ? "grid" : "none";
|
|
34
|
-
},
|
|
34
|
+
}, function (_ref) {
|
|
35
35
|
var theme = _ref.theme;
|
|
36
36
|
return theme.color('white');
|
|
37
37
|
}, (0, _size.media)('small'));
|
|
@@ -44,13 +44,16 @@ var TextWrapper = _styledComponents.default.div.withConfig({
|
|
|
44
44
|
var Button = _styledComponents.default.button.withConfig({
|
|
45
45
|
displayName: "PopUpComponent__Button",
|
|
46
46
|
componentId: "sc-1d7imlo-2"
|
|
47
|
-
})(["justify-self:end;background:transparent;border:0;cursor:pointer;:active,:focus,:hover{outline:none;border:1px solid ", ";}margin:
|
|
47
|
+
})(["justify-self:end;background:transparent;border:0;cursor:pointer;border:1px solid ", ";:active,:focus,:hover{outline:none;border:1px solid ", ";}margin:8px;width:35px;height:35px;padding:5px;img{width:15px;height:15px;vertical-align:middle;}"], function (_ref2) {
|
|
48
48
|
var theme = _ref2.theme;
|
|
49
|
+
return theme.color('white');
|
|
50
|
+
}, function (_ref3) {
|
|
51
|
+
var theme = _ref3.theme;
|
|
49
52
|
return theme.color('grey');
|
|
50
53
|
});
|
|
51
54
|
|
|
52
|
-
var PopUpComponent = function PopUpComponent(
|
|
53
|
-
var PopUpText =
|
|
55
|
+
var PopUpComponent = function PopUpComponent(_ref4) {
|
|
56
|
+
var PopUpText = _ref4.PopUpText;
|
|
54
57
|
|
|
55
58
|
var _useState = (0, _react.useState)(true),
|
|
56
59
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -107,7 +107,6 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
107
107
|
|
|
108
108
|
.c13 {
|
|
109
109
|
display: grid;
|
|
110
|
-
gap: 0.5rem;
|
|
111
110
|
background-color: #FFFFFF;
|
|
112
111
|
box-shadow: 0px 0px 16px rgba(0,0,0,0.15);
|
|
113
112
|
border-radius: 8px;
|
|
@@ -122,8 +121,11 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
122
121
|
background: transparent;
|
|
123
122
|
border: 0;
|
|
124
123
|
cursor: pointer;
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
border: 1px solid #FFFFFF;
|
|
125
|
+
margin: 8px;
|
|
126
|
+
width: 35px;
|
|
127
|
+
height: 35px;
|
|
128
|
+
padding: 5px;
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
.c14:active,
|
|
@@ -133,6 +135,12 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
133
135
|
border: 1px solid #969598;
|
|
134
136
|
}
|
|
135
137
|
|
|
138
|
+
.c14 img {
|
|
139
|
+
width: 15px;
|
|
140
|
+
height: 15px;
|
|
141
|
+
vertical-align: middle;
|
|
142
|
+
}
|
|
143
|
+
|
|
136
144
|
.c23 {
|
|
137
145
|
display: block;
|
|
138
146
|
}
|
|
@@ -742,7 +750,7 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
742
750
|
color="inherit"
|
|
743
751
|
size="s"
|
|
744
752
|
>
|
|
745
|
-
|
|
753
|
+
Help us deliver long-term impact by converting your single donation into a monthly gift.
|
|
746
754
|
</span>
|
|
747
755
|
</div>
|
|
748
756
|
</div>
|
|
@@ -2042,7 +2050,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
2042
2050
|
color="inherit"
|
|
2043
2051
|
size="l"
|
|
2044
2052
|
>
|
|
2045
|
-
|
|
2053
|
+
Overridden via the 'choose amount text' props
|
|
2046
2054
|
</span>
|
|
2047
2055
|
</legend>
|
|
2048
2056
|
<div
|
package/package.json
CHANGED
|
@@ -4,9 +4,9 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
|
|
5
5
|
import { screen } from '../../../theme/shared/size';
|
|
6
6
|
import Text from '../../Atoms/Text/Text';
|
|
7
|
+
import Picture from '../../Atoms/Picture/Picture';
|
|
7
8
|
import Form from './Form/Form';
|
|
8
9
|
import {
|
|
9
|
-
MobImage,
|
|
10
10
|
BgImage,
|
|
11
11
|
Container,
|
|
12
12
|
Header,
|
|
@@ -34,14 +34,15 @@ const Donate = ({
|
|
|
34
34
|
mobileAlt,
|
|
35
35
|
mbshipID,
|
|
36
36
|
noMoneyBuys,
|
|
37
|
-
PopUpText
|
|
37
|
+
PopUpText,
|
|
38
|
+
chooseAmountText
|
|
38
39
|
}) => {
|
|
39
40
|
const isDesktop = useMediaQuery({ query: `(min-width: ${screen.medium})` });
|
|
40
41
|
|
|
41
42
|
return (
|
|
42
43
|
<Container backgroundColor={backgroundColor} id={mbshipID}>
|
|
43
44
|
{!isDesktop && mobileImages ? (
|
|
44
|
-
<
|
|
45
|
+
<Picture
|
|
45
46
|
backgroundColor={backgroundColor}
|
|
46
47
|
image={mobileImage}
|
|
47
48
|
images={mobileImages}
|
|
@@ -99,6 +100,7 @@ const Donate = ({
|
|
|
99
100
|
donateLink={donateLink}
|
|
100
101
|
noMoneyBuys={noMoneyBuys}
|
|
101
102
|
PopUpText={PopUpText}
|
|
103
|
+
chooseAmountText={chooseAmountText}
|
|
102
104
|
/>
|
|
103
105
|
</Wrapper>
|
|
104
106
|
</Container>
|
|
@@ -125,7 +127,8 @@ Donate.propTypes = {
|
|
|
125
127
|
backgroundColor: PropTypes.string,
|
|
126
128
|
mbshipID: PropTypes.string,
|
|
127
129
|
noMoneyBuys: PropTypes.bool,
|
|
128
|
-
PopUpText: PropTypes.string
|
|
130
|
+
PopUpText: PropTypes.string,
|
|
131
|
+
chooseAmountText: PropTypes.string
|
|
129
132
|
};
|
|
130
133
|
|
|
131
134
|
Donate.defaultProps = {
|
|
@@ -145,7 +148,8 @@ Donate.defaultProps = {
|
|
|
145
148
|
'will help us fund amazing projects in the UK and around the world.',
|
|
146
149
|
subtitle: '',
|
|
147
150
|
noMoneyBuys: false,
|
|
148
|
-
PopUpText:
|
|
151
|
+
PopUpText: 'Help us deliver long-term impact by converting your single donation into a monthly gift.',
|
|
152
|
+
chooseAmountText: ''
|
|
149
153
|
};
|
|
150
154
|
|
|
151
155
|
export default Donate;
|
|
@@ -111,7 +111,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
111
111
|
|
|
112
112
|
<Donate
|
|
113
113
|
alt="Background image"
|
|
114
|
-
backgroundColor="
|
|
114
|
+
backgroundColor="transparent"
|
|
115
115
|
formAlignRight={true}
|
|
116
116
|
imageLow={desktopPictures.imageLow}
|
|
117
117
|
images={desktopPictures.images}
|
|
@@ -136,7 +136,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
|
136
136
|
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
137
137
|
|
|
138
138
|
<Donate
|
|
139
|
-
backgroundColor="
|
|
139
|
+
backgroundColor="transparent"
|
|
140
140
|
formAlignRight={false}
|
|
141
141
|
imageLow={desktopPictures.imageLow}
|
|
142
142
|
images={desktopPictures.images}
|
|
@@ -204,7 +204,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
204
204
|
/>;
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
-
## Single Giving "No Money Buys", no background image
|
|
207
|
+
## Single Giving "No Money Buys", no background image, overriding 'choose amount' text
|
|
208
208
|
|
|
209
209
|
```js
|
|
210
210
|
import data from './dev-data/data-single';
|
|
@@ -221,5 +221,6 @@ import data from './dev-data/data-single';
|
|
|
221
221
|
noMoneyBuys
|
|
222
222
|
subtitle=""
|
|
223
223
|
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
224
|
+
chooseAmountText="Overridden via the 'choose amount text' props"
|
|
224
225
|
/>;
|
|
225
226
|
```
|
|
@@ -28,9 +28,6 @@ const PopUp = styled.div`
|
|
|
28
28
|
height: 100px;
|
|
29
29
|
`;
|
|
30
30
|
|
|
31
|
-
const MobImage = styled(Picture)`
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
31
|
const BgImage = styled(Picture)`
|
|
35
32
|
display: block;
|
|
36
33
|
position: absolute;
|
|
@@ -38,7 +35,9 @@ const BgImage = styled(Picture)`
|
|
|
38
35
|
left: 0;
|
|
39
36
|
right: 0;
|
|
40
37
|
height: 100%;
|
|
41
|
-
|
|
38
|
+
${({ backgroundColor }) => backgroundColor !== 'transparent' && `
|
|
39
|
+
opacity: 0.4;
|
|
40
|
+
`}
|
|
42
41
|
`;
|
|
43
42
|
|
|
44
43
|
const Wrapper = styled.div`
|
|
@@ -236,7 +235,6 @@ const Button = styled.button`
|
|
|
236
235
|
|
|
237
236
|
export {
|
|
238
237
|
BgImage,
|
|
239
|
-
MobImage,
|
|
240
238
|
Button,
|
|
241
239
|
Copy,
|
|
242
240
|
Container,
|
|
@@ -66,6 +66,7 @@ it('Single donation with no Money Buys renders correctly', () => {
|
|
|
66
66
|
noMoneyBuys
|
|
67
67
|
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
68
68
|
otherDescription="will help us fund amazing projects in the UK and around the world."
|
|
69
|
+
chooseAmountText="Overridden via the 'choose amount text' props"
|
|
69
70
|
/>
|
|
70
71
|
).toJSON();
|
|
71
72
|
|
|
@@ -32,6 +32,7 @@ const Signup = ({
|
|
|
32
32
|
mbshipID,
|
|
33
33
|
noMoneyBuys,
|
|
34
34
|
PopUpText,
|
|
35
|
+
chooseAmountText,
|
|
35
36
|
...rest
|
|
36
37
|
}) => {
|
|
37
38
|
const [givingType, setGivingType] = useState('single');
|
|
@@ -142,7 +143,7 @@ const Signup = ({
|
|
|
142
143
|
<OuterFieldset>
|
|
143
144
|
<Legend>
|
|
144
145
|
<Text tag="span" size="l" weight="bold">
|
|
145
|
-
{`${noMoneyBuys ? 'Enter' : 'Choose'} an amount to give`}
|
|
146
|
+
{chooseAmountText || `${noMoneyBuys ? 'Enter' : 'Choose'} an amount to give`}
|
|
146
147
|
</Text>
|
|
147
148
|
</Legend>
|
|
148
149
|
{!noMoneyBuys && (
|
|
@@ -220,7 +221,8 @@ Signup.propTypes = {
|
|
|
220
221
|
mbshipID: PropTypes.string.isRequired,
|
|
221
222
|
noMoneyBuys: PropTypes.bool,
|
|
222
223
|
data: PropTypes.objectOf(PropTypes.shape),
|
|
223
|
-
PopUpText: PropTypes.string.isRequired
|
|
224
|
+
PopUpText: PropTypes.string.isRequired,
|
|
225
|
+
chooseAmountText: PropTypes.string.isRequired
|
|
224
226
|
};
|
|
225
227
|
|
|
226
228
|
Signup.defaultProps = {
|
|
@@ -9,7 +9,6 @@ import CloseCross from '../assets/close.svg';
|
|
|
9
9
|
|
|
10
10
|
const StyledPopUp = styled.div`
|
|
11
11
|
display: ${props => props.isPop ? "grid" : "none"};
|
|
12
|
-
gap: ${spacing('sm')};
|
|
13
12
|
background-color: ${({ theme }) => theme.color('white')};
|
|
14
13
|
box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.15);
|
|
15
14
|
border-radius: 8px;
|
|
@@ -30,15 +29,23 @@ const Button = styled.button`
|
|
|
30
29
|
background: transparent;
|
|
31
30
|
border: 0;
|
|
32
31
|
cursor: pointer;
|
|
32
|
+
border: 1px solid ${({ theme }) => theme.color('white')};
|
|
33
33
|
:active,
|
|
34
34
|
:focus,
|
|
35
35
|
:hover {
|
|
36
36
|
outline: none;
|
|
37
37
|
border: 1px solid ${({ theme }) => theme.color('grey')};
|
|
38
38
|
}
|
|
39
|
-
margin:
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
margin: 8px;
|
|
40
|
+
width: 35px;
|
|
41
|
+
height: 35px;
|
|
42
|
+
padding: 5px;
|
|
43
|
+
|
|
44
|
+
img {
|
|
45
|
+
width: 15px;
|
|
46
|
+
height: 15px;
|
|
47
|
+
vertical-align: middle;
|
|
48
|
+
}
|
|
42
49
|
`;
|
|
43
50
|
|
|
44
51
|
const PopUpComponent = ({ PopUpText }) => {
|
|
@@ -107,7 +107,6 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
107
107
|
|
|
108
108
|
.c13 {
|
|
109
109
|
display: grid;
|
|
110
|
-
gap: 0.5rem;
|
|
111
110
|
background-color: #FFFFFF;
|
|
112
111
|
box-shadow: 0px 0px 16px rgba(0,0,0,0.15);
|
|
113
112
|
border-radius: 8px;
|
|
@@ -122,8 +121,11 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
122
121
|
background: transparent;
|
|
123
122
|
border: 0;
|
|
124
123
|
cursor: pointer;
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
border: 1px solid #FFFFFF;
|
|
125
|
+
margin: 8px;
|
|
126
|
+
width: 35px;
|
|
127
|
+
height: 35px;
|
|
128
|
+
padding: 5px;
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
.c14:active,
|
|
@@ -133,6 +135,12 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
133
135
|
border: 1px solid #969598;
|
|
134
136
|
}
|
|
135
137
|
|
|
138
|
+
.c14 img {
|
|
139
|
+
width: 15px;
|
|
140
|
+
height: 15px;
|
|
141
|
+
vertical-align: middle;
|
|
142
|
+
}
|
|
143
|
+
|
|
136
144
|
.c23 {
|
|
137
145
|
display: block;
|
|
138
146
|
}
|
|
@@ -742,7 +750,7 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
742
750
|
color="inherit"
|
|
743
751
|
size="s"
|
|
744
752
|
>
|
|
745
|
-
|
|
753
|
+
Help us deliver long-term impact by converting your single donation into a monthly gift.
|
|
746
754
|
</span>
|
|
747
755
|
</div>
|
|
748
756
|
</div>
|
|
@@ -2042,7 +2050,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
|
|
|
2042
2050
|
color="inherit"
|
|
2043
2051
|
size="l"
|
|
2044
2052
|
>
|
|
2045
|
-
|
|
2053
|
+
Overridden via the 'choose amount text' props
|
|
2046
2054
|
</span>
|
|
2047
2055
|
</legend>
|
|
2048
2056
|
<div
|