@comicrelief/component-library 8.52.3 → 8.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/main.yml +1 -1
- package/dist/components/Molecules/HeroBanner/HeroBanner.md +1 -1
- package/dist/components/Molecules/HeroBanner/HeroBanner.style.js +4 -4
- package/dist/components/Molecules/HeroBanner/__snapshots__/HeroBanner.test.js.snap +6 -0
- package/dist/components/Organisms/Donate/Donate.js +3 -0
- package/dist/components/Organisms/Donate/Form/Form.js +0 -1
- package/dist/components/Organisms/DonateBanner/DonateBanner.js +132 -0
- package/dist/components/Organisms/DonateBanner/DonateBanner.md +168 -0
- package/dist/components/Organisms/DonateBanner/DonateBanner.style.js +291 -0
- package/dist/components/Organisms/DonateBanner/DonateBanner.test.js +134 -0
- package/dist/components/Organisms/DonateBanner/Form/Form.js +214 -0
- package/dist/components/Organisms/DonateBanner/Form/PopUpComponent.js +70 -0
- package/dist/components/Organisms/DonateBanner/GivingSelector/GivingSelector.js +50 -0
- package/dist/components/Organisms/DonateBanner/GivingSelector/GivingSelector.style.js +73 -0
- package/dist/components/Organisms/DonateBanner/MoneyBuy/MoneyBuy.js +83 -0
- package/dist/components/Organisms/DonateBanner/__snapshots__/DonateBanner.test.js.snap +3170 -0
- package/dist/components/Organisms/DonateBanner/_utils.js +41 -0
- package/dist/components/Organisms/DonateBanner/assets/close.svg +3 -0
- package/dist/components/Organisms/DonateBanner/dev-data/data-high-value.js +33 -0
- package/dist/components/Organisms/DonateBanner/dev-data/data-monthly.js +22 -0
- package/dist/components/Organisms/DonateBanner/dev-data/data-single.js +22 -0
- package/dist/components/Organisms/DonateBanner/dev-data/data.js +33 -0
- package/dist/index.js +7 -0
- package/package.json +1 -1
- package/src/components/Molecules/HeroBanner/HeroBanner.md +1 -1
- package/src/components/Molecules/HeroBanner/HeroBanner.style.js +15 -2
- package/src/components/Molecules/HeroBanner/__snapshots__/HeroBanner.test.js.snap +6 -0
- package/src/components/Organisms/Donate/Donate.js +5 -0
- package/src/components/Organisms/Donate/Form/Form.js +0 -1
- package/src/components/Organisms/DonateBanner/DonateBanner.js +210 -0
- package/src/components/Organisms/DonateBanner/DonateBanner.md +168 -0
- package/src/components/Organisms/DonateBanner/DonateBanner.style.js +320 -0
- package/src/components/Organisms/DonateBanner/DonateBanner.test.js +151 -0
- package/src/components/Organisms/DonateBanner/Form/Form.js +332 -0
- package/src/components/Organisms/DonateBanner/Form/PopUpComponent.js +110 -0
- package/src/components/Organisms/DonateBanner/GivingSelector/GivingSelector.js +61 -0
- package/src/components/Organisms/DonateBanner/GivingSelector/GivingSelector.style.js +71 -0
- package/src/components/Organisms/DonateBanner/MoneyBuy/MoneyBuy.js +58 -0
- package/src/components/Organisms/DonateBanner/__snapshots__/DonateBanner.test.js.snap +3170 -0
- package/src/components/Organisms/DonateBanner/_utils.js +34 -0
- package/src/components/Organisms/DonateBanner/assets/close.svg +3 -0
- package/src/components/Organisms/DonateBanner/dev-data/data-high-value.js +41 -0
- package/src/components/Organisms/DonateBanner/dev-data/data-monthly.js +23 -0
- package/src/components/Organisms/DonateBanner/dev-data/data-single.js +23 -0
- package/src/components/Organisms/DonateBanner/dev-data/data.js +41 -0
- package/src/index.js +1 -0
|
@@ -74,7 +74,7 @@ import variants from './_variants';
|
|
|
74
74
|
imageLow={defaultData.heroBannerImage}
|
|
75
75
|
imageAltText="Image alt text"
|
|
76
76
|
variant={variants.FULL_HEIGHT}
|
|
77
|
-
ctaText="Register to fundraise but
|
|
77
|
+
ctaText="Register to fundraise but very very very very long oh it's a big link this one"
|
|
78
78
|
ctaUrl="http://www.comicrelief.com/register"
|
|
79
79
|
ctaNewTab
|
|
80
80
|
copyLeft
|
|
@@ -133,7 +133,7 @@ const CopyOuterWrapper = exports.CopyOuterWrapper = _styledComponents.default.di
|
|
|
133
133
|
const Copy = exports.Copy = _styledComponents.default.div.withConfig({
|
|
134
134
|
displayName: "HeroBannerstyle__Copy",
|
|
135
135
|
componentId: "sc-2ch4eo-4"
|
|
136
|
-
})(["width:100%;", ";border-radius:1rem;padding:", ";color:", ";background-color:", ";", ";", ";@media ", "{width:", ";}"], (0, _zIndex.default)('low'), _ref17 => {
|
|
136
|
+
})(["width:100%;", ";border-radius:1rem;padding:", ";color:", ";box-shadow:rgba(0,0,0,0.15) 0px 0px 1.5rem;background-color:", ";", ";", ";@media ", "{width:", ";}"], (0, _zIndex.default)('low'), _ref17 => {
|
|
137
137
|
let {
|
|
138
138
|
variant
|
|
139
139
|
} = _ref17;
|
|
@@ -186,7 +186,7 @@ const Copy = exports.Copy = _styledComponents.default.div.withConfig({
|
|
|
186
186
|
const CopyInnerWrapper = exports.CopyInnerWrapper = _styledComponents.default.div.withConfig({
|
|
187
187
|
displayName: "HeroBannerstyle__CopyInnerWrapper",
|
|
188
188
|
componentId: "sc-2ch4eo-5"
|
|
189
|
-
})(["width:100%;height:100%;display:flex;align-items:center;@media ", "{height:auto;", ";", ";justify-content:", ";}"], _ref24 => {
|
|
189
|
+
})(["width:100%;height:100%;display:flex;align-items:center;border-radius:1rem;@media ", "{height:auto;", ";", ";justify-content:", ";}"], _ref24 => {
|
|
190
190
|
let {
|
|
191
191
|
theme
|
|
192
192
|
} = _ref24;
|
|
@@ -210,7 +210,7 @@ const CopyInnerWrapper = exports.CopyInnerWrapper = _styledComponents.default.di
|
|
|
210
210
|
const CTAWrapper = exports.CTAWrapper = _styledComponents.default.div.withConfig({
|
|
211
211
|
displayName: "HeroBannerstyle__CTAWrapper",
|
|
212
212
|
componentId: "sc-2ch4eo-6"
|
|
213
|
-
})(["width:100%;height:auto;position:relative;padding:0.5rem 0;margin-top:1.25rem;", ""], _ref28 => {
|
|
213
|
+
})(["width:100%;height:auto;position:relative;padding:0.5rem 2.5rem 0 0;margin-top:1.25rem;", ""], _ref28 => {
|
|
214
214
|
let {
|
|
215
215
|
variant
|
|
216
216
|
} = _ref28;
|
|
@@ -236,7 +236,7 @@ const CtaTextUnderline = exports.CtaTextUnderline = _styledComponents.default.im
|
|
|
236
236
|
const HeroBannerLink = exports.HeroBannerLink = _styledComponents.default.a.withConfig({
|
|
237
237
|
displayName: "HeroBannerstyle__HeroBannerLink",
|
|
238
238
|
componentId: "sc-2ch4eo-10"
|
|
239
|
-
})(["text-decoration:none;width:100
|
|
239
|
+
})(["text-decoration:none;width:100%;> div{transition:box-shadow 0.35s;box-shadow:rgba(0,0,0,0.15) 0px 0px 1.5rem;}&:hover{> div{box-shadow:rgba(0,0,0,0.25) 0px 0px 1.5rem;}}@media ", "{", " width:", ";> div{width:100%;}&:hover{img.cta-text-underline{opacity:1;}}}"], _ref30 => {
|
|
240
240
|
let {
|
|
241
241
|
theme
|
|
242
242
|
} = _ref30;
|
|
@@ -116,6 +116,7 @@ exports[`renders "Full Height Media" Hero Banner correctly 1`] = `
|
|
|
116
116
|
border-radius: 1rem;
|
|
117
117
|
padding: 1.5rem;
|
|
118
118
|
color: #000000;
|
|
119
|
+
box-shadow: rgba(0,0,0,0.15) 0px 0px 1.5rem;
|
|
119
120
|
background-color: #FFFFFF;
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -130,6 +131,7 @@ exports[`renders "Full Height Media" Hero Banner correctly 1`] = `
|
|
|
130
131
|
-webkit-box-align: center;
|
|
131
132
|
-ms-flex-align: center;
|
|
132
133
|
align-items: center;
|
|
134
|
+
border-radius: 1rem;
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
@media (min-width:740px) {
|
|
@@ -435,6 +437,7 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
|
|
|
435
437
|
border-radius: 1rem;
|
|
436
438
|
padding: 1.5rem;
|
|
437
439
|
color: #000000;
|
|
440
|
+
box-shadow: rgba(0,0,0,0.15) 0px 0px 1.5rem;
|
|
438
441
|
background-color: #FFFFFF;
|
|
439
442
|
}
|
|
440
443
|
|
|
@@ -449,6 +452,7 @@ exports[`renders "Half Height Media" Hero Banner correctly 1`] = `
|
|
|
449
452
|
-webkit-box-align: center;
|
|
450
453
|
-ms-flex-align: center;
|
|
451
454
|
align-items: center;
|
|
455
|
+
border-radius: 1rem;
|
|
452
456
|
}
|
|
453
457
|
|
|
454
458
|
@media (min-width:740px) {
|
|
@@ -736,6 +740,7 @@ exports[`renders "Text Banner" Hero Banner correctly 1`] = `
|
|
|
736
740
|
border-radius: 1rem;
|
|
737
741
|
padding: 3rem 1.5rem;
|
|
738
742
|
color: #000000;
|
|
743
|
+
box-shadow: rgba(0,0,0,0.15) 0px 0px 1.5rem;
|
|
739
744
|
background-color: #2C0230;
|
|
740
745
|
text-align: center;
|
|
741
746
|
}
|
|
@@ -751,6 +756,7 @@ exports[`renders "Text Banner" Hero Banner correctly 1`] = `
|
|
|
751
756
|
-webkit-box-align: center;
|
|
752
757
|
-ms-flex-align: center;
|
|
753
758
|
align-items: center;
|
|
759
|
+
border-radius: 1rem;
|
|
754
760
|
}
|
|
755
761
|
|
|
756
762
|
@media (min-width:740px) {
|
|
@@ -14,6 +14,9 @@ var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
|
14
14
|
var _Form = _interopRequireDefault(require("./Form/Form"));
|
|
15
15
|
var _utils = require("./_utils");
|
|
16
16
|
var _Donate = require("./Donate.style");
|
|
17
|
+
// NB this is now our 'old' Donate widget, which is being replaced by the DonateBanner component
|
|
18
|
+
// This component is now deprecated and will be removed in a future release.
|
|
19
|
+
// TODO: Remove this component in a future release.
|
|
17
20
|
const Donate = _ref => {
|
|
18
21
|
let {
|
|
19
22
|
alt = '',
|
|
@@ -36,7 +36,6 @@ const Signup = _ref => {
|
|
|
36
36
|
givingType = null,
|
|
37
37
|
...rest
|
|
38
38
|
} = _ref;
|
|
39
|
-
// const [givingType, setGivingType] = useState();
|
|
40
39
|
const [errorMsg, setErrorMsg] = (0, _react.useState)(false);
|
|
41
40
|
const [amountDonate, setAmountDonate] = (0, _react.useState)(10);
|
|
42
41
|
const [moneyBuyCopy, setMoneyBuyCopy] = (0, _react.useState)(true);
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactResponsive = require("react-responsive");
|
|
11
|
+
var _allBreakpoints = require("../../../theme/shared/allBreakpoints");
|
|
12
|
+
var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
|
|
13
|
+
var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
14
|
+
var _Form = _interopRequireDefault(require("./Form/Form"));
|
|
15
|
+
var _utils = require("./_utils");
|
|
16
|
+
var _DonateBanner = require("./DonateBanner.style");
|
|
17
|
+
const DonateBanner = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
donateWidgetIsTextOnly = false,
|
|
20
|
+
donateOrientation = 'right',
|
|
21
|
+
paddingAbove = '2rem',
|
|
22
|
+
paddingBelow = '2rem',
|
|
23
|
+
pageBackgroundColour = 'transparent',
|
|
24
|
+
componentBackgroundColour = 'white',
|
|
25
|
+
title = null,
|
|
26
|
+
subtitle = '',
|
|
27
|
+
monthlyTitle = '',
|
|
28
|
+
monthlySubtitle = '',
|
|
29
|
+
popUpText = 'Help us deliver long-term impact by converting your single donation into a monthly gift.',
|
|
30
|
+
chooseAmountText = null,
|
|
31
|
+
monthlyChooseAmountText = null,
|
|
32
|
+
otherAmountText = 'will help us fund amazing projects in the UK and around the world.',
|
|
33
|
+
monthlyOtherAmountText = '',
|
|
34
|
+
hideMoneyBuys = false,
|
|
35
|
+
imageL = null,
|
|
36
|
+
imageM = null,
|
|
37
|
+
imageS = null,
|
|
38
|
+
data = {},
|
|
39
|
+
cartID,
|
|
40
|
+
clientID,
|
|
41
|
+
donateLink,
|
|
42
|
+
mbshipID
|
|
43
|
+
} = _ref;
|
|
44
|
+
const isLarge = (0, _reactResponsive.useMediaQuery)({
|
|
45
|
+
query: `(min-width: ${_allBreakpoints.breakpointValues.L}px)`
|
|
46
|
+
});
|
|
47
|
+
const isMedium = (0, _reactResponsive.useMediaQuery)({
|
|
48
|
+
query: `(min-width: ${_allBreakpoints.breakpointValues.M}px)`
|
|
49
|
+
});
|
|
50
|
+
const [givingType, setGivingType] = (0, _react.useState)();
|
|
51
|
+
const {
|
|
52
|
+
showCopy,
|
|
53
|
+
thisTitle,
|
|
54
|
+
thisSubtitle,
|
|
55
|
+
noTitlesAtAll
|
|
56
|
+
} = (0, _utils.handleTitles)(givingType, title, subtitle, monthlyTitle, monthlySubtitle);
|
|
57
|
+
const {
|
|
58
|
+
thisOtherAmountText
|
|
59
|
+
} = (0, _utils.handleOtherAmountText)(givingType, otherAmountText, monthlyOtherAmountText);
|
|
60
|
+
const shouldShowImage = donateWidgetIsTextOnly === false;
|
|
61
|
+
const shouldShowDesktopImage = shouldShowImage && isLarge && imageL && (imageL.images || imageL.image);
|
|
62
|
+
const shouldShowTopImage = shouldShowImage && !isLarge;
|
|
63
|
+
const topImage = isMedium ? imageM : imageS;
|
|
64
|
+
const shouldRenderTopImage = shouldShowTopImage && topImage && (topImage.images || topImage.image);
|
|
65
|
+
|
|
66
|
+
// For text-only variants, we hide the title area on non-desktop widths
|
|
67
|
+
// (M and below), so only the form is shown.
|
|
68
|
+
const shouldShowTitleSection = noTitlesAtAll === false && isLarge && donateWidgetIsTextOnly;
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(_DonateBanner.Container, {
|
|
70
|
+
paddingAbove: paddingAbove,
|
|
71
|
+
paddingBelow: paddingBelow,
|
|
72
|
+
pageBackgroundColour: pageBackgroundColour,
|
|
73
|
+
id: mbshipID
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement(_DonateBanner.InnerContainer, {
|
|
75
|
+
componentBackgroundColour: componentBackgroundColour,
|
|
76
|
+
$donateWidgetIsTextOnly: donateWidgetIsTextOnly
|
|
77
|
+
}, shouldRenderTopImage ? /*#__PURE__*/_react.default.createElement(_Picture.default, {
|
|
78
|
+
image: topImage.image,
|
|
79
|
+
images: topImage.images,
|
|
80
|
+
imageLow: topImage.imageLow,
|
|
81
|
+
objectFit: "cover",
|
|
82
|
+
width: "100%",
|
|
83
|
+
height: "100%",
|
|
84
|
+
alt: topImage.alt || ''
|
|
85
|
+
// Force React to re-render with any updated image details
|
|
86
|
+
,
|
|
87
|
+
key: topImage.imageLow
|
|
88
|
+
}) : null, shouldShowDesktopImage ? /*#__PURE__*/_react.default.createElement(_DonateBanner.BgImage, {
|
|
89
|
+
image: imageL.image,
|
|
90
|
+
images: imageL.images,
|
|
91
|
+
imageLow: imageL.imageLow,
|
|
92
|
+
objectFit: "cover",
|
|
93
|
+
width: "100%",
|
|
94
|
+
height: "100%",
|
|
95
|
+
alt: imageL.alt || '',
|
|
96
|
+
isBackgroundImage: true
|
|
97
|
+
}) : null, /*#__PURE__*/_react.default.createElement(_DonateBanner.Wrapper, {
|
|
98
|
+
donateOrientation: donateOrientation,
|
|
99
|
+
"aria-live": "polite",
|
|
100
|
+
noTitlesAtAll: noTitlesAtAll,
|
|
101
|
+
hasTopImage: shouldRenderTopImage,
|
|
102
|
+
shouldShowTitleSection: shouldShowTitleSection
|
|
103
|
+
}, shouldShowTitleSection && /*#__PURE__*/_react.default.createElement(_DonateBanner.TitleWrapperOuter, {
|
|
104
|
+
donateOrientation: donateOrientation
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement(_DonateBanner.TitleWrapperInner, null, showCopy && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
106
|
+
tag: "h2",
|
|
107
|
+
size: "big",
|
|
108
|
+
family: "Anton",
|
|
109
|
+
weight: "normal"
|
|
110
|
+
}, thisTitle), /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
111
|
+
tag: "p",
|
|
112
|
+
size: "m"
|
|
113
|
+
}, thisSubtitle)))), /*#__PURE__*/_react.default.createElement(_Form.default, {
|
|
114
|
+
data: data,
|
|
115
|
+
otherAmountText: thisOtherAmountText,
|
|
116
|
+
cartID: cartID,
|
|
117
|
+
clientID: clientID,
|
|
118
|
+
mbshipID: mbshipID,
|
|
119
|
+
donateLink: donateLink,
|
|
120
|
+
hideMoneyBuys: hideMoneyBuys,
|
|
121
|
+
popUpText: popUpText,
|
|
122
|
+
chooseAmountText: chooseAmountText,
|
|
123
|
+
monthlyChooseAmountText: monthlyChooseAmountText,
|
|
124
|
+
donateWidgetIsTextOnly: donateWidgetIsTextOnly,
|
|
125
|
+
hasTopImage: shouldRenderTopImage,
|
|
126
|
+
shouldShowTitleSection: shouldShowTitleSection,
|
|
127
|
+
donateOrientation: donateOrientation,
|
|
128
|
+
givingType: givingType,
|
|
129
|
+
changeGivingType: setGivingType
|
|
130
|
+
}))));
|
|
131
|
+
};
|
|
132
|
+
var _default = exports.default = DonateBanner;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# DonateBanner
|
|
2
|
+
|
|
3
|
+
## Image banner (widget right), custom padding + background
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
import data from './dev-data/data';
|
|
7
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
8
|
+
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
9
|
+
|
|
10
|
+
const imageL = {
|
|
11
|
+
images: desktopPictures.images,
|
|
12
|
+
imageLow: desktopPictures.imageLow,
|
|
13
|
+
alt: 'Background image'
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const imageM = {
|
|
17
|
+
images: desktopPictures.images,
|
|
18
|
+
imageLow: desktopPictures.imageLow,
|
|
19
|
+
alt: 'Background image'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const imageS = {
|
|
23
|
+
images: mobilePictures.images,
|
|
24
|
+
imageLow: mobilePictures.imageLow,
|
|
25
|
+
alt: 'Background image'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
<DonateBanner
|
|
29
|
+
pageBackgroundColour="grey_light"
|
|
30
|
+
paddingAbove="0rem"
|
|
31
|
+
paddingBelow="2rem"
|
|
32
|
+
donateOrientation="right"
|
|
33
|
+
imageL={imageL}
|
|
34
|
+
imageM={imageM}
|
|
35
|
+
imageS={imageS}
|
|
36
|
+
data={data}
|
|
37
|
+
mbshipID="mbship-1"
|
|
38
|
+
donateLink="https://donation.comicrelief.com/"
|
|
39
|
+
clientID="donate"
|
|
40
|
+
cartID="default-comicrelief"
|
|
41
|
+
title="Donate Now"
|
|
42
|
+
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
43
|
+
/>;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Image banner (widget left), monthly title/subtitle + choose amount text overrides
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
import data from './dev-data/data';
|
|
50
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
51
|
+
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
52
|
+
|
|
53
|
+
const imageL = {
|
|
54
|
+
images: desktopPictures.images,
|
|
55
|
+
imageLow: desktopPictures.imageLow,
|
|
56
|
+
alt: 'Background image'
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const imageM = {
|
|
60
|
+
images: desktopPictures.images,
|
|
61
|
+
imageLow: desktopPictures.imageLow,
|
|
62
|
+
alt: 'Background image'
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const imageS = {
|
|
66
|
+
images: mobilePictures.images,
|
|
67
|
+
imageLow: mobilePictures.imageLow,
|
|
68
|
+
alt: 'Background image'
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
<DonateBanner
|
|
72
|
+
pageBackgroundColour="grey_light"
|
|
73
|
+
paddingAbove="2rem"
|
|
74
|
+
paddingBelow="2rem"
|
|
75
|
+
donateOrientation="left"
|
|
76
|
+
imageL={imageL}
|
|
77
|
+
imageM={imageM}
|
|
78
|
+
imageS={imageS}
|
|
79
|
+
data={data}
|
|
80
|
+
mbshipID="mbship-2"
|
|
81
|
+
donateLink="https://donation.comicrelief.com/"
|
|
82
|
+
clientID="donate"
|
|
83
|
+
cartID="default-comicrelief"
|
|
84
|
+
title="Donate today"
|
|
85
|
+
subtitle="Your support can help people facing the toughest times."
|
|
86
|
+
monthlyTitle="Give monthly"
|
|
87
|
+
monthlySubtitle="A regular gift helps fund long-term impact."
|
|
88
|
+
chooseAmountText="Choose a one-off amount"
|
|
89
|
+
monthlyChooseAmountText="Choose a monthly amount"
|
|
90
|
+
popUpText="Switching to a single gift means less predictable funding."
|
|
91
|
+
/>;
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Text-only widget (no image), custom widget background + text colour
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
import data from './dev-data/data-single';
|
|
98
|
+
|
|
99
|
+
<DonateBanner
|
|
100
|
+
donateWidgetIsTextOnly
|
|
101
|
+
pageBackgroundColour="rnd_25_glitzy_grape"
|
|
102
|
+
componentBackgroundColour="deep_violet_dark"
|
|
103
|
+
paddingAbove="2rem"
|
|
104
|
+
paddingBelow="2rem"
|
|
105
|
+
donateOrientation="right"
|
|
106
|
+
data={data}
|
|
107
|
+
mbshipID="mbship-3"
|
|
108
|
+
donateLink="https://donation.comicrelief.com/"
|
|
109
|
+
clientID="donate"
|
|
110
|
+
cartID="default-comicrelief"
|
|
111
|
+
title="Donate now"
|
|
112
|
+
subtitle="Make a difference today."
|
|
113
|
+
chooseAmountText="Enter an amount to give"
|
|
114
|
+
noMoneyBuys
|
|
115
|
+
/>;
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Text-only widget (no image), with the usual moneybuys, standard colours
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
import data from './dev-data/data';
|
|
122
|
+
|
|
123
|
+
<DonateBanner
|
|
124
|
+
donateWidgetIsTextOnly
|
|
125
|
+
pageBackgroundColour="grey_light"
|
|
126
|
+
componentBackgroundColour="white"
|
|
127
|
+
paddingAbove="2rem"
|
|
128
|
+
paddingBelow="2rem"
|
|
129
|
+
donateOrientation="right"
|
|
130
|
+
data={data}
|
|
131
|
+
mbshipID="mbship-3b"
|
|
132
|
+
donateLink="https://donation.comicrelief.com/"
|
|
133
|
+
clientID="donate"
|
|
134
|
+
cartID="default-comicrelief"
|
|
135
|
+
title="Donate now"
|
|
136
|
+
subtitle="Choose an amount or pick a moneybuy."
|
|
137
|
+
/>;
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Different “Other amount” copy for single vs monthly
|
|
141
|
+
|
|
142
|
+
```js
|
|
143
|
+
import data from './dev-data/data';
|
|
144
|
+
const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
145
|
+
|
|
146
|
+
const imageL = {
|
|
147
|
+
images: desktopPictures.images,
|
|
148
|
+
imageLow: desktopPictures.imageLow,
|
|
149
|
+
alt: 'Background image'
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
<DonateBanner
|
|
153
|
+
pageBackgroundColour="grey_light"
|
|
154
|
+
paddingAbove="0rem"
|
|
155
|
+
paddingBelow="0rem"
|
|
156
|
+
donateOrientation="left"
|
|
157
|
+
imageL={imageL}
|
|
158
|
+
data={data}
|
|
159
|
+
mbshipID="mbship-4"
|
|
160
|
+
donateLink="https://donation.comicrelief.com/"
|
|
161
|
+
clientID="donate"
|
|
162
|
+
cartID="default-comicrelief"
|
|
163
|
+
title="Donate now"
|
|
164
|
+
subtitle="Help fund life-changing work."
|
|
165
|
+
otherAmountText="can help support people in crisis."
|
|
166
|
+
monthlyOtherAmountText="each month can help provide long-term support."
|
|
167
|
+
/>;
|
|
168
|
+
```
|