@comicrelief/component-library 6.1.5 → 6.3.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/cypress/integration/components/Organisms/Donate.spec.js +247 -247
- package/dist/components/Atoms/Picture/Picture.md +6 -9
- package/dist/components/Atoms/Picture/Picture.test.js +5 -5
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.md +6 -8
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +3 -3
- package/dist/components/Molecules/Box/Box.md +5 -7
- package/dist/components/Molecules/Box/Box.test.js +3 -3
- package/dist/components/Molecules/Card/Card.md +5 -7
- package/dist/components/Molecules/Card/Card.test.js +5 -5
- package/dist/components/Molecules/CardDs/CardDs.md +8 -12
- package/dist/components/Molecules/CardDs/CardDs.test.js +3 -3
- package/dist/components/Molecules/PartnerLink/PartnerLink.md +2 -3
- package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +3 -3
- package/dist/components/Molecules/Promo/Promo.md +13 -14
- package/dist/components/Molecules/Promo/Promo.test.js +5 -5
- package/dist/components/Molecules/SearchResult/SearchResult.md +12 -16
- package/dist/components/Molecules/SearchResult/SearchResult.test.js +5 -5
- package/dist/components/Molecules/SingleMessage/SingleMessage.md +37 -48
- package/dist/components/Molecules/SingleMessage/SingleMessage.test.js +15 -15
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.md +15 -20
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -3
- package/dist/components/Organisms/Donate/Donate.js +35 -7
- package/dist/components/Organisms/Donate/Donate.md +148 -14
- package/dist/components/Organisms/Donate/Donate.style.js +61 -45
- package/dist/components/Organisms/Donate/Donate.test.js +7 -7
- package/dist/components/Organisms/Donate/Form/Form.js +11 -6
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +74 -0
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +6 -6
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +355 -399
- package/dist/components/Organisms/Donate/assets/close.svg +3 -0
- package/dist/components/Organisms/Membership/Membership.md +6 -6
- package/dist/components/Organisms/Membership/Membership.test.js +5 -5
- package/dist/styleguide/data/data.js +9 -3
- package/package.json +2 -1
- package/src/components/Atoms/Picture/Picture.md +6 -9
- package/src/components/Atoms/Picture/Picture.test.js +4 -5
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.md +6 -8
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +3 -4
- package/src/components/Molecules/Box/Box.md +5 -7
- package/src/components/Molecules/Box/Box.test.js +2 -3
- package/src/components/Molecules/Card/Card.md +5 -7
- package/src/components/Molecules/Card/Card.test.js +3 -4
- package/src/components/Molecules/CardDs/CardDs.md +8 -12
- package/src/components/Molecules/CardDs/CardDs.test.js +3 -4
- package/src/components/Molecules/PartnerLink/PartnerLink.md +2 -3
- package/src/components/Molecules/PartnerLink/PartnerLink.test.js +2 -3
- package/src/components/Molecules/Promo/Promo.md +13 -14
- package/src/components/Molecules/Promo/Promo.test.js +5 -6
- package/src/components/Molecules/SearchResult/SearchResult.md +12 -16
- package/src/components/Molecules/SearchResult/SearchResult.test.js +5 -5
- package/src/components/Molecules/SingleMessage/SingleMessage.md +37 -48
- package/src/components/Molecules/SingleMessage/SingleMessage.test.js +15 -16
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.md +15 -20
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -4
- package/src/components/Organisms/Donate/Donate.js +91 -50
- package/src/components/Organisms/Donate/Donate.md +148 -14
- package/src/components/Organisms/Donate/Donate.style.js +16 -1
- package/src/components/Organisms/Donate/Donate.test.js +7 -7
- package/src/components/Organisms/Donate/Form/Form.js +16 -8
- package/src/components/Organisms/Donate/Form/PopUpComponent.js +63 -0
- package/src/components/Organisms/Donate/GivingSelector/GivingSelector.js +6 -6
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +355 -399
- package/src/components/Organisms/Donate/assets/close.svg +3 -0
- package/src/components/Organisms/Membership/Membership.md +6 -6
- package/src/components/Organisms/Membership/Membership.test.js +9 -14
- package/src/styleguide/data/data.js +12 -1
|
@@ -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.Container = exports.Copy = exports.Button = exports.BgImage = void 0;
|
|
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.MobImage = exports.BgImage = void 0;
|
|
9
9
|
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
11
|
|
|
@@ -21,27 +21,43 @@ var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
|
21
21
|
|
|
22
22
|
var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
23
23
|
|
|
24
|
+
// import styled, { css } from 'styled-components';
|
|
24
25
|
var Container = _styledComponents.default.div.withConfig({
|
|
25
26
|
displayName: "Donatestyle__Container",
|
|
26
27
|
componentId: "sc-8rjm3t-0"
|
|
27
|
-
})(["
|
|
28
|
-
var theme = _ref.theme
|
|
29
|
-
|
|
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
|
+
return theme.color('blue_dark');
|
|
31
|
+
}, (0, _size.media)('medium'), function (_ref2) {
|
|
32
|
+
var theme = _ref2.theme,
|
|
33
|
+
backgroundColor = _ref2.backgroundColor;
|
|
30
34
|
return theme.color(backgroundColor);
|
|
31
|
-
}
|
|
35
|
+
});
|
|
32
36
|
|
|
33
37
|
exports.Container = Container;
|
|
38
|
+
|
|
39
|
+
var PopUp = _styledComponents.default.div.withConfig({
|
|
40
|
+
displayName: "Donatestyle__PopUp",
|
|
41
|
+
componentId: "sc-8rjm3t-1"
|
|
42
|
+
})(["background:green;height:100px;"]);
|
|
43
|
+
|
|
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;
|
|
34
50
|
var BgImage = (0, _styledComponents.default)(_Picture.default).withConfig({
|
|
35
51
|
displayName: "Donatestyle__BgImage",
|
|
36
|
-
componentId: "sc-8rjm3t-
|
|
37
|
-
})(["position:absolute;bottom:0;left:0;right:0;height:100%;opacity:0.4;"]);
|
|
52
|
+
componentId: "sc-8rjm3t-3"
|
|
53
|
+
})(["display:block;position:absolute;bottom:0;left:0;right:0;height:100%;opacity:0.4;"]);
|
|
38
54
|
exports.BgImage = BgImage;
|
|
39
55
|
|
|
40
56
|
var Wrapper = _styledComponents.default.div.withConfig({
|
|
41
57
|
displayName: "Donatestyle__Wrapper",
|
|
42
|
-
componentId: "sc-8rjm3t-
|
|
43
|
-
})(["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 (
|
|
44
|
-
var formAlignRight =
|
|
58
|
+
componentId: "sc-8rjm3t-4"
|
|
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 (_ref3) {
|
|
60
|
+
var formAlignRight = _ref3.formAlignRight;
|
|
45
61
|
return formAlignRight === true ? 'row-reverse' : 'row';
|
|
46
62
|
}, (0, _size.media)('small'), (0, _spacing.default)('xl'), (0, _spacing.default)('md'), (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
47
63
|
|
|
@@ -49,9 +65,9 @@ exports.Wrapper = Wrapper;
|
|
|
49
65
|
|
|
50
66
|
var Header = _styledComponents.default.div.withConfig({
|
|
51
67
|
displayName: "Donatestyle__Header",
|
|
52
|
-
componentId: "sc-8rjm3t-
|
|
53
|
-
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"], function (
|
|
54
|
-
var theme =
|
|
68
|
+
componentId: "sc-8rjm3t-5"
|
|
69
|
+
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"], function (_ref4) {
|
|
70
|
+
var theme = _ref4.theme;
|
|
55
71
|
return theme.fontFamilies(theme.font.regular);
|
|
56
72
|
}, (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
57
73
|
|
|
@@ -59,37 +75,37 @@ exports.Header = Header;
|
|
|
59
75
|
|
|
60
76
|
var HeaderInner = _styledComponents.default.div.withConfig({
|
|
61
77
|
displayName: "Donatestyle__HeaderInner",
|
|
62
|
-
componentId: "sc-8rjm3t-
|
|
78
|
+
componentId: "sc-8rjm3t-6"
|
|
63
79
|
})(["position:relative;text-align:left;"]);
|
|
64
80
|
|
|
65
81
|
exports.HeaderInner = HeaderInner;
|
|
66
82
|
|
|
67
83
|
var FormWrapper = _styledComponents.default.div.withConfig({
|
|
68
84
|
displayName: "Donatestyle__FormWrapper",
|
|
69
|
-
componentId: "sc-8rjm3t-
|
|
70
|
-
})(["position:relative;font-family:", ";", "{width:50%;}"], function (
|
|
71
|
-
var theme =
|
|
85
|
+
componentId: "sc-8rjm3t-7"
|
|
86
|
+
})(["position:relative;font-family:", ";", "{width:50%;}"], function (_ref5) {
|
|
87
|
+
var theme = _ref5.theme;
|
|
72
88
|
return theme.fontFamilies(theme.font.regular);
|
|
73
89
|
}, (0, _size.media)('medium'));
|
|
74
90
|
|
|
75
91
|
exports.FormWrapper = FormWrapper;
|
|
76
92
|
var Error = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
77
93
|
displayName: "Donatestyle__Error",
|
|
78
|
-
componentId: "sc-8rjm3t-
|
|
79
|
-
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"], function (
|
|
80
|
-
var theme = _ref5.theme;
|
|
81
|
-
return theme.color('red');
|
|
82
|
-
}, function (_ref6) {
|
|
94
|
+
componentId: "sc-8rjm3t-8"
|
|
95
|
+
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"], function (_ref6) {
|
|
83
96
|
var theme = _ref6.theme;
|
|
97
|
+
return theme.color('red');
|
|
98
|
+
}, function (_ref7) {
|
|
99
|
+
var theme = _ref7.theme;
|
|
84
100
|
return theme.fontSize('s');
|
|
85
101
|
}, (0, _spacing.default)('l'));
|
|
86
102
|
exports.Error = Error;
|
|
87
103
|
|
|
88
104
|
var Form = _styledComponents.default.form.withConfig({
|
|
89
105
|
displayName: "Donatestyle__Form",
|
|
90
|
-
componentId: "sc-8rjm3t-
|
|
91
|
-
})(["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 (
|
|
92
|
-
var theme =
|
|
106
|
+
componentId: "sc-8rjm3t-9"
|
|
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 (_ref8) {
|
|
108
|
+
var theme = _ref8.theme;
|
|
93
109
|
return theme.color('white');
|
|
94
110
|
}, (0, _spacing.default)('md'), (0, _spacing.default)('md'), (0, _spacing.default)('l'), (0, _size.media)('small'));
|
|
95
111
|
|
|
@@ -97,70 +113,70 @@ exports.Form = Form;
|
|
|
97
113
|
|
|
98
114
|
var OuterFieldset = _styledComponents.default.fieldset.withConfig({
|
|
99
115
|
displayName: "Donatestyle__OuterFieldset",
|
|
100
|
-
componentId: "sc-8rjm3t-
|
|
116
|
+
componentId: "sc-8rjm3t-10"
|
|
101
117
|
})(["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'));
|
|
102
118
|
|
|
103
119
|
exports.OuterFieldset = OuterFieldset;
|
|
104
120
|
|
|
105
121
|
var Legend = _styledComponents.default.legend.withConfig({
|
|
106
122
|
displayName: "Donatestyle__Legend",
|
|
107
|
-
componentId: "sc-8rjm3t-
|
|
123
|
+
componentId: "sc-8rjm3t-11"
|
|
108
124
|
})(["margin:0;padding:", " ", ";display:block;width:100%;"], (0, _spacing.default)('l'), (0, _spacing.default)('sm'));
|
|
109
125
|
|
|
110
126
|
exports.Legend = Legend;
|
|
111
127
|
|
|
112
128
|
var MoneyBuys = _styledComponents.default.div.withConfig({
|
|
113
129
|
displayName: "Donatestyle__MoneyBuys",
|
|
114
|
-
componentId: "sc-8rjm3t-
|
|
130
|
+
componentId: "sc-8rjm3t-12"
|
|
115
131
|
})(["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'));
|
|
116
132
|
|
|
117
133
|
exports.MoneyBuys = MoneyBuys;
|
|
118
134
|
|
|
119
135
|
var FormFieldset = _styledComponents.default.div.withConfig({
|
|
120
136
|
displayName: "Donatestyle__FormFieldset",
|
|
121
|
-
componentId: "sc-8rjm3t-
|
|
137
|
+
componentId: "sc-8rjm3t-13"
|
|
122
138
|
})(["display:flex;align-items:center;justify-content:center;"]);
|
|
123
139
|
|
|
124
140
|
exports.FormFieldset = FormFieldset;
|
|
125
141
|
var Label = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
126
142
|
displayName: "Donatestyle__Label",
|
|
127
|
-
componentId: "sc-8rjm3t-
|
|
143
|
+
componentId: "sc-8rjm3t-14"
|
|
128
144
|
})(["margin-right:", ";"], (0, _spacing.default)('sm'));
|
|
129
145
|
exports.Label = Label;
|
|
130
146
|
var AmountField = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
131
147
|
displayName: "Donatestyle__AmountField",
|
|
132
|
-
componentId: "sc-8rjm3t-
|
|
133
|
-
})(["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 (
|
|
134
|
-
var theme = _ref8.theme;
|
|
135
|
-
return theme.color('grey');
|
|
136
|
-
}, function (_ref9) {
|
|
148
|
+
componentId: "sc-8rjm3t-15"
|
|
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 (_ref9) {
|
|
137
150
|
var theme = _ref9.theme;
|
|
138
|
-
return theme.color('
|
|
139
|
-
},
|
|
151
|
+
return theme.color('grey');
|
|
152
|
+
}, function (_ref10) {
|
|
140
153
|
var theme = _ref10.theme;
|
|
154
|
+
return theme.color('grey_light');
|
|
155
|
+
}, (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('sm'), (0, _spacing.default)('l'), function (_ref11) {
|
|
156
|
+
var theme = _ref11.theme;
|
|
141
157
|
return theme.color('grey');
|
|
142
158
|
});
|
|
143
159
|
exports.AmountField = AmountField;
|
|
144
160
|
var Copy = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
145
161
|
displayName: "Donatestyle__Copy",
|
|
146
|
-
componentId: "sc-8rjm3t-
|
|
162
|
+
componentId: "sc-8rjm3t-16"
|
|
147
163
|
})(["line-height:1.5;margin-top:", ";"], (0, _spacing.default)('l'));
|
|
148
164
|
exports.Copy = Copy;
|
|
149
165
|
|
|
150
166
|
var Button = _styledComponents.default.button.withConfig({
|
|
151
167
|
displayName: "Donatestyle__Button",
|
|
152
|
-
componentId: "sc-8rjm3t-
|
|
153
|
-
})(["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 (
|
|
154
|
-
var theme = _ref11.theme;
|
|
155
|
-
return theme.color('white');
|
|
156
|
-
}, function (_ref12) {
|
|
168
|
+
componentId: "sc-8rjm3t-17"
|
|
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 (_ref12) {
|
|
157
170
|
var theme = _ref12.theme;
|
|
158
|
-
return theme.
|
|
171
|
+
return theme.color('white');
|
|
159
172
|
}, function (_ref13) {
|
|
160
173
|
var theme = _ref13.theme;
|
|
161
|
-
return theme.
|
|
174
|
+
return theme.fontSize('s');
|
|
162
175
|
}, function (_ref14) {
|
|
163
176
|
var theme = _ref14.theme;
|
|
177
|
+
return theme.color('red');
|
|
178
|
+
}, function (_ref15) {
|
|
179
|
+
var theme = _ref15.theme;
|
|
164
180
|
return theme.color('coral_dark');
|
|
165
181
|
}, (0, _size.media)('small'), (0, _spacing.default)('md'), (0, _spacing.default)('l'));
|
|
166
182
|
|
|
@@ -14,15 +14,15 @@ var _data = _interopRequireDefault(require("./dev-data/data"));
|
|
|
14
14
|
|
|
15
15
|
var _dataSingle = _interopRequireDefault(require("./dev-data/data-single"));
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var defaultData = require('../../../styleguide/data/data').defaultData;
|
|
18
18
|
|
|
19
19
|
it('Monthly donation renders correctly', function () {
|
|
20
20
|
var tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Donate.default, {
|
|
21
21
|
alt: "Background image",
|
|
22
22
|
backgroundColor: "blue_dark",
|
|
23
23
|
formAlignRight: true,
|
|
24
|
-
imageLow: pictures.imageLow,
|
|
25
|
-
images: pictures.images,
|
|
24
|
+
imageLow: defaultData.pictures.imageLow,
|
|
25
|
+
images: defaultData.pictures.images,
|
|
26
26
|
data: _data.default,
|
|
27
27
|
mbshipID: "mship-1",
|
|
28
28
|
donateLink: "https://donation.comicrelief.com/",
|
|
@@ -38,8 +38,8 @@ it('Single donation renders correctly', function () {
|
|
|
38
38
|
var tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Donate.default, {
|
|
39
39
|
backgroundColor: "blue_dark",
|
|
40
40
|
formAlignRight: false,
|
|
41
|
-
imageLow: pictures.imageLow,
|
|
42
|
-
images: pictures.images,
|
|
41
|
+
imageLow: defaultData.pictures.imageLow,
|
|
42
|
+
images: defaultData.pictures.images,
|
|
43
43
|
data: _dataSingle.default,
|
|
44
44
|
mbshipID: "mship-1",
|
|
45
45
|
donateLink: "https://donation.comicrelief.com/",
|
|
@@ -55,8 +55,8 @@ it('Single donation with no Money Buys renders correctly', function () {
|
|
|
55
55
|
var tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Donate.default, {
|
|
56
56
|
backgroundColor: "blue_dark",
|
|
57
57
|
formAlignRight: false,
|
|
58
|
-
imageLow: pictures.imageLow,
|
|
59
|
-
images: pictures.images,
|
|
58
|
+
imageLow: defaultData.pictures.imageLow,
|
|
59
|
+
images: defaultData.pictures.images,
|
|
60
60
|
data: _dataSingle.default,
|
|
61
61
|
mbshipID: "mship-1",
|
|
62
62
|
donateLink: "https://donation.comicrelief.com/",
|
|
@@ -13,6 +13,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
+
var _PopUpComponent = _interopRequireDefault(require("./PopUpComponent"));
|
|
17
|
+
|
|
16
18
|
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
17
19
|
|
|
18
20
|
var _MoneyBox = _interopRequireDefault(require("../MoneyBox/MoneyBox"));
|
|
@@ -23,7 +25,7 @@ var _Donate = require("../Donate.style");
|
|
|
23
25
|
|
|
24
26
|
var _GivingSelector = _interopRequireDefault(require("../GivingSelector/GivingSelector"));
|
|
25
27
|
|
|
26
|
-
var _excluded = ["data", "donateLink", "otherDescription", "clientID", "cartID", "mbshipID", "noMoneyBuys"];
|
|
28
|
+
var _excluded = ["data", "donateLink", "otherDescription", "clientID", "cartID", "mbshipID", "noMoneyBuys", "PopUpText"];
|
|
27
29
|
|
|
28
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); }
|
|
29
31
|
|
|
@@ -39,6 +41,7 @@ var Signup = function Signup(_ref) {
|
|
|
39
41
|
cartID = _ref.cartID,
|
|
40
42
|
mbshipID = _ref.mbshipID,
|
|
41
43
|
noMoneyBuys = _ref.noMoneyBuys,
|
|
44
|
+
PopUpText = _ref.PopUpText,
|
|
42
45
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
43
46
|
|
|
44
47
|
var _useState = (0, _react.useState)('single'),
|
|
@@ -108,6 +111,8 @@ var Signup = function Signup(_ref) {
|
|
|
108
111
|
changeGivingType: function changeGivingType(data) {
|
|
109
112
|
return setGivingType(data);
|
|
110
113
|
}
|
|
114
|
+
}), givingType === 'single' && showGivingSelector && /*#__PURE__*/_react.default.createElement(_PopUpComponent.default, {
|
|
115
|
+
PopUpText: PopUpText
|
|
111
116
|
}), /*#__PURE__*/_react.default.createElement(_Donate.Form, {
|
|
112
117
|
onSubmit: function onSubmit(e) {
|
|
113
118
|
return submitDonation(e, amountDonate, clientID, cartID, mbshipID, donateLink);
|
|
@@ -151,19 +156,19 @@ var Signup = function Signup(_ref) {
|
|
|
151
156
|
return setAmountDonate(parseFloat(e.target.value));
|
|
152
157
|
},
|
|
153
158
|
"aria-label": "Input a different amount"
|
|
154
|
-
}))), noMoneyBuys
|
|
159
|
+
}))), amountDonate >= 1 && !noMoneyBuys && moneyBuyCopy && /*#__PURE__*/_react.default.createElement(_Donate.Copy, {
|
|
160
|
+
as: "p"
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement("strong", null, "\xA3".concat(amountDonate.toFixed(2), " ")), moneyBuyCopy), noMoneyBuys ? /*#__PURE__*/_react.default.createElement(_Donate.Button, {
|
|
155
162
|
type: "submit",
|
|
156
163
|
as: "input",
|
|
157
164
|
value: "Donate"
|
|
158
165
|
}) : /*#__PURE__*/_react.default.createElement(_Donate.Button, {
|
|
159
166
|
type: "submit",
|
|
160
167
|
as: "input",
|
|
161
|
-
value: givingType === 'single' ? 'Donate
|
|
168
|
+
value: givingType === 'single' ? 'Donate now' : 'Donate monthly'
|
|
162
169
|
}), errorMsg && /*#__PURE__*/_react.default.createElement(_Donate.Error, {
|
|
163
170
|
tag: "p"
|
|
164
|
-
}, "Please enter an amount between \xA31 and \xA320000 and up to 2 decimal places")
|
|
165
|
-
as: "p"
|
|
166
|
-
}, /*#__PURE__*/_react.default.createElement("strong", null, "\xA3".concat(amountDonate.toFixed(2), " ")), moneyBuyCopy))));
|
|
171
|
+
}, "Please enter an amount between \xA31 and \xA320000 and up to 2 decimal places"))));
|
|
167
172
|
};
|
|
168
173
|
|
|
169
174
|
Signup.defaultProps = {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
17
|
+
|
|
18
|
+
var _spacing = _interopRequireDefault(require("../../../../theme/shared/spacing"));
|
|
19
|
+
|
|
20
|
+
var _size = require("../../../../theme/shared/size");
|
|
21
|
+
|
|
22
|
+
var _close = _interopRequireDefault(require("../assets/close.svg"));
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
/* eslint-disable */
|
|
29
|
+
var StyledPopUp = _styledComponents.default.div.withConfig({
|
|
30
|
+
displayName: "PopUpComponent__StyledPopUp",
|
|
31
|
+
componentId: "sc-1d7imlo-0"
|
|
32
|
+
})(["display:", ";gap:", ";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
|
+
return props.isPop ? "grid" : "none";
|
|
34
|
+
}, (0, _spacing.default)('sm'), function (_ref) {
|
|
35
|
+
var theme = _ref.theme;
|
|
36
|
+
return theme.color('white');
|
|
37
|
+
}, (0, _size.media)('small'));
|
|
38
|
+
|
|
39
|
+
var TextWrapper = _styledComponents.default.div.withConfig({
|
|
40
|
+
displayName: "PopUpComponent__TextWrapper",
|
|
41
|
+
componentId: "sc-1d7imlo-1"
|
|
42
|
+
})(["margin:0 32px 32px;"]);
|
|
43
|
+
|
|
44
|
+
var Button = _styledComponents.default.button.withConfig({
|
|
45
|
+
displayName: "PopUpComponent__Button",
|
|
46
|
+
componentId: "sc-1d7imlo-2"
|
|
47
|
+
})(["justify-self:end;background:transparent;border:0;cursor:pointer;:active,:focus,:hover{outline:none;border:1px solid ", ";}margin:17px 17px 0;width:20px;"], function (_ref2) {
|
|
48
|
+
var theme = _ref2.theme;
|
|
49
|
+
return theme.color('grey');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
var PopUpComponent = function PopUpComponent(_ref3) {
|
|
53
|
+
var PopUpText = _ref3.PopUpText;
|
|
54
|
+
|
|
55
|
+
var _useState = (0, _react.useState)(true),
|
|
56
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
57
|
+
isPop = _useState2[0],
|
|
58
|
+
setIsPop = _useState2[1];
|
|
59
|
+
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(StyledPopUp, {
|
|
61
|
+
isPop: isPop
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(Button, {
|
|
63
|
+
onClick: function onClick() {
|
|
64
|
+
return setIsPop(false);
|
|
65
|
+
},
|
|
66
|
+
"aria-label": "Close"
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
68
|
+
src: _close.default,
|
|
69
|
+
alt: "Close cross icon"
|
|
70
|
+
})), /*#__PURE__*/_react.default.createElement(TextWrapper, null, /*#__PURE__*/_react.default.createElement(_Text.default, null, PopUpText)));
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var _default = PopUpComponent;
|
|
74
|
+
exports.default = _default;
|
|
@@ -72,9 +72,9 @@ var GivingSelector = function GivingSelector(_ref10) {
|
|
|
72
72
|
var givingType = _ref10.givingType,
|
|
73
73
|
changeGivingType = _ref10.changeGivingType;
|
|
74
74
|
return /*#__PURE__*/_react.default.createElement(Wrapper, null, /*#__PURE__*/_react.default.createElement(MoneyBox, null, /*#__PURE__*/_react.default.createElement("input", {
|
|
75
|
-
"aria-label": "
|
|
75
|
+
"aria-label": "Single",
|
|
76
76
|
id: "give-once",
|
|
77
|
-
value: "
|
|
77
|
+
value: "Single",
|
|
78
78
|
type: "radio",
|
|
79
79
|
label: "",
|
|
80
80
|
errormsg: "",
|
|
@@ -85,10 +85,10 @@ var GivingSelector = function GivingSelector(_ref10) {
|
|
|
85
85
|
}), /*#__PURE__*/_react.default.createElement(Label, {
|
|
86
86
|
active: givingType === 'single',
|
|
87
87
|
htmlFor: "give-once"
|
|
88
|
-
}, "
|
|
89
|
-
"aria-label": "
|
|
88
|
+
}, "Single"), /*#__PURE__*/_react.default.createElement("input", {
|
|
89
|
+
"aria-label": "Monthly",
|
|
90
90
|
id: "give-monthly",
|
|
91
|
-
value: "
|
|
91
|
+
value: "Monthly",
|
|
92
92
|
type: "radio",
|
|
93
93
|
label: "",
|
|
94
94
|
errormsg: "",
|
|
@@ -99,7 +99,7 @@ var GivingSelector = function GivingSelector(_ref10) {
|
|
|
99
99
|
}), /*#__PURE__*/_react.default.createElement(Label, {
|
|
100
100
|
active: givingType === 'monthly',
|
|
101
101
|
htmlFor: "give-monthly"
|
|
102
|
-
}, "
|
|
102
|
+
}, "Monthly"), /*#__PURE__*/_react.default.createElement(Switch, null)));
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
var _default = GivingSelector;
|