@comicrelief/component-library 7.5.0 → 7.7.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.
@@ -31,9 +31,9 @@ var Donate = function Donate(_ref) {
31
31
  var alt = _ref.alt,
32
32
  cartID = _ref.cartID,
33
33
  clientID = _ref.clientID,
34
- overlayColor = _ref.overlayColor,
35
- backgroundColor = _ref.backgroundColor,
36
- buttonColor = _ref.buttonColor,
34
+ desktopOverlayColor = _ref.desktopOverlayColor,
35
+ mobileBackgroundColor = _ref.mobileBackgroundColor,
36
+ submitButtonColor = _ref.submitButtonColor,
37
37
  textColor = _ref.textColor,
38
38
  donateLink = _ref.donateLink,
39
39
  data = _ref.data,
@@ -70,12 +70,12 @@ var Donate = function Donate(_ref) {
70
70
 
71
71
  isDesktop = overrideValue !== null ? overrideValue : isDesktop;
72
72
  return /*#__PURE__*/_react.default.createElement(_Donate.Container, {
73
- backgroundColor: backgroundColor,
74
- overlayColor: overlayColor,
73
+ mobileBackgroundColor: mobileBackgroundColor,
74
+ desktopOverlayColor: desktopOverlayColor,
75
75
  id: mbshipID,
76
76
  key: overrideValue
77
77
  }, !isDesktop && mobileImages ? /*#__PURE__*/_react.default.createElement(_Picture.default, {
78
- backgroundColor: backgroundColor,
78
+ backgroundColor: mobileBackgroundColor,
79
79
  image: mobileImage,
80
80
  images: mobileImages,
81
81
  imageLow: mobileImageLow,
@@ -84,7 +84,7 @@ var Donate = function Donate(_ref) {
84
84
  height: "100%",
85
85
  alt: mobileAlt
86
86
  }) : null, isDesktop && images ? /*#__PURE__*/_react.default.createElement(_Donate.BgImage, {
87
- backgroundColor: overlayColor,
87
+ backgroundColor: desktopOverlayColor,
88
88
  image: image,
89
89
  images: images,
90
90
  imageLow: imageLow,
@@ -119,7 +119,7 @@ var Donate = function Donate(_ref) {
119
119
  noMoneyBuys: noMoneyBuys,
120
120
  PopUpText: PopUpText,
121
121
  chooseAmountText: chooseAmountText,
122
- buttonColor: buttonColor
122
+ submitButtonColor: submitButtonColor
123
123
  })));
124
124
  };
125
125
 
@@ -134,9 +134,9 @@ Donate.defaultProps = {
134
134
  mobileImage: null,
135
135
  mobileImages: null,
136
136
  mobileAlt: '',
137
- overlayColor: 'transparent',
138
- backgroundColor: 'blue_dark',
139
- buttonColor: 'red',
137
+ desktopOverlayColor: 'transparent',
138
+ mobileBackgroundColor: 'blue_dark',
139
+ submitButtonColor: 'red',
140
140
  textColor: 'white',
141
141
  mbshipID: null,
142
142
  otherAmountText: 'will help us fund amazing projects in the UK and around the world.',
@@ -1,6 +1,6 @@
1
1
  # Donate
2
2
 
3
- ## Form align right, with red desktop overlay and purple mobile background colour
3
+ ## Form align right, with red desktop overlay and purple mobile background colour, with a blue submit button
4
4
 
5
5
  ```js
6
6
  import data from './dev-data/data';
@@ -9,8 +9,9 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
9
9
 
10
10
  <Donate
11
11
  alt="Background image"
12
- backgroundColor="deep_violet_dark"
13
- overlayColor="red"
12
+ mobileBackgroundColor="deep_violet_dark"
13
+ desktopOverlayColor="red"
14
+ submitButtonColor="blue_dark"
14
15
  formAlignRight={true}
15
16
  imageLow={desktopPictures.imageLow}
16
17
  images={desktopPictures.images}
@@ -34,8 +35,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
34
35
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
35
36
 
36
37
  <Donate
37
- backgroundColor="blue_dark"
38
- overlayColor="blue_dark"
38
+ mobileBackgroundColor="blue_dark"
39
+ desktopOverlayColor="blue_dark"
39
40
  formAlignRight={false}
40
41
  imageLow={desktopPictures.imageLow}
41
42
  images={desktopPictures.images}
@@ -60,8 +61,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
60
61
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
61
62
 
62
63
  <Donate
63
- backgroundColor="blue_dark"
64
- overlayColor="blue_dark"
64
+ mobileBackgroundColor="blue_dark"
65
+ desktopOverlayColor="blue_dark"
65
66
  formAlignRight={false}
66
67
  imageLow={desktopPictures.imageLow}
67
68
  images={desktopPictures.images}
@@ -85,8 +86,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
85
86
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
86
87
 
87
88
  <Donate
88
- backgroundColor="blue_dark"
89
- overlayColor="blue_dark"
89
+ mobileBackgroundColor="blue_dark"
90
+ desktopOverlayColor="blue_dark"
90
91
  formAlignRight={false}
91
92
  imageLow={desktopPictures.imageLow}
92
93
  images={desktopPictures.images}
@@ -112,8 +113,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
112
113
 
113
114
  <Donate
114
115
  alt="Background image"
115
- backgroundColor="transparent"
116
- overlayColor="transparent"
116
+ mobileBackgroundColor="transparent"
117
+ desktopOverlayColor="transparent"
117
118
  formAlignRight={true}
118
119
  imageLow={desktopPictures.imageLow}
119
120
  images={desktopPictures.images}
@@ -137,7 +138,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
137
138
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
138
139
 
139
140
  <Donate
140
- backgroundColor="transparent"
141
+ mobileBackgroundColor="transparent"
141
142
  formAlignRight={false}
142
143
  imageLow={desktopPictures.imageLow}
143
144
  images={desktopPictures.images}
@@ -161,7 +162,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
161
162
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
162
163
 
163
164
  <Donate
164
- backgroundColor="blue_dark"
165
+ mobileBackgroundColor="blue_dark"
165
166
  formAlignRight={false}
166
167
  imageLow={desktopPictures.imageLow}
167
168
  images={desktopPictures.images}
@@ -185,7 +186,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
185
186
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
186
187
 
187
188
  <Donate
188
- backgroundColor="blue_dark"
189
+ mobileBackgroundColor="blue_dark"
189
190
  formAlignRight={false}
190
191
  imageLow={desktopPictures.imageLow}
191
192
  images={desktopPictures.images}
@@ -208,8 +209,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
208
209
  import data from './dev-data/data-single';
209
210
 
210
211
  <Donate
211
- overlayColor="blue_dark"
212
- backgroundColor="blue_dark"
212
+ desktopOverlayColor="blue_dark"
213
+ mobileBackgroundColor="blue_dark"
213
214
  formAlignRight={false}
214
215
  data={data}
215
216
  mbshipID="mship-9"
@@ -232,8 +233,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
232
233
 
233
234
  <Donate
234
235
  alt="Background image"
235
- backgroundColor="red"
236
- overlayColor="red"
236
+ mobileBackgroundColor="red"
237
+ desktopOverlayColor="red"
237
238
  formAlignRight={true}
238
239
  imageLow={desktopPictures.imageLow}
239
240
  images={desktopPictures.images}
@@ -27,12 +27,12 @@ var Container = _styledComponents.default.div.withConfig({
27
27
  componentId: "sc-8rjm3t-0"
28
28
  })(["position:relative;display:flex;flex-direction:column;justify-content:center;height:auto;background-color:", ";", "{flex-direction:row;align-items:center;justify-content:inherit;background-color:", ";}"], function (_ref) {
29
29
  var theme = _ref.theme,
30
- backgroundColor = _ref.backgroundColor;
31
- return theme.color(backgroundColor);
30
+ mobileBackgroundColor = _ref.mobileBackgroundColor;
31
+ return theme.color(mobileBackgroundColor);
32
32
  }, (0, _size.media)('medium'), function (_ref2) {
33
33
  var theme = _ref2.theme,
34
- overlayColor = _ref2.overlayColor;
35
- return theme.color(overlayColor);
34
+ desktopOverlayColor = _ref2.desktopOverlayColor;
35
+ return theme.color(desktopOverlayColor);
36
36
  });
37
37
 
38
38
  exports.Container = Container;
@@ -173,8 +173,8 @@ var Button = _styledComponents.default.button.withConfig({
173
173
  return theme.fontSize('s');
174
174
  }, function (_ref15) {
175
175
  var theme = _ref15.theme,
176
- buttonColor = _ref15.buttonColor;
177
- return theme.color(buttonColor);
176
+ color = _ref15.color;
177
+ return theme.color(color);
178
178
  }, function (_ref16) {
179
179
  var theme = _ref16.theme;
180
180
  return theme.color('coral_dark');
@@ -25,7 +25,7 @@ var _Donate = require("../Donate.style");
25
25
 
26
26
  var _GivingSelector = _interopRequireDefault(require("../GivingSelector/GivingSelector"));
27
27
 
28
- var _excluded = ["data", "donateLink", "otherAmountText", "clientID", "cartID", "mbshipID", "noMoneyBuys", "PopUpText", "chooseAmountText", "buttonColor"];
28
+ var _excluded = ["data", "donateLink", "otherAmountText", "clientID", "cartID", "mbshipID", "noMoneyBuys", "PopUpText", "chooseAmountText", "submitButtonColor"];
29
29
 
30
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
31
 
@@ -43,7 +43,7 @@ var Signup = function Signup(_ref) {
43
43
  noMoneyBuys = _ref.noMoneyBuys,
44
44
  PopUpText = _ref.PopUpText,
45
45
  chooseAmountText = _ref.chooseAmountText,
46
- buttonColor = _ref.buttonColor,
46
+ submitButtonColor = _ref.submitButtonColor,
47
47
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
48
48
 
49
49
  var _useState = (0, _react.useState)('single'),
@@ -186,12 +186,12 @@ var Signup = function Signup(_ref) {
186
186
  type: "submit",
187
187
  as: "input",
188
188
  value: "Donate",
189
- buttonColor: buttonColor
189
+ color: submitButtonColor
190
190
  }) : /*#__PURE__*/_react.default.createElement(_Donate.Button, {
191
191
  type: "submit",
192
192
  as: "input",
193
193
  value: givingType === 'single' ? 'Donate now' : 'Donate monthly',
194
- buttonColor: buttonColor
194
+ color: submitButtonColor
195
195
  }))));
196
196
  };
197
197
 
@@ -835,6 +835,7 @@ exports[`Monthly donation renders correctly 1`] = `
835
835
  </div>
836
836
  <input
837
837
  className="c28"
838
+ color="red"
838
839
  type="submit"
839
840
  value="Donate now"
840
841
  />
@@ -1546,6 +1547,7 @@ exports[`Single donation renders correctly 1`] = `
1546
1547
  </p>
1547
1548
  <input
1548
1549
  className="c24"
1550
+ color="red"
1549
1551
  type="submit"
1550
1552
  value="Donate now"
1551
1553
  />
@@ -2004,6 +2006,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
2004
2006
  </div>
2005
2007
  <input
2006
2008
  className="c18"
2009
+ color="red"
2007
2010
  type="submit"
2008
2011
  value="Donate"
2009
2012
  />
@@ -21,18 +21,22 @@ var _SocialIcons = _interopRequireDefault(require("../../Atoms/SocialIcons/Socia
21
21
 
22
22
  var _Footer = require("./Footer.style");
23
23
 
24
- var _excluded = ["navItems", "footerCopy", "campaign"];
24
+ var _excluded = ["navItems", "footerCopy", "campaign", "additionalLegalLine"];
25
25
 
26
26
  var Footer = function Footer(_ref) {
27
27
  var navItems = _ref.navItems,
28
28
  footerCopy = _ref.footerCopy,
29
29
  campaign = _ref.campaign,
30
+ additionalLegalLine = _ref.additionalLegalLine,
30
31
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
31
32
  // Remove white space between words
32
33
  var campaignName = campaign.replace(/\s/g, '').toLowerCase();
33
34
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Footer.FooterWrapper, Object.assign({
34
35
  navItems: true
35
- }, rest), /*#__PURE__*/_react.default.createElement(_Footer.InnerWrapper, null, /*#__PURE__*/_react.default.createElement(_Footer.FooterBranding, null, /*#__PURE__*/_react.default.createElement(_Footer.SocialIconWrapper, null, /*#__PURE__*/_react.default.createElement(_SocialIcons.default, {
36
+ }, rest), /*#__PURE__*/_react.default.createElement(_Footer.InnerWrapper, null, additionalLegalLine && /*#__PURE__*/_react.default.createElement(_Footer.FooterLegalLine, {
37
+ tag: "p",
38
+ color: "grey"
39
+ }, additionalLegalLine), /*#__PURE__*/_react.default.createElement(_Footer.FooterBranding, null, /*#__PURE__*/_react.default.createElement(_Footer.SocialIconWrapper, null, /*#__PURE__*/_react.default.createElement(_SocialIcons.default, {
36
40
  campaign: campaignName
37
41
  })), /*#__PURE__*/_react.default.createElement(_Footer.Brand, {
38
42
  href: "/",
@@ -54,7 +58,8 @@ Footer.defaultProps = {
54
58
  navItems: {},
55
59
  footerCopy: '',
56
60
  campaign: 'Comic Relief',
57
- overrideWhiteList: false
61
+ overrideWhiteList: false,
62
+ additionalLegalLine: ''
58
63
  };
59
64
  var _default = Footer;
60
65
  exports.default = _default;
@@ -9,7 +9,19 @@ import footerCopy from './data/footerCopy';
9
9
  <Footer navItems={data} footerCopy={footerCopy.copy} campaign="Comic Relief" />
10
10
 
11
11
  <p>Overrides whitelist functionality for external usage</p>
12
- <Footer navItems={data} footerCopy={footerCopy.copy} campaign="Comic Relief" overrideWhiteList />
12
+ <Footer
13
+ navItems={data}
14
+ footerCopy={footerCopy.copy}
15
+ campaign="Comic Relief"
16
+ overrideWhiteList
17
+ />
18
+
19
+ <p>Adding a additionalLegalLine to the top of the footer</p>
20
+ <Footer
21
+ additionalLegalLine="MR. MEN ™ LITTLE MISS ™ © 2022 THOIP (a SANRIO Company). All rights reserved."
22
+ navItems={data}
23
+ footerCopy={footerCopy.copy}
24
+ campaign="Comic Relief"
25
+ />
13
26
  </>
14
-
15
27
  ```
@@ -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.Brand = exports.SocialIconWrapper = exports.FooterBranding = exports.FooterCopyright = exports.InnerWrapper = exports.Angle = exports.FooterWrapper = void 0;
8
+ exports.Brand = exports.SocialIconWrapper = exports.FooterBranding = exports.FooterCopyright = exports.FooterLegalLine = exports.InnerWrapper = exports.Angle = exports.FooterWrapper = void 0;
9
9
 
10
10
  var _styledComponents = _interopRequireDefault(require("styled-components"));
11
11
 
@@ -13,6 +13,8 @@ var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
13
13
 
14
14
  var _Link = _interopRequireDefault(require("../../Atoms/Link/Link"));
15
15
 
16
+ var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
17
+
16
18
  var FooterWrapper = _styledComponents.default.footer.attrs(function () {
17
19
  return {
18
20
  role: 'banner'
@@ -46,17 +48,22 @@ var InnerWrapper = _styledComponents.default.div.withConfig({
46
48
  }, (0, _spacing.default)('md'), (0, _spacing.default)('xl'));
47
49
 
48
50
  exports.InnerWrapper = InnerWrapper;
51
+ var FooterLegalLine = (0, _styledComponents.default)(_Text.default).withConfig({
52
+ displayName: "Footerstyle__FooterLegalLine",
53
+ componentId: "sc-167xaf5-3"
54
+ })(["text-align:left;margin-top:1rem;"]);
55
+ exports.FooterLegalLine = FooterLegalLine;
49
56
 
50
57
  var FooterBranding = _styledComponents.default.div.withConfig({
51
58
  displayName: "Footerstyle__FooterBranding",
52
- componentId: "sc-167xaf5-3"
59
+ componentId: "sc-167xaf5-4"
53
60
  })(["display:flex;margin:", " 0 5rem;justify-content:space-between;align-items:center;"], (0, _spacing.default)('lg'));
54
61
 
55
62
  exports.FooterBranding = FooterBranding;
56
63
 
57
64
  var FooterCopyright = _styledComponents.default.div.withConfig({
58
65
  displayName: "Footerstyle__FooterCopyright",
59
- componentId: "sc-167xaf5-4"
66
+ componentId: "sc-167xaf5-5"
60
67
  })(["display:block;width:100%;height:100%;text-align:left;margin-top:", ";p{font-size:15px;line-height:24px;margin-bottom:5px;@media ", "{font-size:16px;line-height:27px;}}"], (0, _spacing.default)('lg'), function (_ref4) {
61
68
  var theme = _ref4.theme;
62
69
  return theme.breakpoint('medium');
@@ -65,13 +72,13 @@ var FooterCopyright = _styledComponents.default.div.withConfig({
65
72
  exports.FooterCopyright = FooterCopyright;
66
73
  var Brand = (0, _styledComponents.default)(_Link.default).withConfig({
67
74
  displayName: "Footerstyle__Brand",
68
- componentId: "sc-167xaf5-5"
75
+ componentId: "sc-167xaf5-6"
69
76
  })(["color:transparent;border:0;:hover{border:0;}"]);
70
77
  exports.Brand = Brand;
71
78
 
72
79
  var SocialIconWrapper = _styledComponents.default.div.withConfig({
73
80
  displayName: "Footerstyle__SocialIconWrapper",
74
- componentId: "sc-167xaf5-6"
81
+ componentId: "sc-167xaf5-7"
75
82
  })([""]);
76
83
 
77
84
  exports.SocialIconWrapper = SocialIconWrapper;
@@ -558,11 +558,12 @@ exports[`renders correctly 1`] = `
558
558
  <div
559
559
  className="c1"
560
560
  >
561
+
561
562
  <div
562
563
  className="c2"
563
564
  >
564
565
  <div
565
- className="Footerstyle__SocialIconWrapper-sc-167xaf5-6"
566
+ className="Footerstyle__SocialIconWrapper-sc-167xaf5-7"
566
567
  >
567
568
  <ul
568
569
  className="c3"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comicrelief/component-library",
3
3
  "author": "Comic Relief Engineering Team",
4
- "version": "7.5.0",
4
+ "version": "7.7.0",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -47,22 +47,17 @@ export const BaseText = styled.span`
47
47
  const Text = ({
48
48
  tag, children, height, weight, family, ...rest
49
49
  }) => (
50
- <BaseText {...rest} as={tag} height={height} weight={weight} family={family}>
50
+ <BaseText
51
+ {...rest}
52
+ as={tag}
53
+ height={height}
54
+ weight={weight}
55
+ family={family}
56
+ >
51
57
  {children}
52
58
  </BaseText>
53
59
  );
54
60
 
55
- Text.defaultProps = {
56
- family: null,
57
- tag: 'span',
58
- weight: undefined,
59
- height: undefined,
60
- uppercase: false,
61
- size: 's',
62
- color: 'inherit',
63
- children: undefined
64
- };
65
-
66
61
  Text.propTypes = {
67
62
  /** Font family */
68
63
  family: PropTypes.string,
@@ -85,4 +80,15 @@ Text.propTypes = {
85
80
  ])
86
81
  };
87
82
 
83
+ Text.defaultProps = {
84
+ family: null,
85
+ tag: 'span',
86
+ weight: undefined,
87
+ height: undefined,
88
+ uppercase: false,
89
+ size: 's',
90
+ color: 'inherit',
91
+ children: undefined
92
+ };
93
+
88
94
  export default Text;
@@ -18,9 +18,9 @@ const Donate = ({
18
18
  alt,
19
19
  cartID,
20
20
  clientID,
21
- overlayColor,
22
- backgroundColor,
23
- buttonColor,
21
+ desktopOverlayColor,
22
+ mobileBackgroundColor,
23
+ submitButtonColor,
24
24
  textColor,
25
25
  donateLink,
26
26
  data,
@@ -56,14 +56,14 @@ const Donate = ({
56
56
 
57
57
  return (
58
58
  <Container
59
- backgroundColor={backgroundColor}
60
- overlayColor={overlayColor}
59
+ mobileBackgroundColor={mobileBackgroundColor}
60
+ desktopOverlayColor={desktopOverlayColor}
61
61
  id={mbshipID}
62
62
  key={overrideValue}
63
63
  >
64
64
  {!isDesktop && mobileImages ? (
65
65
  <Picture
66
- backgroundColor={backgroundColor}
66
+ backgroundColor={mobileBackgroundColor}
67
67
  image={mobileImage}
68
68
  images={mobileImages}
69
69
  imageLow={mobileImageLow}
@@ -76,7 +76,7 @@ const Donate = ({
76
76
 
77
77
  {isDesktop && images ? (
78
78
  <BgImage
79
- backgroundColor={overlayColor}
79
+ backgroundColor={desktopOverlayColor}
80
80
  image={image}
81
81
  images={images}
82
82
  imageLow={imageLow}
@@ -121,7 +121,7 @@ const Donate = ({
121
121
  noMoneyBuys={noMoneyBuys}
122
122
  PopUpText={PopUpText}
123
123
  chooseAmountText={chooseAmountText}
124
- buttonColor={buttonColor}
124
+ submitButtonColor={submitButtonColor}
125
125
  />
126
126
  </Wrapper>
127
127
  </Container>
@@ -145,9 +145,9 @@ Donate.propTypes = {
145
145
  mobileImage: PropTypes.string,
146
146
  mobileImages: PropTypes.string,
147
147
  mobileAlt: PropTypes.string,
148
- backgroundColor: PropTypes.string,
149
- overlayColor: PropTypes.string,
150
- buttonColor: PropTypes.string,
148
+ mobileBackgroundColor: PropTypes.string,
149
+ desktopOverlayColor: PropTypes.string,
150
+ submitButtonColor: PropTypes.string,
151
151
  textColor: PropTypes.string,
152
152
  mbshipID: PropTypes.string,
153
153
  noMoneyBuys: PropTypes.bool,
@@ -167,9 +167,9 @@ Donate.defaultProps = {
167
167
  mobileImage: null,
168
168
  mobileImages: null,
169
169
  mobileAlt: '',
170
- overlayColor: 'transparent',
171
- backgroundColor: 'blue_dark',
172
- buttonColor: 'red',
170
+ desktopOverlayColor: 'transparent',
171
+ mobileBackgroundColor: 'blue_dark',
172
+ submitButtonColor: 'red',
173
173
  textColor: 'white',
174
174
  mbshipID: null,
175
175
  otherAmountText:
@@ -1,6 +1,6 @@
1
1
  # Donate
2
2
 
3
- ## Form align right, with red desktop overlay and purple mobile background colour
3
+ ## Form align right, with red desktop overlay and purple mobile background colour, with a blue submit button
4
4
 
5
5
  ```js
6
6
  import data from './dev-data/data';
@@ -9,8 +9,9 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
9
9
 
10
10
  <Donate
11
11
  alt="Background image"
12
- backgroundColor="deep_violet_dark"
13
- overlayColor="red"
12
+ mobileBackgroundColor="deep_violet_dark"
13
+ desktopOverlayColor="red"
14
+ submitButtonColor="blue_dark"
14
15
  formAlignRight={true}
15
16
  imageLow={desktopPictures.imageLow}
16
17
  images={desktopPictures.images}
@@ -34,8 +35,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
34
35
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
35
36
 
36
37
  <Donate
37
- backgroundColor="blue_dark"
38
- overlayColor="blue_dark"
38
+ mobileBackgroundColor="blue_dark"
39
+ desktopOverlayColor="blue_dark"
39
40
  formAlignRight={false}
40
41
  imageLow={desktopPictures.imageLow}
41
42
  images={desktopPictures.images}
@@ -60,8 +61,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
60
61
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
61
62
 
62
63
  <Donate
63
- backgroundColor="blue_dark"
64
- overlayColor="blue_dark"
64
+ mobileBackgroundColor="blue_dark"
65
+ desktopOverlayColor="blue_dark"
65
66
  formAlignRight={false}
66
67
  imageLow={desktopPictures.imageLow}
67
68
  images={desktopPictures.images}
@@ -85,8 +86,8 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
85
86
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
86
87
 
87
88
  <Donate
88
- backgroundColor="blue_dark"
89
- overlayColor="blue_dark"
89
+ mobileBackgroundColor="blue_dark"
90
+ desktopOverlayColor="blue_dark"
90
91
  formAlignRight={false}
91
92
  imageLow={desktopPictures.imageLow}
92
93
  images={desktopPictures.images}
@@ -112,8 +113,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
112
113
 
113
114
  <Donate
114
115
  alt="Background image"
115
- backgroundColor="transparent"
116
- overlayColor="transparent"
116
+ mobileBackgroundColor="transparent"
117
+ desktopOverlayColor="transparent"
117
118
  formAlignRight={true}
118
119
  imageLow={desktopPictures.imageLow}
119
120
  images={desktopPictures.images}
@@ -137,7 +138,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
137
138
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
138
139
 
139
140
  <Donate
140
- backgroundColor="transparent"
141
+ mobileBackgroundColor="transparent"
141
142
  formAlignRight={false}
142
143
  imageLow={desktopPictures.imageLow}
143
144
  images={desktopPictures.images}
@@ -161,7 +162,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
161
162
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
162
163
 
163
164
  <Donate
164
- backgroundColor="blue_dark"
165
+ mobileBackgroundColor="blue_dark"
165
166
  formAlignRight={false}
166
167
  imageLow={desktopPictures.imageLow}
167
168
  images={desktopPictures.images}
@@ -185,7 +186,7 @@ const mobilePictures = require('../../../styleguide/data/data').mobileImages;
185
186
  const desktopPictures = require('../../../styleguide/data/data').defaultData;
186
187
 
187
188
  <Donate
188
- backgroundColor="blue_dark"
189
+ mobileBackgroundColor="blue_dark"
189
190
  formAlignRight={false}
190
191
  imageLow={desktopPictures.imageLow}
191
192
  images={desktopPictures.images}
@@ -208,8 +209,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
208
209
  import data from './dev-data/data-single';
209
210
 
210
211
  <Donate
211
- overlayColor="blue_dark"
212
- backgroundColor="blue_dark"
212
+ desktopOverlayColor="blue_dark"
213
+ mobileBackgroundColor="blue_dark"
213
214
  formAlignRight={false}
214
215
  data={data}
215
216
  mbshipID="mship-9"
@@ -232,8 +233,8 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
232
233
 
233
234
  <Donate
234
235
  alt="Background image"
235
- backgroundColor="red"
236
- overlayColor="red"
236
+ mobileBackgroundColor="red"
237
+ desktopOverlayColor="red"
237
238
  formAlignRight={true}
238
239
  imageLow={desktopPictures.imageLow}
239
240
  images={desktopPictures.images}
@@ -14,12 +14,12 @@ const Container = styled.div`
14
14
  flex-direction: column;
15
15
  justify-content: center;
16
16
  height: auto;
17
- background-color: ${({ theme, backgroundColor }) => theme.color(backgroundColor)};
17
+ background-color: ${({ theme, mobileBackgroundColor }) => theme.color(mobileBackgroundColor)};
18
18
  ${media('medium')} {
19
19
  flex-direction: row;
20
20
  align-items: center;
21
21
  justify-content: inherit;
22
- background-color: ${({ theme, overlayColor }) => theme.color(overlayColor)};
22
+ background-color: ${({ theme, desktopOverlayColor }) => theme.color(desktopOverlayColor)};
23
23
  }
24
24
  `;
25
25
 
@@ -215,7 +215,7 @@ const Button = styled.button`
215
215
  font-weight: bold;
216
216
  cursor: pointer;
217
217
  min-height: 48px;
218
- background: ${({ theme, buttonColor }) => theme.color(buttonColor)};
218
+ background: ${({ theme, color }) => theme.color(color)};
219
219
  text-decoration: none;
220
220
  border-radius: 2rem;
221
221
  border: none;
@@ -33,7 +33,7 @@ const Signup = ({
33
33
  noMoneyBuys,
34
34
  PopUpText,
35
35
  chooseAmountText,
36
- buttonColor,
36
+ submitButtonColor,
37
37
  ...rest
38
38
  }) => {
39
39
  const [givingType, setGivingType] = useState('single');
@@ -212,13 +212,13 @@ const Signup = ({
212
212
  )}
213
213
 
214
214
  {noMoneyBuys ? (
215
- <Button type="submit" as="input" value="Donate" buttonColor={buttonColor} />
215
+ <Button type="submit" as="input" value="Donate" color={submitButtonColor} />
216
216
  ) : (
217
217
  <Button
218
218
  type="submit"
219
219
  as="input"
220
220
  value={givingType === 'single' ? 'Donate now' : 'Donate monthly'}
221
- buttonColor={buttonColor}
221
+ color={submitButtonColor}
222
222
  />
223
223
  )}
224
224
 
@@ -238,7 +238,7 @@ Signup.propTypes = {
238
238
  data: PropTypes.objectOf(PropTypes.shape),
239
239
  PopUpText: PropTypes.string.isRequired,
240
240
  chooseAmountText: PropTypes.string.isRequired,
241
- buttonColor: PropTypes.string.isRequired
241
+ submitButtonColor: PropTypes.string.isRequired
242
242
  };
243
243
 
244
244
  Signup.defaultProps = {
@@ -835,6 +835,7 @@ exports[`Monthly donation renders correctly 1`] = `
835
835
  </div>
836
836
  <input
837
837
  className="c28"
838
+ color="red"
838
839
  type="submit"
839
840
  value="Donate now"
840
841
  />
@@ -1546,6 +1547,7 @@ exports[`Single donation renders correctly 1`] = `
1546
1547
  </p>
1547
1548
  <input
1548
1549
  className="c24"
1550
+ color="red"
1549
1551
  type="submit"
1550
1552
  value="Donate now"
1551
1553
  />
@@ -2004,6 +2006,7 @@ exports[`Single donation with no Money Buys renders correctly 1`] = `
2004
2006
  </div>
2005
2007
  <input
2006
2008
  className="c18"
2009
+ color="red"
2007
2010
  type="submit"
2008
2011
  value="Donate"
2009
2012
  />
@@ -8,6 +8,7 @@ import SocialIcons from '../../Atoms/SocialIcons/SocialIcons';
8
8
  import {
9
9
  FooterWrapper,
10
10
  InnerWrapper,
11
+ FooterLegalLine,
11
12
  FooterBranding,
12
13
  FooterCopyright,
13
14
  SocialIconWrapper,
@@ -15,14 +16,18 @@ import {
15
16
  } from './Footer.style';
16
17
 
17
18
  const Footer = ({
18
- navItems, footerCopy, campaign, ...rest
19
+ navItems, footerCopy, campaign, additionalLegalLine, ...rest
19
20
  }) => {
20
21
  // Remove white space between words
21
22
  const campaignName = campaign.replace(/\s/g, '').toLowerCase();
23
+
22
24
  return (
23
25
  <div>
24
26
  <FooterWrapper navItems {...rest}>
25
27
  <InnerWrapper>
28
+ {additionalLegalLine
29
+ && <FooterLegalLine tag="p" color="grey">{additionalLegalLine}</FooterLegalLine>
30
+ }
26
31
  <FooterBranding>
27
32
  <SocialIconWrapper>
28
33
  <SocialIcons campaign={campaignName} />
@@ -47,14 +52,16 @@ Footer.propTypes = {
47
52
  navItems: PropTypes.objectOf(PropTypes.shape),
48
53
  footerCopy: PropTypes.string,
49
54
  campaign: PropTypes.string,
50
- overrideWhiteList: PropTypes.bool
55
+ overrideWhiteList: PropTypes.bool,
56
+ additionalLegalLine: PropTypes.string
51
57
  };
52
58
 
53
59
  Footer.defaultProps = {
54
60
  navItems: {},
55
61
  footerCopy: '',
56
62
  campaign: 'Comic Relief',
57
- overrideWhiteList: false
63
+ overrideWhiteList: false,
64
+ additionalLegalLine: ''
58
65
  };
59
66
 
60
67
  export default Footer;
@@ -9,7 +9,19 @@ import footerCopy from './data/footerCopy';
9
9
  <Footer navItems={data} footerCopy={footerCopy.copy} campaign="Comic Relief" />
10
10
 
11
11
  <p>Overrides whitelist functionality for external usage</p>
12
- <Footer navItems={data} footerCopy={footerCopy.copy} campaign="Comic Relief" overrideWhiteList />
12
+ <Footer
13
+ navItems={data}
14
+ footerCopy={footerCopy.copy}
15
+ campaign="Comic Relief"
16
+ overrideWhiteList
17
+ />
18
+
19
+ <p>Adding a additionalLegalLine to the top of the footer</p>
20
+ <Footer
21
+ additionalLegalLine="MR. MEN ™ LITTLE MISS ™ © 2022 THOIP (a SANRIO Company). All rights reserved."
22
+ navItems={data}
23
+ footerCopy={footerCopy.copy}
24
+ campaign="Comic Relief"
25
+ />
13
26
  </>
14
-
15
27
  ```
@@ -1,6 +1,7 @@
1
1
  import styled from 'styled-components';
2
2
  import spacing from '../../../theme/shared/spacing';
3
3
  import Link from '../../Atoms/Link/Link';
4
+ import Text from '../../Atoms/Text/Text';
4
5
 
5
6
  const FooterWrapper = styled.footer.attrs(() => ({
6
7
  role: 'banner'
@@ -41,6 +42,11 @@ const InnerWrapper = styled.div`
41
42
  }
42
43
  `;
43
44
 
45
+ const FooterLegalLine = styled(Text)`
46
+ text-align: left;
47
+ margin-top: 1rem;
48
+ `;
49
+
44
50
  const FooterBranding = styled.div`
45
51
  display: flex;
46
52
  margin: ${spacing('lg')} 0 5rem;
@@ -81,6 +87,7 @@ export {
81
87
  FooterWrapper,
82
88
  Angle,
83
89
  InnerWrapper,
90
+ FooterLegalLine,
84
91
  FooterCopyright,
85
92
  FooterBranding,
86
93
  SocialIconWrapper,
@@ -558,11 +558,12 @@ exports[`renders correctly 1`] = `
558
558
  <div
559
559
  className="c1"
560
560
  >
561
+
561
562
  <div
562
563
  className="c2"
563
564
  >
564
565
  <div
565
- className="Footerstyle__SocialIconWrapper-sc-167xaf5-6"
566
+ className="Footerstyle__SocialIconWrapper-sc-167xaf5-7"
566
567
  >
567
568
  <ul
568
569
  className="c3"