@comicrelief/component-library 7.22.0 → 7.23.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/e2e/components/organisms/impactSlider.cy.js +72 -0
- package/dist/components/Atoms/Button/Button.js +4 -16
- package/dist/components/Atoms/Button/Button.test.js +0 -5
- package/dist/components/Atoms/ButtonWithStates/ButtonWithStates.js +14 -31
- package/dist/components/Atoms/Checkbox/Checkbox.js +4 -17
- package/dist/components/Atoms/Checkbox/Checkbox.test.js +0 -5
- package/dist/components/Atoms/Confetti/Confetti.js +8 -23
- package/dist/components/Atoms/Confetti/_TriggerConfetti.js +5 -13
- package/dist/components/Atoms/ErrorText/ErrorText.js +2 -14
- package/dist/components/Atoms/ErrorText/ErrorText.test.js +0 -5
- package/dist/components/Atoms/Icons/Arrow.js +7 -21
- package/dist/components/Atoms/Icons/AtSign.js +4 -14
- package/dist/components/Atoms/Icons/Chevron.js +7 -21
- package/dist/components/Atoms/Icons/Curve.js +1 -6
- package/dist/components/Atoms/Icons/Download.js +4 -14
- package/dist/components/Atoms/Icons/External.js +4 -14
- package/dist/components/Atoms/Icons/Favourite.js +4 -14
- package/dist/components/Atoms/Icons/Internal.js +4 -14
- package/dist/components/Atoms/Icons/index.js +14 -22
- package/dist/components/Atoms/Input/Input.js +15 -35
- package/dist/components/Atoms/Input/input.test.js +0 -5
- package/dist/components/Atoms/Label/Label.js +12 -24
- package/dist/components/Atoms/Link/Link.js +18 -35
- package/dist/components/Atoms/Link/Link.style.js +9 -25
- package/dist/components/Atoms/Link/Link.test.js +0 -6
- package/dist/components/Atoms/Logo/Logo.js +5 -22
- package/dist/components/Atoms/Logo/Logo.test.js +0 -5
- package/dist/components/Atoms/Pagination/Item/Item.js +3 -11
- package/dist/components/Atoms/Pagination/Item/Item.style.js +18 -30
- package/dist/components/Atoms/Pagination/List/List.js +10 -21
- package/dist/components/Atoms/Pagination/Pagination.js +25 -47
- package/dist/components/Atoms/Pagination/Pagination.test.js +0 -5
- package/dist/components/Atoms/Pagination/Utils/PaginationCalculator.js +14 -30
- package/dist/components/Atoms/Picture/Picture.js +19 -39
- package/dist/components/Atoms/Picture/Picture.test.js +0 -6
- package/dist/components/Atoms/RadioButton/RadioButton.js +6 -18
- package/dist/components/Atoms/RadioButton/RadioButton.test.js +0 -5
- package/dist/components/Atoms/RichText/RichText.js +4 -15
- package/dist/components/Atoms/RichText/RichText.test.js +0 -5
- package/dist/components/Atoms/Select/Select.js +19 -39
- package/dist/components/Atoms/Select/Select.test.js +0 -5
- package/dist/components/Atoms/SocialIcons/Icon/Icon.js +6 -18
- package/dist/components/Atoms/SocialIcons/SocialIcons.js +3 -17
- package/dist/components/Atoms/SocialIcons/SocialIcons.test.js +0 -5
- package/dist/components/Atoms/SocialIcons/Utils/Icons.js +2 -9
- package/dist/components/Atoms/SocialIcons/Utils/Links.js +2 -5
- package/dist/components/Atoms/Text/Text.js +16 -29
- package/dist/components/Atoms/Text/Text.test.js +0 -5
- package/dist/components/Atoms/TextArea/TextArea.js +10 -25
- package/dist/components/Atoms/TextArea/TextArea.test.js +0 -5
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +26 -53
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.style.js +8 -28
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.test.js +0 -6
- package/dist/components/Molecules/Accordion/Accordion.js +8 -29
- package/dist/components/Molecules/Accordion/Accordion.test.js +0 -6
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +14 -38
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +0 -6
- package/dist/components/Molecules/Banner/Banner.js +3 -13
- package/dist/components/Molecules/Banner/Banner.test.js +0 -6
- package/dist/components/Molecules/Box/Box.js +9 -22
- package/dist/components/Molecules/Box/Box.test.js +0 -6
- package/dist/components/Molecules/Card/Card.js +11 -24
- package/dist/components/Molecules/Card/Card.test.js +0 -6
- package/dist/components/Molecules/CardDs/CardDs.js +17 -41
- package/dist/components/Molecules/CardDs/CardDs.test.js +0 -7
- package/dist/components/Molecules/Chip/Chip.js +4 -10
- package/dist/components/Molecules/Chip/Chip.style.js +8 -48
- package/dist/components/Molecules/Chip/Chip.test.js +0 -6
- package/dist/components/Molecules/Countdown/Countdown.js +17 -32
- package/dist/components/Molecules/Countdown/Countdown.style.js +4 -13
- package/dist/components/Molecules/Descriptor/Descriptor.js +6 -50
- package/dist/components/Molecules/Descriptor/Descriptor.test.js +0 -5
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.js +2 -8
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.style.js +4 -13
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.test.js +0 -6
- package/dist/components/Molecules/HeroBanner/HeroBanner.js +4 -13
- package/dist/components/Molecules/InfoBanner/InfoBanner.js +8 -19
- package/dist/components/Molecules/InfoBanner/InfoBanner.test.js +0 -5
- package/dist/components/Molecules/Logos/Logos.js +1 -11
- package/dist/components/Molecules/Lookup/Lookup.js +25 -57
- package/dist/components/Molecules/PartnerLink/PartnerLink.js +3 -14
- package/dist/components/Molecules/PartnerLink/PartnerLink.style.js +4 -13
- package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +0 -7
- package/dist/components/Molecules/Promo/Promo.js +43 -50
- package/dist/components/Molecules/Promo/Promo.md +18 -35
- package/dist/components/Molecules/Promo/Promo.style.js +23 -41
- package/dist/components/Molecules/Promo/Promo.test.js +0 -8
- package/dist/components/Molecules/Promo/_ProgressRing.js +7 -20
- package/dist/components/Molecules/Promo/_PromoVideo.js +42 -54
- package/dist/components/Molecules/Promo/_PromoVideoButton.js +5 -12
- package/dist/components/Molecules/Promo/_PromoVideoButton.style.js +33 -59
- package/dist/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +116 -72
- package/dist/components/Molecules/SchoolLookup/SchoolLookup.js +6 -23
- package/dist/components/Molecules/SchoolLookup/SchoolLookup.test.js +0 -5
- package/dist/components/Molecules/SearchInput/SearchInput.js +4 -12
- package/dist/components/Molecules/SearchInput/SearchInput.style.js +7 -25
- package/dist/components/Molecules/SearchInput/SearchInput.test.js +0 -5
- package/dist/components/Molecules/SearchResult/SearchResult.js +11 -25
- package/dist/components/Molecules/SearchResult/SearchResult.test.js +0 -6
- package/dist/components/Molecules/ShareButton/ShareButton.js +10 -23
- package/dist/components/Molecules/ShareButton/ShareButton.style.js +6 -21
- package/dist/components/Molecules/ShareButton/ShareButton.test.js +0 -5
- package/dist/components/Molecules/ShareButton/assets/ShareIcons.js +1 -6
- package/dist/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +4 -25
- package/dist/components/Molecules/SingleMessage/SingleMessage.js +48 -68
- package/dist/components/Molecules/SingleMessage/SingleMessage.style.js +19 -47
- package/dist/components/Molecules/SingleMessage/SingleMessage.test.js +0 -8
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.js +22 -46
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.style.js +13 -44
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +0 -8
- package/dist/components/Molecules/Typeahead/Typeahead.js +25 -51
- package/dist/components/Molecules/Typeahead/Typeahead.test.js +0 -12
- package/dist/components/Molecules/VideoBanner/VideoBanner.js +14 -28
- package/dist/components/Molecules/VideoBanner/VideoBanner.test.js +0 -6
- package/dist/components/Organisms/CookieBanner/CookieBanner.js +3 -9
- package/dist/components/Organisms/CookieBanner/CookieBanner.style.js +6 -18
- package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +0 -5
- package/dist/components/Organisms/Donate/Donate.js +36 -48
- package/dist/components/Organisms/Donate/Donate.style.js +23 -71
- package/dist/components/Organisms/Donate/Donate.test.js +0 -8
- package/dist/components/Organisms/Donate/Form/Form.js +53 -80
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +9 -27
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +4 -12
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +7 -25
- package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +7 -21
- package/dist/components/Organisms/Donate/dev-data/data-high-value.js +2 -3
- package/dist/components/Organisms/Donate/dev-data/data-single.js +2 -3
- package/dist/components/Organisms/Donate/dev-data/data.js +2 -3
- package/dist/components/Organisms/EmailSignUp/EmailSignUp.style.js +12 -37
- package/dist/components/Organisms/EmailSignUp/EmailSignUp.test.js +0 -9
- package/dist/components/Organisms/EmailSignUp/EmailSignUpForm.js +3 -24
- package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +19 -32
- package/dist/components/Organisms/EmailSignUp/_EmailSignUpConfig.js +6 -18
- package/dist/components/Organisms/EmailSignUp/_TextInput.js +7 -16
- package/dist/components/Organisms/Footer/Footer.js +5 -17
- package/dist/components/Organisms/Footer/Footer.style.js +10 -35
- package/dist/components/Organisms/Footer/Footer.test.js +1 -7
- package/dist/components/Organisms/Footer/Nav/Nav.js +15 -39
- package/dist/components/Organisms/Footer/Nav/Nav.style.js +16 -37
- package/dist/components/Organisms/Footer/data/data.js +2 -3
- package/dist/components/Organisms/Footer/data/footerCopy.js +2 -3
- package/dist/components/Organisms/Header/Burger/BurgerMenu.js +3 -8
- package/dist/components/Organisms/Header/Burger/BurgerMenu.style.js +8 -19
- package/dist/components/Organisms/Header/Header.js +4 -14
- package/dist/components/Organisms/Header/Header.style.js +5 -22
- package/dist/components/Organisms/Header/Nav/Nav.js +19 -44
- package/dist/components/Organisms/Header/Nav/Nav.style.js +19 -46
- package/dist/components/Organisms/Header/data/data.js +2 -3
- package/dist/components/Organisms/Header/header.test.js +5 -2
- package/dist/components/Organisms/ImpactSlider/ImpactMoneybuys.style.js +61 -0
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.js +71 -0
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.md +42 -0
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.style.js +56 -0
- package/dist/components/Organisms/ImpactSlider/Slider.style.js +30 -0
- package/dist/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +42 -0
- package/dist/components/Organisms/ImpactSlider/_Slider.js +32 -0
- package/dist/components/Organisms/ImpactSlider/_utils.js +30 -0
- package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDS.style.js +15 -54
- package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDSForm.js +11 -20
- package/dist/components/Organisms/MarketingPreferencesDS/_AssociatedFields.js +1 -2
- package/dist/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +12 -23
- package/dist/components/Organisms/MarketingPreferencesDS/_DefaultCopy.js +4 -14
- package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +23 -35
- package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPrefsConfig.js +10 -19
- package/dist/components/Organisms/MarketingPreferencesDS/_TextInput.js +7 -16
- package/dist/components/Organisms/Membership/Form/Form.js +50 -83
- package/dist/components/Organisms/Membership/Membership.js +13 -21
- package/dist/components/Organisms/Membership/Membership.style.js +21 -63
- package/dist/components/Organisms/Membership/Membership.test.js +0 -7
- package/dist/components/Organisms/Membership/MoneyBox/MoneyBox.js +9 -21
- package/dist/components/Organisms/Membership/dev-data/data.js +2 -3
- package/dist/hoc/shallowWithTheme.js +0 -6
- package/dist/index.js +134 -187
- package/dist/styleguide/CRLogo.js +1 -9
- package/dist/styleguide/StyleGuideRenderer.js +6 -10
- package/dist/styleguide/ThemeWrapper.js +1 -8
- package/dist/styleguide/data/data.js +20 -5
- package/dist/theme/ThemeProvider.js +1 -5
- package/dist/theme/crTheme/buttonColors.js +2 -11
- package/dist/theme/crTheme/colors.js +3 -9
- package/dist/theme/crTheme/fontSizes.js +2 -6
- package/dist/theme/crTheme/linkStyles.js +2 -11
- package/dist/theme/crTheme/theme.js +2 -11
- package/dist/theme/shared/breakpoint.js +4 -9
- package/dist/theme/shared/fontFamilies.js +2 -7
- package/dist/theme/shared/hideVisually.js +1 -4
- package/dist/theme/shared/size.js +5 -11
- package/dist/theme/shared/spacing.js +1 -5
- package/dist/theme/shared/zIndex.js +1 -8
- package/dist/theme/srTheme/buttonColors.js +2 -11
- package/dist/theme/srTheme/colors.js +3 -9
- package/dist/theme/srTheme/fontSizes.js +2 -6
- package/dist/theme/srTheme/linkStyles.js +2 -11
- package/dist/theme/srTheme/theme.js +2 -11
- package/dist/utils/Membership.js +11 -28
- package/dist/utils/ShareButton/sharePopUpHelper.js +3 -8
- package/dist/utils/ShareButton/shareTracking.js +1 -5
- package/dist/utils/ShareButton/shareUrlHelper.js +3 -5
- package/dist/utils/allowListed.js +1 -5
- package/dist/utils/allowListed.test.js +0 -2
- package/dist/utils/internalLinkHelper.js +11 -20
- package/dist/utils/navHelper.js +1 -6
- package/package.json +2 -1
- package/react-range-slider-input.d.ts +2 -0
- package/src/components/Molecules/Promo/Promo.js +14 -8
- package/src/components/Molecules/Promo/Promo.md +18 -35
- package/src/components/Molecules/Promo/Promo.style.js +28 -16
- package/src/components/Molecules/Promo/_PromoVideo.js +13 -8
- package/src/components/Molecules/Promo/_PromoVideoButton.js +1 -1
- package/src/components/Molecules/Promo/_PromoVideoButton.style.js +26 -21
- package/src/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +116 -72
- package/src/components/Organisms/ImpactSlider/ImpactMoneybuys.style.js +96 -0
- package/src/components/Organisms/ImpactSlider/ImpactSlider.js +92 -0
- package/src/components/Organisms/ImpactSlider/ImpactSlider.md +42 -0
- package/src/components/Organisms/ImpactSlider/ImpactSlider.style.js +72 -0
- package/src/components/Organisms/ImpactSlider/Slider.style.js +70 -0
- package/src/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +43 -0
- package/src/components/Organisms/ImpactSlider/_Slider.js +39 -0
- package/src/components/Organisms/ImpactSlider/_utils.js +32 -0
- package/src/index.js +1 -0
- package/src/styleguide/data/data.js +26 -1
|
@@ -1,94 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
7
|
+
exports.Wrapper = exports.PopUp = exports.OuterFieldset = exports.MoneyBuys = exports.Legend = exports.Label = exports.HeaderInner = exports.Header = exports.FormWrapper = exports.FormFieldset = exports.Form = exports.Error = exports.Copy = exports.Container = exports.Button = exports.BgImage = exports.AmountField = void 0;
|
|
10
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
-
|
|
12
9
|
var _Input = _interopRequireDefault(require("../../Atoms/Input/Input"));
|
|
13
|
-
|
|
14
10
|
var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
|
|
15
|
-
|
|
16
11
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
17
|
-
|
|
18
12
|
var _size = require("../../../theme/shared/size");
|
|
19
|
-
|
|
20
13
|
var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
21
|
-
|
|
22
14
|
var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
23
|
-
|
|
24
15
|
// import styled, { css } from 'styled-components';
|
|
25
|
-
|
|
16
|
+
|
|
17
|
+
var Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
26
18
|
displayName: "Donatestyle__Container",
|
|
27
19
|
componentId: "sc-8rjm3t-0"
|
|
28
20
|
})(["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
21
|
var theme = _ref.theme,
|
|
30
|
-
|
|
22
|
+
mobileBackgroundColor = _ref.mobileBackgroundColor;
|
|
31
23
|
return theme.color(mobileBackgroundColor);
|
|
32
24
|
}, (0, _size.media)('medium'), function (_ref2) {
|
|
33
25
|
var theme = _ref2.theme,
|
|
34
|
-
|
|
26
|
+
desktopOverlayColor = _ref2.desktopOverlayColor;
|
|
35
27
|
return theme.color(desktopOverlayColor);
|
|
36
28
|
});
|
|
37
|
-
|
|
38
|
-
exports.Container = Container;
|
|
39
|
-
|
|
40
|
-
var PopUp = _styledComponents.default.div.withConfig({
|
|
29
|
+
var PopUp = exports.PopUp = _styledComponents.default.div.withConfig({
|
|
41
30
|
displayName: "Donatestyle__PopUp",
|
|
42
31
|
componentId: "sc-8rjm3t-1"
|
|
43
32
|
})(["background:green;height:100px;"]);
|
|
44
|
-
|
|
45
|
-
exports.PopUp = PopUp;
|
|
46
|
-
var BgImage = (0, _styledComponents.default)(_Picture.default).withConfig({
|
|
33
|
+
var BgImage = exports.BgImage = (0, _styledComponents.default)(_Picture.default).withConfig({
|
|
47
34
|
displayName: "Donatestyle__BgImage",
|
|
48
35
|
componentId: "sc-8rjm3t-2"
|
|
49
36
|
})(["display:block;position:absolute;bottom:0;left:0;right:0;height:100%;", ""], function (_ref3) {
|
|
50
37
|
var backgroundColor = _ref3.backgroundColor;
|
|
51
38
|
return backgroundColor !== 'transparent' && "\n opacity: 0.4;\n ";
|
|
52
39
|
});
|
|
53
|
-
exports.
|
|
54
|
-
|
|
55
|
-
var Wrapper = _styledComponents.default.div.withConfig({
|
|
40
|
+
var Wrapper = exports.Wrapper = _styledComponents.default.div.withConfig({
|
|
56
41
|
displayName: "Donatestyle__Wrapper",
|
|
57
42
|
componentId: "sc-8rjm3t-3"
|
|
58
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 (_ref4) {
|
|
59
44
|
var formAlignRight = _ref4.formAlignRight;
|
|
60
45
|
return formAlignRight === true ? 'row-reverse' : 'row';
|
|
61
46
|
}, (0, _size.media)('small'), (0, _spacing.default)('xl'), (0, _spacing.default)('md'), (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
62
|
-
|
|
63
|
-
exports.Wrapper = Wrapper;
|
|
64
|
-
|
|
65
|
-
var Header = _styledComponents.default.div.withConfig({
|
|
47
|
+
var Header = exports.Header = _styledComponents.default.div.withConfig({
|
|
66
48
|
displayName: "Donatestyle__Header",
|
|
67
49
|
componentId: "sc-8rjm3t-4"
|
|
68
50
|
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"], function (_ref5) {
|
|
69
51
|
var theme = _ref5.theme;
|
|
70
52
|
return theme.fontFamilies(theme.font.regular);
|
|
71
53
|
}, (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
72
|
-
|
|
73
|
-
exports.Header = Header;
|
|
74
|
-
|
|
75
|
-
var HeaderInner = _styledComponents.default.div.withConfig({
|
|
54
|
+
var HeaderInner = exports.HeaderInner = _styledComponents.default.div.withConfig({
|
|
76
55
|
displayName: "Donatestyle__HeaderInner",
|
|
77
56
|
componentId: "sc-8rjm3t-5"
|
|
78
57
|
})(["position:relative;text-align:left;"]);
|
|
79
|
-
|
|
80
|
-
exports.HeaderInner = HeaderInner;
|
|
81
|
-
|
|
82
|
-
var FormWrapper = _styledComponents.default.div.withConfig({
|
|
58
|
+
var FormWrapper = exports.FormWrapper = _styledComponents.default.div.withConfig({
|
|
83
59
|
displayName: "Donatestyle__FormWrapper",
|
|
84
60
|
componentId: "sc-8rjm3t-6"
|
|
85
61
|
})(["position:relative;font-family:", ";", "{width:50%;}"], function (_ref6) {
|
|
86
62
|
var theme = _ref6.theme;
|
|
87
63
|
return theme.fontFamilies(theme.font.regular);
|
|
88
64
|
}, (0, _size.media)('medium'));
|
|
89
|
-
|
|
90
|
-
exports.FormWrapper = FormWrapper;
|
|
91
|
-
var Error = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
65
|
+
var Error = exports.Error = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
92
66
|
displayName: "Donatestyle__Error",
|
|
93
67
|
componentId: "sc-8rjm3t-7"
|
|
94
68
|
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"], function (_ref7) {
|
|
@@ -98,51 +72,34 @@ var Error = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
|
98
72
|
var theme = _ref8.theme;
|
|
99
73
|
return theme.fontSize('s');
|
|
100
74
|
}, (0, _spacing.default)('l'));
|
|
101
|
-
exports.
|
|
102
|
-
|
|
103
|
-
var Form = _styledComponents.default.form.withConfig({
|
|
75
|
+
var Form = exports.Form = _styledComponents.default.form.withConfig({
|
|
104
76
|
displayName: "Donatestyle__Form",
|
|
105
77
|
componentId: "sc-8rjm3t-8"
|
|
106
78
|
})(["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) {
|
|
107
79
|
var theme = _ref9.theme;
|
|
108
80
|
return theme.color('white');
|
|
109
81
|
}, (0, _spacing.default)('md'), (0, _spacing.default)('md'), (0, _spacing.default)('l'), (0, _size.media)('small'));
|
|
110
|
-
|
|
111
|
-
exports.Form = Form;
|
|
112
|
-
|
|
113
|
-
var OuterFieldset = _styledComponents.default.fieldset.withConfig({
|
|
82
|
+
var OuterFieldset = exports.OuterFieldset = _styledComponents.default.fieldset.withConfig({
|
|
114
83
|
displayName: "Donatestyle__OuterFieldset",
|
|
115
84
|
componentId: "sc-8rjm3t-9"
|
|
116
85
|
})(["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'));
|
|
117
|
-
|
|
118
|
-
exports.OuterFieldset = OuterFieldset;
|
|
119
|
-
|
|
120
|
-
var Legend = _styledComponents.default.legend.withConfig({
|
|
86
|
+
var Legend = exports.Legend = _styledComponents.default.legend.withConfig({
|
|
121
87
|
displayName: "Donatestyle__Legend",
|
|
122
88
|
componentId: "sc-8rjm3t-10"
|
|
123
89
|
})(["margin:0;padding:", " ", ";display:block;width:100%;"], (0, _spacing.default)('l'), (0, _spacing.default)('sm'));
|
|
124
|
-
|
|
125
|
-
exports.Legend = Legend;
|
|
126
|
-
|
|
127
|
-
var MoneyBuys = _styledComponents.default.div.withConfig({
|
|
90
|
+
var MoneyBuys = exports.MoneyBuys = _styledComponents.default.div.withConfig({
|
|
128
91
|
displayName: "Donatestyle__MoneyBuys",
|
|
129
92
|
componentId: "sc-8rjm3t-11"
|
|
130
93
|
})(["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;padding:", " ", ";}}"], (0, _spacing.default)('l'), (0, _size.media)('small'), (0, _spacing.default)('sm'), (0, _size.media)('small'), (0, _spacing.default)('m'), (0, _spacing.default)('sm'));
|
|
131
|
-
|
|
132
|
-
exports.MoneyBuys = MoneyBuys;
|
|
133
|
-
|
|
134
|
-
var FormFieldset = _styledComponents.default.div.withConfig({
|
|
94
|
+
var FormFieldset = exports.FormFieldset = _styledComponents.default.div.withConfig({
|
|
135
95
|
displayName: "Donatestyle__FormFieldset",
|
|
136
96
|
componentId: "sc-8rjm3t-12"
|
|
137
97
|
})(["display:flex;align-items:center;justify-content:center;"]);
|
|
138
|
-
|
|
139
|
-
exports.FormFieldset = FormFieldset;
|
|
140
|
-
var Label = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
98
|
+
var Label = exports.Label = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
141
99
|
displayName: "Donatestyle__Label",
|
|
142
100
|
componentId: "sc-8rjm3t-13"
|
|
143
101
|
})(["margin-right:", ";"], (0, _spacing.default)('sm'));
|
|
144
|
-
exports.
|
|
145
|
-
var AmountField = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
102
|
+
var AmountField = exports.AmountField = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
146
103
|
displayName: "Donatestyle__AmountField",
|
|
147
104
|
componentId: "sc-8rjm3t-14"
|
|
148
105
|
})(["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) {
|
|
@@ -155,14 +112,11 @@ var AmountField = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
|
155
112
|
var theme = _ref12.theme;
|
|
156
113
|
return theme.color('grey');
|
|
157
114
|
});
|
|
158
|
-
exports.
|
|
159
|
-
var Copy = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
115
|
+
var Copy = exports.Copy = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
160
116
|
displayName: "Donatestyle__Copy",
|
|
161
117
|
componentId: "sc-8rjm3t-15"
|
|
162
118
|
})(["line-height:1.5;margin-top:", ";"], (0, _spacing.default)('l'));
|
|
163
|
-
exports.
|
|
164
|
-
|
|
165
|
-
var Button = _styledComponents.default.button.withConfig({
|
|
119
|
+
var Button = exports.Button = _styledComponents.default.button.withConfig({
|
|
166
120
|
displayName: "Donatestyle__Button",
|
|
167
121
|
componentId: "sc-8rjm3t-16"
|
|
168
122
|
})(["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,11 +127,9 @@ var Button = _styledComponents.default.button.withConfig({
|
|
|
173
127
|
return theme.fontSize('s');
|
|
174
128
|
}, function (_ref15) {
|
|
175
129
|
var theme = _ref15.theme,
|
|
176
|
-
|
|
130
|
+
color = _ref15.color;
|
|
177
131
|
return theme.color(color);
|
|
178
132
|
}, function (_ref16) {
|
|
179
133
|
var theme = _ref16.theme;
|
|
180
134
|
return theme.color('coral_dark');
|
|
181
|
-
}, (0, _size.media)('small'), (0, _spacing.default)('md'), (0, _spacing.default)('l'));
|
|
182
|
-
|
|
183
|
-
exports.Button = Button;
|
|
135
|
+
}, (0, _size.media)('small'), (0, _spacing.default)('md'), (0, _spacing.default)('l'));
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
5
|
require("jest-styled-components");
|
|
8
|
-
|
|
9
6
|
var _shallowWithTheme = _interopRequireDefault(require("../../../hoc/shallowWithTheme"));
|
|
10
|
-
|
|
11
7
|
var _Donate = _interopRequireDefault(require("./Donate"));
|
|
12
|
-
|
|
13
8
|
var _data = _interopRequireDefault(require("./dev-data/data"));
|
|
14
|
-
|
|
15
9
|
var _dataSingle = _interopRequireDefault(require("./dev-data/data-single"));
|
|
16
|
-
|
|
17
10
|
var defaultData = require('../../../styleguide/data/data').defaultData;
|
|
18
|
-
|
|
19
11
|
it('Monthly donation renders correctly', function () {
|
|
20
12
|
var tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Donate.default, {
|
|
21
13
|
alt: "Background image",
|
|
@@ -1,94 +1,73 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
-
|
|
12
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
11
|
var _PopUpComponent = _interopRequireDefault(require("./PopUpComponent"));
|
|
17
|
-
|
|
18
12
|
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
19
|
-
|
|
20
13
|
var _MoneyBuy = _interopRequireDefault(require("../MoneyBuy/MoneyBuy"));
|
|
21
|
-
|
|
22
14
|
var _Membership = require("../../../../utils/Membership");
|
|
23
|
-
|
|
24
15
|
var _Donate = require("../Donate.style");
|
|
25
|
-
|
|
26
16
|
var _GivingSelector = _interopRequireDefault(require("../GivingSelector/GivingSelector"));
|
|
27
|
-
|
|
28
17
|
var _excluded = ["data", "donateLink", "otherAmountText", "clientID", "cartID", "mbshipID", "noMoneyBuys", "PopUpText", "chooseAmountText", "submitButtonColor", "otherAmountValue"];
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
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; }
|
|
33
|
-
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; }
|
|
34
20
|
var Signup = function Signup(_ref) {
|
|
35
21
|
var _ref$data = _ref.data,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
singleGiving = _ref$data.singleGiving,
|
|
23
|
+
regularGiving = _ref$data.regularGiving,
|
|
24
|
+
donateLink = _ref.donateLink,
|
|
25
|
+
otherAmountText = _ref.otherAmountText,
|
|
26
|
+
clientID = _ref.clientID,
|
|
27
|
+
cartID = _ref.cartID,
|
|
28
|
+
mbshipID = _ref.mbshipID,
|
|
29
|
+
noMoneyBuys = _ref.noMoneyBuys,
|
|
30
|
+
PopUpText = _ref.PopUpText,
|
|
31
|
+
chooseAmountText = _ref.chooseAmountText,
|
|
32
|
+
submitButtonColor = _ref.submitButtonColor,
|
|
33
|
+
otherAmountValue = _ref.otherAmountValue,
|
|
34
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
50
35
|
var _useState = (0, _react.useState)('single'),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
|
+
givingType = _useState2[0],
|
|
38
|
+
setGivingType = _useState2[1];
|
|
55
39
|
var _useState3 = (0, _react.useState)(false),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
40
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
41
|
+
errorMsg = _useState4[0],
|
|
42
|
+
setErrorMsg = _useState4[1];
|
|
60
43
|
var _useState5 = (0, _react.useState)(10),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
44
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
45
|
+
amountDonate = _useState6[0],
|
|
46
|
+
setAmountDonate = _useState6[1];
|
|
65
47
|
var _useState7 = (0, _react.useState)(true),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
48
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
49
|
+
moneyBuyCopy = _useState8[0],
|
|
50
|
+
setMoneyBuyCopy = _useState8[1];
|
|
70
51
|
var _useState9 = (0, _react.useState)(false),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
52
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
53
|
+
popOpen = _useState10[0],
|
|
54
|
+
setPopOpen = _useState10[1];
|
|
55
|
+
// In order to keep track of whether the user has ever been shown the popup
|
|
76
56
|
var _useState11 = (0, _react.useState)(false),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
57
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
58
|
+
popUpShown = _useState12[0],
|
|
59
|
+
setPopUpShown = _useState12[1];
|
|
81
60
|
(0, _react.useEffect)(function () {
|
|
82
61
|
// If a specific 'other amount' has been passed down, use it,
|
|
83
62
|
// otherwise assign based on the associated moneybuys:
|
|
84
63
|
if (otherAmountValue) {
|
|
85
64
|
setAmountDonate(otherAmountValue);
|
|
86
65
|
} else {
|
|
87
|
-
var _givingData = givingType === 'single' ? singleGiving : regularGiving;
|
|
66
|
+
var _givingData = givingType === 'single' ? singleGiving : regularGiving;
|
|
67
|
+
|
|
68
|
+
// Check the 2nd moneybuy exists before using it;
|
|
88
69
|
// 'philantrophy' carts have been set up to use a single moneybuy.
|
|
89
70
|
// See ENG-1685 for more details
|
|
90
|
-
|
|
91
|
-
|
|
92
71
|
var thisAmount = _givingData.moneybuys[1] ? _givingData.moneybuys[1].value : _givingData.moneybuys[0].value;
|
|
93
72
|
setAmountDonate(thisAmount);
|
|
94
73
|
}
|
|
@@ -100,10 +79,8 @@ var Signup = function Signup(_ref) {
|
|
|
100
79
|
if (moneyBuy.value === amountDonate) {
|
|
101
80
|
moneyBuyNewDescription = moneyBuy.description;
|
|
102
81
|
}
|
|
103
|
-
|
|
104
82
|
return index === 1 && amountDonate === undefined && (setMoneyBuyCopy(moneyBuy.description), setAmountDonate(moneyBuy.value));
|
|
105
83
|
});
|
|
106
|
-
|
|
107
84
|
if (!(0, _Membership.isAmountValid)(amountDonate)) {
|
|
108
85
|
if (moneyBuyCopy) setMoneyBuyCopy(false);
|
|
109
86
|
if (!errorMsg) setErrorMsg(true);
|
|
@@ -111,46 +88,45 @@ var Signup = function Signup(_ref) {
|
|
|
111
88
|
if (errorMsg) setErrorMsg(false);
|
|
112
89
|
setMoneyBuyCopy(moneyBuyNewDescription);
|
|
113
90
|
}
|
|
114
|
-
}, [errorMsg, moneyBuyCopy, singleGiving, regularGiving, givingType, amountDonate, otherAmountText]);
|
|
115
|
-
// being *currently* open and it *ever* having been shown to user
|
|
91
|
+
}, [errorMsg, moneyBuyCopy, singleGiving, regularGiving, givingType, amountDonate, otherAmountText]);
|
|
116
92
|
|
|
93
|
+
// Updates our flag that differentiates between the popup
|
|
94
|
+
// being *currently* open and it *ever* having been shown to user
|
|
117
95
|
(0, _react.useEffect)(function () {
|
|
118
96
|
if (popOpen && !popUpShown) setPopUpShown(true);
|
|
119
97
|
}, [popOpen, popUpShown]);
|
|
120
|
-
|
|
121
98
|
var submitDonation = function submitDonation(event, amount, clientId, cartId, mbshipId, donateURL) {
|
|
122
99
|
event.preventDefault();
|
|
123
|
-
|
|
124
100
|
if ((0, _Membership.isAmountValid)(amount) && !errorMsg) {
|
|
125
101
|
(0, _Membership.handleDonateSubmission)(amount, clientId, cartId, mbshipId, donateURL, givingType, popUpShown);
|
|
126
102
|
} else {
|
|
127
103
|
setErrorMsg(true);
|
|
128
104
|
setMoneyBuyCopy(false);
|
|
129
105
|
}
|
|
130
|
-
};
|
|
131
|
-
|
|
106
|
+
};
|
|
132
107
|
|
|
108
|
+
// Update the local state if the prop has been set and changed
|
|
133
109
|
(0, _react.useEffect)(function () {
|
|
134
110
|
if (otherAmountValue) {
|
|
135
111
|
setAmountDonate(otherAmountValue);
|
|
136
112
|
}
|
|
137
|
-
}, [otherAmountValue, setAmountDonate]);
|
|
113
|
+
}, [otherAmountValue, setAmountDonate]);
|
|
138
114
|
|
|
115
|
+
// Create money buy boxes
|
|
139
116
|
var givingData = givingType === 'single' ? singleGiving : regularGiving;
|
|
140
|
-
var showGivingSelector = singleGiving !== null && regularGiving !== null;
|
|
141
|
-
|
|
142
|
-
var amountRef = (0, _react.useRef)(null); // Create ref for amount button
|
|
117
|
+
var showGivingSelector = singleGiving !== null && regularGiving !== null;
|
|
143
118
|
|
|
119
|
+
// Create ref for amount input
|
|
120
|
+
var amountRef = (0, _react.useRef)(null);
|
|
121
|
+
// Create ref for amount button
|
|
144
122
|
var buttonRef = (0, _react.useRef)(null);
|
|
145
123
|
var handleClickOutside = (0, _react.useCallback)(function (event) {
|
|
146
124
|
if (!errorMsg) {
|
|
147
125
|
return;
|
|
148
126
|
}
|
|
149
|
-
|
|
150
127
|
if (buttonRef.current && event.target === buttonRef.current) {
|
|
151
128
|
return;
|
|
152
129
|
}
|
|
153
|
-
|
|
154
130
|
if (amountRef.current && !amountRef.current.contains(event.target)) {
|
|
155
131
|
// Check the 2nd moneybuy exists before using it;
|
|
156
132
|
// 'philantrophy' carts have been set up to use a single moneybuy.
|
|
@@ -158,8 +134,9 @@ var Signup = function Signup(_ref) {
|
|
|
158
134
|
var thisAmount = givingData.moneybuys[1] ? givingData.moneybuys[1].value : givingData.moneybuys[0].value;
|
|
159
135
|
setAmountDonate(thisAmount);
|
|
160
136
|
}
|
|
161
|
-
}, [errorMsg, givingData.moneybuys]);
|
|
137
|
+
}, [errorMsg, givingData.moneybuys]);
|
|
162
138
|
|
|
139
|
+
// Listen for click outside custom amount input if there is no value entered.
|
|
163
140
|
(0, _react.useEffect)(function () {
|
|
164
141
|
// Bind the event listener
|
|
165
142
|
document.addEventListener('mousedown', handleClickOutside);
|
|
@@ -167,20 +144,18 @@ var Signup = function Signup(_ref) {
|
|
|
167
144
|
// Unbind the event listener on clean up
|
|
168
145
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
169
146
|
};
|
|
170
|
-
}, [errorMsg, handleClickOutside]);
|
|
147
|
+
}, [errorMsg, handleClickOutside]);
|
|
171
148
|
|
|
149
|
+
// Create function to conditionally render button text
|
|
172
150
|
var renderButtonText = function renderButtonText() {
|
|
173
151
|
if (errorMsg) {
|
|
174
152
|
return 'Donate';
|
|
175
153
|
}
|
|
176
|
-
|
|
177
154
|
if (givingType === 'single') {
|
|
178
155
|
return "Donate \xA3".concat(amountDonate, " now");
|
|
179
156
|
}
|
|
180
|
-
|
|
181
157
|
return "Donate \xA3".concat(amountDonate, " monthly");
|
|
182
158
|
};
|
|
183
|
-
|
|
184
159
|
return /*#__PURE__*/_react.default.createElement(_Donate.FormWrapper, null, showGivingSelector && /*#__PURE__*/_react.default.createElement(_GivingSelector.default, {
|
|
185
160
|
givingType: givingType,
|
|
186
161
|
changeGivingType: function changeGivingType(data) {
|
|
@@ -250,11 +225,9 @@ var Signup = function Signup(_ref) {
|
|
|
250
225
|
ref: buttonRef
|
|
251
226
|
}, renderButtonText()))));
|
|
252
227
|
};
|
|
253
|
-
|
|
254
228
|
Signup.defaultProps = {
|
|
255
229
|
noMoneyBuys: false,
|
|
256
230
|
otherAmountValue: null,
|
|
257
231
|
data: {}
|
|
258
232
|
};
|
|
259
|
-
var _default = Signup;
|
|
260
|
-
exports.default = _default;
|
|
233
|
+
var _default = exports.default = Signup;
|
|
@@ -1,32 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _Text = _interopRequireDefault(require("../../../Atoms/Text/Text"));
|
|
17
|
-
|
|
18
12
|
var _size = require("../../../../theme/shared/size");
|
|
19
|
-
|
|
20
13
|
var _close = _interopRequireDefault(require("../assets/close.svg"));
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
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; }
|
|
25
|
-
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; }
|
|
26
16
|
var closeDuration = 0.6;
|
|
27
17
|
var fadeClose = (0, _styledComponents.keyframes)(["0%{opacity:1;max-height:350px;}100%{opacity:0;max-height:0px;display:none;margin-top:-16px;}"]);
|
|
28
18
|
var fadeOpen = (0, _styledComponents.keyframes)(["0%{opacity:0;max-height:0px;display:none;margin-top:-16px;}100%{opacity:1;max-height:350px;}"]);
|
|
29
|
-
|
|
30
19
|
var StyledPopUp = _styledComponents.default.div.withConfig({
|
|
31
20
|
displayName: "PopUpComponent__StyledPopUp",
|
|
32
21
|
componentId: "sc-1d7imlo-0"
|
|
@@ -38,12 +27,10 @@ var StyledPopUp = _styledComponents.default.div.withConfig({
|
|
|
38
27
|
var theme = _ref.theme;
|
|
39
28
|
return theme.color('blue_light');
|
|
40
29
|
}, (0, _size.media)('small'));
|
|
41
|
-
|
|
42
30
|
var TextWrapper = _styledComponents.default.div.withConfig({
|
|
43
31
|
displayName: "PopUpComponent__TextWrapper",
|
|
44
32
|
componentId: "sc-1d7imlo-1"
|
|
45
33
|
})(["margin:0 32px 32px;"]);
|
|
46
|
-
|
|
47
34
|
var Button = _styledComponents.default.button.withConfig({
|
|
48
35
|
displayName: "PopUpComponent__Button",
|
|
49
36
|
componentId: "sc-1d7imlo-2"
|
|
@@ -51,25 +38,22 @@ var Button = _styledComponents.default.button.withConfig({
|
|
|
51
38
|
var theme = _ref2.theme;
|
|
52
39
|
return theme.color('grey');
|
|
53
40
|
});
|
|
54
|
-
|
|
55
41
|
var PopUpComponent = function PopUpComponent(_ref3) {
|
|
56
42
|
var PopUpText = _ref3.PopUpText,
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
setPopOpen = _ref3.setPopOpen;
|
|
59
44
|
var _useState = (0, _react.useState)(false),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// this component - once the closing animation is complete
|
|
64
|
-
|
|
45
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
46
|
+
isClosed = _useState2[0],
|
|
47
|
+
setIsClosed = _useState2[1];
|
|
65
48
|
|
|
49
|
+
// Only update centralised state - which renders
|
|
50
|
+
// this component - once the closing animation is complete
|
|
66
51
|
var handleCloser = function handleCloser() {
|
|
67
52
|
setIsClosed(true);
|
|
68
53
|
setTimeout(function () {
|
|
69
54
|
setPopOpen(false);
|
|
70
55
|
}, closeDuration * 1000);
|
|
71
56
|
};
|
|
72
|
-
|
|
73
57
|
return /*#__PURE__*/_react.default.createElement(StyledPopUp, {
|
|
74
58
|
isClosed: isClosed,
|
|
75
59
|
fadeOpen: fadeOpen,
|
|
@@ -84,6 +68,4 @@ var PopUpComponent = function PopUpComponent(_ref3) {
|
|
|
84
68
|
alt: "Close cross icon"
|
|
85
69
|
})), /*#__PURE__*/_react.default.createElement(TextWrapper, null, /*#__PURE__*/_react.default.createElement(_Text.default, null, PopUpText)));
|
|
86
70
|
};
|
|
87
|
-
|
|
88
|
-
var _default = PopUpComponent;
|
|
89
|
-
exports.default = _default;
|
|
71
|
+
var _default = exports.default = PopUpComponent;
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _GivingSelector = require("./GivingSelector.style");
|
|
13
|
-
|
|
14
10
|
var GivingSelector = function GivingSelector(_ref) {
|
|
15
11
|
var givingType = _ref.givingType,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
changeGivingType = _ref.changeGivingType,
|
|
13
|
+
setPopOpen = _ref.setPopOpen,
|
|
14
|
+
mbshipID = _ref.mbshipID;
|
|
20
15
|
// Only updates giving type and popup status when appropriate
|
|
21
16
|
var handleGivingTypeChange = function handleGivingTypeChange(thisButtonType, currentGivingType) {
|
|
22
17
|
if (currentGivingType !== thisButtonType) {
|
|
@@ -24,7 +19,6 @@ var GivingSelector = function GivingSelector(_ref) {
|
|
|
24
19
|
setPopOpen(thisButtonType === 'single');
|
|
25
20
|
}
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
return /*#__PURE__*/_react.default.createElement(_GivingSelector.Wrapper, null, /*#__PURE__*/_react.default.createElement(_GivingSelector.MoneyBox, null, /*#__PURE__*/_react.default.createElement("input", {
|
|
29
23
|
className: "give-once",
|
|
30
24
|
"aria-label": "Single",
|
|
@@ -55,6 +49,4 @@ var GivingSelector = function GivingSelector(_ref) {
|
|
|
55
49
|
htmlFor: "give-monthly--".concat(mbshipID)
|
|
56
50
|
}, "Monthly"), /*#__PURE__*/_react.default.createElement(_GivingSelector.Switch, null)));
|
|
57
51
|
};
|
|
58
|
-
|
|
59
|
-
var _default = GivingSelector;
|
|
60
|
-
exports.default = _default;
|
|
52
|
+
var _default = exports.default = GivingSelector;
|