@comicrelief/component-library 6.4.0 → 6.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 +6 -3
- package/dist/components/Organisms/Donate/Donate.md +2 -2
- package/dist/components/Organisms/Donate/Donate.style.js +44 -46
- package/dist/components/Organisms/Donate/Form/Form.js +9 -2
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +13 -13
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +4 -1
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +66 -136
- package/dist/theme/crTheme/colors.js +2 -1
- package/package.json +1 -1
- package/src/components/Organisms/Donate/Donate.js +4 -4
- package/src/components/Organisms/Donate/Donate.md +2 -2
- package/src/components/Organisms/Donate/Donate.style.js +3 -5
- package/src/components/Organisms/Donate/Form/Form.js +4 -3
- package/src/components/Organisms/Donate/Form/PopUpComponent.js +37 -13
- package/src/components/Organisms/Donate/GivingSelector/GivingSelector.js +5 -2
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +66 -136
- 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");
|
|
@@ -47,7 +49,7 @@ var Donate = function Donate(_ref) {
|
|
|
47
49
|
return /*#__PURE__*/_react.default.createElement(_Donate.Container, {
|
|
48
50
|
backgroundColor: backgroundColor,
|
|
49
51
|
id: mbshipID
|
|
50
|
-
}, !isDesktop && mobileImages ? /*#__PURE__*/_react.default.createElement(
|
|
52
|
+
}, !isDesktop && mobileImages ? /*#__PURE__*/_react.default.createElement(_Picture.default, {
|
|
51
53
|
backgroundColor: backgroundColor,
|
|
52
54
|
image: mobileImage,
|
|
53
55
|
images: mobileImages,
|
|
@@ -67,7 +69,8 @@ var Donate = function Donate(_ref) {
|
|
|
67
69
|
alt: alt,
|
|
68
70
|
isBackgroundImage: true
|
|
69
71
|
}) : null, /*#__PURE__*/_react.default.createElement(_Donate.Wrapper, {
|
|
70
|
-
formAlignRight: formAlignRight
|
|
72
|
+
formAlignRight: formAlignRight,
|
|
73
|
+
"aria-live": "polite"
|
|
71
74
|
}, /*#__PURE__*/_react.default.createElement(_Donate.Header, {
|
|
72
75
|
formAlignRight: formAlignRight
|
|
73
76
|
}, /*#__PURE__*/_react.default.createElement(_Donate.HeaderInner, null, subtitle && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
@@ -110,7 +113,7 @@ Donate.defaultProps = {
|
|
|
110
113
|
otherDescription: 'will help us fund amazing projects in the UK and around the world.',
|
|
111
114
|
subtitle: '',
|
|
112
115
|
noMoneyBuys: false,
|
|
113
|
-
PopUpText:
|
|
116
|
+
PopUpText: 'Help us deliver long-term impact by converting your single donation into a monthly gift.',
|
|
114
117
|
chooseAmountText: ''
|
|
115
118
|
};
|
|
116
119
|
var _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}
|
|
@@ -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
|
|
|
@@ -107,12 +107,19 @@ var Signup = function Signup(_ref) {
|
|
|
107
107
|
|
|
108
108
|
var givingData = givingType === 'single' ? singleGiving : regularGiving;
|
|
109
109
|
var showGivingSelector = singleGiving !== null && regularGiving !== null;
|
|
110
|
+
|
|
111
|
+
var _useState9 = (0, _react.useState)(false),
|
|
112
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
113
|
+
popOpen = _useState10[0],
|
|
114
|
+
setPopOpen = _useState10[1];
|
|
115
|
+
|
|
110
116
|
return /*#__PURE__*/_react.default.createElement(_Donate.FormWrapper, null, showGivingSelector && /*#__PURE__*/_react.default.createElement(_GivingSelector.default, {
|
|
111
117
|
givingType: givingType,
|
|
112
118
|
changeGivingType: function changeGivingType(data) {
|
|
113
119
|
return setGivingType(data);
|
|
114
|
-
}
|
|
115
|
-
|
|
120
|
+
},
|
|
121
|
+
setPopOpen: setPopOpen
|
|
122
|
+
}), popOpen && /*#__PURE__*/_react.default.createElement(_PopUpComponent.default, {
|
|
116
123
|
PopUpText: PopUpText
|
|
117
124
|
}), /*#__PURE__*/_react.default.createElement(_Donate.Form, {
|
|
118
125
|
onSubmit: function onSubmit(e) {
|
|
@@ -11,12 +11,10 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
-
var _styledComponents =
|
|
14
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
15
|
|
|
16
16
|
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
17
17
|
|
|
18
|
-
var _spacing = _interopRequireDefault(require("../../../../theme/shared/spacing"));
|
|
19
|
-
|
|
20
18
|
var _size = require("../../../../theme/shared/size");
|
|
21
19
|
|
|
22
20
|
var _close = _interopRequireDefault(require("../assets/close.svg"));
|
|
@@ -26,14 +24,16 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
26
24
|
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
25
|
|
|
28
26
|
/* eslint-disable */
|
|
27
|
+
var fadeClose = (0, _styledComponents.keyframes)(["0%{opacity:1;max-height:350px;}100%{opacity:0;max-height:0px;display:none;margin-top:-16px;}"]);
|
|
28
|
+
|
|
29
29
|
var StyledPopUp = _styledComponents.default.div.withConfig({
|
|
30
30
|
displayName: "PopUpComponent__StyledPopUp",
|
|
31
31
|
componentId: "sc-1d7imlo-0"
|
|
32
|
-
})(["display:
|
|
33
|
-
return props.
|
|
34
|
-
},
|
|
32
|
+
})(["display:grid;overflow:hidden;max-height:350px;opacity:1;", " background-color:", ";box-shadow:0px 0px 16px rgba(0,0,0,0.15);border-radius:10px;", "{width:450px;margin-right:auto;margin-left:auto;}"], function (props) {
|
|
33
|
+
return props.isClosed && (0, _styledComponents.css)(["animation:0.6s ", " ease forwards;"], fadeClose);
|
|
34
|
+
}, function (_ref) {
|
|
35
35
|
var theme = _ref.theme;
|
|
36
|
-
return theme.color('
|
|
36
|
+
return theme.color('blue_light');
|
|
37
37
|
}, (0, _size.media)('small'));
|
|
38
38
|
|
|
39
39
|
var TextWrapper = _styledComponents.default.div.withConfig({
|
|
@@ -44,7 +44,7 @@ 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 ", ";}
|
|
47
|
+
})(["justify-self:end;background-color:transparent;border:0;cursor:pointer;width:30px;height:30px;margin:3px;:active,:focus,:hover{outline:none;border:1px solid ", ";}img{width:15px;height:15px;vertical-align:middle;}"], function (_ref2) {
|
|
48
48
|
var theme = _ref2.theme;
|
|
49
49
|
return theme.color('grey');
|
|
50
50
|
});
|
|
@@ -52,16 +52,16 @@ var Button = _styledComponents.default.button.withConfig({
|
|
|
52
52
|
var PopUpComponent = function PopUpComponent(_ref3) {
|
|
53
53
|
var PopUpText = _ref3.PopUpText;
|
|
54
54
|
|
|
55
|
-
var _useState = (0, _react.useState)(
|
|
55
|
+
var _useState = (0, _react.useState)(false),
|
|
56
56
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
isClosed = _useState2[0],
|
|
58
|
+
setIsClosed = _useState2[1];
|
|
59
59
|
|
|
60
60
|
return /*#__PURE__*/_react.default.createElement(StyledPopUp, {
|
|
61
|
-
|
|
61
|
+
isClosed: isClosed
|
|
62
62
|
}, /*#__PURE__*/_react.default.createElement(Button, {
|
|
63
63
|
onClick: function onClick() {
|
|
64
|
-
return
|
|
64
|
+
return setIsClosed(true);
|
|
65
65
|
},
|
|
66
66
|
"aria-label": "Close"
|
|
67
67
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -70,7 +70,8 @@ var Label = _styledComponents.default.label.withConfig({
|
|
|
70
70
|
|
|
71
71
|
var GivingSelector = function GivingSelector(_ref10) {
|
|
72
72
|
var givingType = _ref10.givingType,
|
|
73
|
-
changeGivingType = _ref10.changeGivingType
|
|
73
|
+
changeGivingType = _ref10.changeGivingType,
|
|
74
|
+
setPopOpen = _ref10.setPopOpen;
|
|
74
75
|
return /*#__PURE__*/_react.default.createElement(Wrapper, null, /*#__PURE__*/_react.default.createElement(MoneyBox, null, /*#__PURE__*/_react.default.createElement("input", {
|
|
75
76
|
"aria-label": "Single",
|
|
76
77
|
id: "give-once",
|
|
@@ -81,6 +82,7 @@ var GivingSelector = function GivingSelector(_ref10) {
|
|
|
81
82
|
checked: givingType === 'single',
|
|
82
83
|
onClick: function onClick() {
|
|
83
84
|
changeGivingType('single');
|
|
85
|
+
setPopOpen(true);
|
|
84
86
|
}
|
|
85
87
|
}), /*#__PURE__*/_react.default.createElement(Label, {
|
|
86
88
|
active: givingType === 'single',
|
|
@@ -95,6 +97,7 @@ var GivingSelector = function GivingSelector(_ref10) {
|
|
|
95
97
|
checked: givingType === 'monthly',
|
|
96
98
|
onClick: function onClick() {
|
|
97
99
|
changeGivingType('monthly');
|
|
100
|
+
setPopOpen(false);
|
|
98
101
|
}
|
|
99
102
|
}), /*#__PURE__*/_react.default.createElement(Label, {
|
|
100
103
|
active: givingType === 'monthly',
|