@comicrelief/component-library 7.31.1 → 7.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Molecules/SingleMessage/SingleMessage.js +6 -3
- package/dist/components/Molecules/SingleMessage/SingleMessage.md +53 -0
- package/dist/components/Molecules/SingleMessage/SingleMessage.style.js +44 -38
- package/dist/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +32 -0
- package/dist/components/Organisms/Donate/Donate.js +5 -2
- package/dist/components/Organisms/Donate/Donate.md +6 -3
- package/dist/components/Organisms/Donate/Donate.style.js +32 -26
- package/dist/utils/_utils.js +23 -0
- package/package.json +1 -1
- package/src/components/Molecules/SingleMessage/SingleMessage.js +7 -3
- package/src/components/Molecules/SingleMessage/SingleMessage.md +53 -0
- package/src/components/Molecules/SingleMessage/SingleMessage.style.js +10 -7
- package/src/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +32 -0
- package/src/components/Organisms/Donate/Donate.js +6 -3
- package/src/components/Organisms/Donate/Donate.md +6 -3
- package/src/components/Organisms/Donate/Donate.style.js +3 -0
- package/src/utils/_utils.js +18 -0
|
@@ -29,7 +29,8 @@ const SingleMessage = _ref => {
|
|
|
29
29
|
fullImage,
|
|
30
30
|
vhFull,
|
|
31
31
|
videoID,
|
|
32
|
-
landscapeVideo
|
|
32
|
+
landscapeVideo,
|
|
33
|
+
paddingOption
|
|
33
34
|
} = _ref;
|
|
34
35
|
const hasImage = imageSet || false;
|
|
35
36
|
const doubleImage = (imageSet || image) && (imageSet2 || image2);
|
|
@@ -166,7 +167,8 @@ const SingleMessage = _ref => {
|
|
|
166
167
|
hasImage: hasImage,
|
|
167
168
|
copyFirst: copyFirst,
|
|
168
169
|
hasVideo: hasVideo,
|
|
169
|
-
vhFull: vhFull
|
|
170
|
+
vhFull: vhFull,
|
|
171
|
+
paddingOption: paddingOption
|
|
170
172
|
}, children) : null))
|
|
171
173
|
);
|
|
172
174
|
};
|
|
@@ -184,6 +186,7 @@ SingleMessage.defaultProps = {
|
|
|
184
186
|
children: null,
|
|
185
187
|
vhFull: false,
|
|
186
188
|
videoID: null,
|
|
187
|
-
landscapeVideo: false
|
|
189
|
+
landscapeVideo: false,
|
|
190
|
+
paddingOption: null
|
|
188
191
|
};
|
|
189
192
|
var _default = exports.default = SingleMessage;
|
|
@@ -84,6 +84,59 @@ import Text from '../../Atoms/Text/Text';
|
|
|
84
84
|
</SingleMessage>;
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
Single Message with no Image - padding unmodified
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
import Text from '../../Atoms/Text/Text';
|
|
91
|
+
|
|
92
|
+
<SingleMessage backgroundColor="purple_dark" copyFirst={false} paddingOption="both_on">
|
|
93
|
+
<Text tag="p" color="white" size="xxl">
|
|
94
|
+
“The creativity that goes into helping people have a better life is
|
|
95
|
+
extraordinary.”
|
|
96
|
+
</Text>
|
|
97
|
+
</SingleMessage>;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Single Message with no Image - no bottom padding
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
import Text from '../../Atoms/Text/Text';
|
|
104
|
+
|
|
105
|
+
<SingleMessage backgroundColor="purple_dark" copyFirst={false} paddingOption="lower_off">
|
|
106
|
+
<Text tag="p" color="white" size="xxl">
|
|
107
|
+
“The creativity that goes into helping people have a better life is
|
|
108
|
+
extraordinary.”
|
|
109
|
+
</Text>
|
|
110
|
+
</SingleMessage>;
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
Single Message with no Image - no top padding
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
import Text from '../../Atoms/Text/Text';
|
|
118
|
+
|
|
119
|
+
<SingleMessage backgroundColor="purple_dark" copyFirst={false} paddingOption="upper_off">
|
|
120
|
+
<Text tag="p" color="white" size="xxl">
|
|
121
|
+
“The creativity that goes into helping people have a better life is
|
|
122
|
+
extraordinary.”
|
|
123
|
+
</Text>
|
|
124
|
+
</SingleMessage>;
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Single Message with no Image - no top and bottom padding
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
import Text from '../../Atoms/Text/Text';
|
|
131
|
+
|
|
132
|
+
<SingleMessage backgroundColor="purple_dark" copyFirst={false} paddingOption="both_off">
|
|
133
|
+
<Text tag="p" color="white" size="xxl">
|
|
134
|
+
“The creativity that goes into helping people have a better life is
|
|
135
|
+
extraordinary.”
|
|
136
|
+
</Text>
|
|
137
|
+
</SingleMessage>;
|
|
138
|
+
```
|
|
139
|
+
|
|
87
140
|
Single Message vertical height 100%
|
|
88
141
|
|
|
89
142
|
```js
|
|
@@ -13,6 +13,7 @@ var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
|
13
13
|
var _videoPlayIcon = _interopRequireDefault(require("./assets/video--play-icon.svg"));
|
|
14
14
|
var _videoPlayIcon__hover = _interopRequireDefault(require("./assets/video--play-icon__hover.svg"));
|
|
15
15
|
var _loader = _interopRequireDefault(require("./assets/loader.svg"));
|
|
16
|
+
var _utils = _interopRequireDefault(require("../../../utils/_utils"));
|
|
16
17
|
const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
17
18
|
displayName: "SingleMessagestyle__Container",
|
|
18
19
|
componentId: "sc-86zg20-0"
|
|
@@ -48,7 +49,7 @@ const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
|
48
49
|
const Copy = exports.Copy = _styledComponents.default.div.withConfig({
|
|
49
50
|
displayName: "SingleMessagestyle__Copy",
|
|
50
51
|
componentId: "sc-86zg20-1"
|
|
51
|
-
})(["width:100%;", ";", ";padding:", ";", "{", ";", ";flex-direction:column;justify-content:center;padding:", ";}", ";", ";"], (0, _zIndex.default)('low'), _ref6 => {
|
|
52
|
+
})(["width:100%;", ";", ";padding:", ";", "{", ";", ";flex-direction:column;justify-content:center;padding:", ";}", ";", ";", "{", ";}"], (0, _zIndex.default)('low'), _ref6 => {
|
|
52
53
|
let {
|
|
53
54
|
hasVideo,
|
|
54
55
|
fullImage
|
|
@@ -76,113 +77,118 @@ const Copy = exports.Copy = _styledComponents.default.div.withConfig({
|
|
|
76
77
|
theme
|
|
77
78
|
} = _ref10;
|
|
78
79
|
return theme.breakpoint('small');
|
|
79
|
-
}, _size.container.small, (0, _spacing.default)('xl'), (0, _spacing.default)('md')))
|
|
80
|
+
}, _size.container.small, (0, _spacing.default)('xl'), (0, _spacing.default)('md')), (0, _size.media)('medium'), _ref11 => {
|
|
81
|
+
let {
|
|
82
|
+
paddingOption
|
|
83
|
+
} = _ref11;
|
|
84
|
+
return (0, _utils.default)(paddingOption);
|
|
85
|
+
});
|
|
80
86
|
const Media = exports.Media = _styledComponents.default.div.withConfig({
|
|
81
87
|
displayName: "SingleMessagestyle__Media",
|
|
82
88
|
componentId: "sc-86zg20-2"
|
|
83
|
-
})(["width:100%;", ";@media ", "{height:auto;width:", ";", ";", ";}position:relative;", ";", ";", "{padding-bottom:", ";}"],
|
|
89
|
+
})(["width:100%;", ";@media ", "{height:auto;width:", ";", ";", ";}position:relative;", ";", ";", "{padding-bottom:", ";}"], _ref12 => {
|
|
84
90
|
let {
|
|
85
91
|
fullImage
|
|
86
|
-
} =
|
|
92
|
+
} = _ref12;
|
|
87
93
|
return fullImage ? 'height: 200px;' : 'height: 280px;';
|
|
88
|
-
},
|
|
94
|
+
}, _ref13 => {
|
|
89
95
|
let {
|
|
90
96
|
theme
|
|
91
|
-
} =
|
|
97
|
+
} = _ref13;
|
|
92
98
|
return theme.breakpoint('small');
|
|
93
|
-
},
|
|
99
|
+
}, _ref14 => {
|
|
94
100
|
let {
|
|
95
101
|
fullImage
|
|
96
|
-
} =
|
|
102
|
+
} = _ref14;
|
|
97
103
|
return fullImage ? '100%' : '50%';
|
|
98
|
-
},
|
|
104
|
+
}, _ref15 => {
|
|
99
105
|
let {
|
|
100
106
|
fullImage
|
|
101
|
-
} =
|
|
107
|
+
} = _ref15;
|
|
102
108
|
return fullImage ? 'min-height: 500px;' : null;
|
|
103
|
-
},
|
|
109
|
+
}, _ref16 => {
|
|
104
110
|
let {
|
|
105
111
|
vhFull,
|
|
106
112
|
fullImage
|
|
107
|
-
} =
|
|
113
|
+
} = _ref16;
|
|
108
114
|
return vhFull && fullImage ? 'min-height: calc(100vh - 5.625rem);' : null;
|
|
109
|
-
},
|
|
115
|
+
}, _ref17 => {
|
|
110
116
|
let {
|
|
111
117
|
doubleImage
|
|
112
|
-
} =
|
|
118
|
+
} = _ref17;
|
|
113
119
|
return doubleImage && 'display: flex; flex-direction: column';
|
|
114
|
-
},
|
|
120
|
+
}, _ref18 => {
|
|
115
121
|
let {
|
|
116
122
|
hasVideo
|
|
117
|
-
} =
|
|
123
|
+
} = _ref18;
|
|
118
124
|
return hasVideo ? 'height: auto; overflow: hidden; padding-bottom: 56.25%;' : null;
|
|
119
|
-
}, (0, _size.media)('small'),
|
|
125
|
+
}, (0, _size.media)('small'), _ref19 => {
|
|
120
126
|
let {
|
|
121
127
|
landscapeVideo,
|
|
122
128
|
hasVideo
|
|
123
|
-
} =
|
|
129
|
+
} = _ref19;
|
|
124
130
|
return landscapeVideo && hasVideo ? 'calc(56.25% / 2);' : '0;';
|
|
125
131
|
});
|
|
126
132
|
const PlayButton = exports.PlayButton = _styledComponents.default.button.withConfig({
|
|
127
133
|
displayName: "SingleMessagestyle__PlayButton",
|
|
128
134
|
componentId: "sc-86zg20-3"
|
|
129
|
-
})(["", ";cursor:pointer;width:100%;height:100%;position:absolute;top:0;border:0;margin:0;padding:0;text-indent:-9999px;background:rgba(0,0,0,0) center no-repeat;background-size:70px;background-image:", ";", ";display:", ";&:focus,&:hover{background-image:", ";}", "{background-size:100px;}"], (0, _zIndex.default)('medium'),
|
|
135
|
+
})(["", ";cursor:pointer;width:100%;height:100%;position:absolute;top:0;border:0;margin:0;padding:0;text-indent:-9999px;background:rgba(0,0,0,0) center no-repeat;background-size:70px;background-image:", ";", ";display:", ";&:focus,&:hover{background-image:", ";}", "{background-size:100px;}"], (0, _zIndex.default)('medium'), _ref20 => {
|
|
130
136
|
let {
|
|
131
137
|
isBuffering
|
|
132
|
-
} =
|
|
138
|
+
} = _ref20;
|
|
133
139
|
return isBuffering === true ? "url(".concat(_loader.default, ")") : "url(".concat(_videoPlayIcon.default, ")");
|
|
134
|
-
},
|
|
140
|
+
}, _ref21 => {
|
|
135
141
|
let {
|
|
136
142
|
copyFirst
|
|
137
|
-
} =
|
|
143
|
+
} = _ref21;
|
|
138
144
|
return copyFirst === true ? 'left: auto; right: 0;' : 'left: 0; right: auto;';
|
|
139
|
-
},
|
|
145
|
+
}, _ref22 => {
|
|
140
146
|
let {
|
|
141
147
|
isPlaying
|
|
142
|
-
} =
|
|
148
|
+
} = _ref22;
|
|
143
149
|
return isPlaying ? 'none' : 'block';
|
|
144
|
-
},
|
|
150
|
+
}, _ref23 => {
|
|
145
151
|
let {
|
|
146
152
|
isBuffering
|
|
147
|
-
} =
|
|
153
|
+
} = _ref23;
|
|
148
154
|
return isBuffering === true ? "url(".concat(_loader.default, ")") : "url(".concat(_videoPlayIcon__hover.default, ")");
|
|
149
155
|
}, (0, _size.media)('small'));
|
|
150
156
|
const Image = exports.Image = _styledComponents.default.div.withConfig({
|
|
151
157
|
displayName: "SingleMessagestyle__Image",
|
|
152
158
|
componentId: "sc-86zg20-4"
|
|
153
|
-
})(["@media ", "{img{position:", ";}}width:100%;height:100%;", ";", ";", ";"],
|
|
159
|
+
})(["@media ", "{img{position:", ";}}width:100%;height:100%;", ";", ";", ";"], _ref24 => {
|
|
154
160
|
let {
|
|
155
161
|
theme
|
|
156
|
-
} =
|
|
162
|
+
} = _ref24;
|
|
157
163
|
return theme.breakpoint('small');
|
|
158
|
-
},
|
|
164
|
+
}, _ref25 => {
|
|
159
165
|
let {
|
|
160
166
|
fullImage,
|
|
161
167
|
vhFull
|
|
162
|
-
} =
|
|
168
|
+
} = _ref25;
|
|
163
169
|
return fullImage || vhFull ? 'absolute' : null;
|
|
164
|
-
},
|
|
170
|
+
}, _ref26 => {
|
|
165
171
|
let {
|
|
166
172
|
doubleImage
|
|
167
|
-
} =
|
|
173
|
+
} = _ref26;
|
|
168
174
|
return doubleImage && 'height: 50%';
|
|
169
|
-
},
|
|
175
|
+
}, _ref27 => {
|
|
170
176
|
let {
|
|
171
177
|
isPlaying
|
|
172
|
-
} =
|
|
178
|
+
} = _ref27;
|
|
173
179
|
return isPlaying ? (0, _zIndex.default)('base') : (0, _zIndex.default)('low');
|
|
174
|
-
},
|
|
180
|
+
}, _ref28 => {
|
|
175
181
|
let {
|
|
176
182
|
hasVideo
|
|
177
|
-
} =
|
|
183
|
+
} = _ref28;
|
|
178
184
|
return hasVideo ? 'position: absolute; top: 0; left: 0;' : null;
|
|
179
185
|
});
|
|
180
186
|
const VideoWrapper = exports.VideoWrapper = _styledComponents.default.div.withConfig({
|
|
181
187
|
displayName: "SingleMessagestyle__VideoWrapper",
|
|
182
188
|
componentId: "sc-86zg20-5"
|
|
183
|
-
})(["width:100%;height:100%;position:absolute;top:0;left:0;", ";"],
|
|
189
|
+
})(["width:100%;height:100%;position:absolute;top:0;left:0;", ";"], _ref29 => {
|
|
184
190
|
let {
|
|
185
191
|
isPlaying
|
|
186
|
-
} =
|
|
192
|
+
} = _ref29;
|
|
187
193
|
return isPlaying ? (0, _zIndex.default)('medium') : (0, _zIndex.default)('base');
|
|
188
194
|
});
|
|
@@ -104,6 +104,10 @@ exports[`renders Single Message with 100% vertical height image correctly 1`] =
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
@media (min-width:1024px) {
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
@media (min-width:740px) {
|
|
108
112
|
.c1 {
|
|
109
113
|
height: auto;
|
|
@@ -312,6 +316,10 @@ exports[`renders Single Message with Image correctly 1`] = `
|
|
|
312
316
|
}
|
|
313
317
|
}
|
|
314
318
|
|
|
319
|
+
@media (min-width:1024px) {
|
|
320
|
+
|
|
321
|
+
}
|
|
322
|
+
|
|
315
323
|
@media (min-width:740px) {
|
|
316
324
|
.c1 {
|
|
317
325
|
height: auto;
|
|
@@ -498,6 +506,10 @@ exports[`renders Single Message with double image correctly 1`] = `
|
|
|
498
506
|
}
|
|
499
507
|
}
|
|
500
508
|
|
|
509
|
+
@media (min-width:1024px) {
|
|
510
|
+
|
|
511
|
+
}
|
|
512
|
+
|
|
501
513
|
@media (min-width:740px) {
|
|
502
514
|
|
|
503
515
|
}
|
|
@@ -506,6 +518,10 @@ exports[`renders Single Message with double image correctly 1`] = `
|
|
|
506
518
|
|
|
507
519
|
}
|
|
508
520
|
|
|
521
|
+
@media (min-width:1024px) {
|
|
522
|
+
|
|
523
|
+
}
|
|
524
|
+
|
|
509
525
|
@media (min-width:740px) {
|
|
510
526
|
.c1 {
|
|
511
527
|
height: auto;
|
|
@@ -766,6 +782,10 @@ exports[`renders Single Message with full width correctly 1`] = `
|
|
|
766
782
|
}
|
|
767
783
|
}
|
|
768
784
|
|
|
785
|
+
@media (min-width:1024px) {
|
|
786
|
+
|
|
787
|
+
}
|
|
788
|
+
|
|
769
789
|
@media (min-width:740px) {
|
|
770
790
|
.c1 {
|
|
771
791
|
height: auto;
|
|
@@ -920,6 +940,10 @@ exports[`renders Single Message with full width image and no text correctly 1`]
|
|
|
920
940
|
|
|
921
941
|
}
|
|
922
942
|
|
|
943
|
+
@media (min-width:1024px) {
|
|
944
|
+
|
|
945
|
+
}
|
|
946
|
+
|
|
923
947
|
@media (min-width:740px) {
|
|
924
948
|
.c1 {
|
|
925
949
|
height: auto;
|
|
@@ -1052,6 +1076,10 @@ exports[`renders Single Message with no Image correctly 1`] = `
|
|
|
1052
1076
|
}
|
|
1053
1077
|
}
|
|
1054
1078
|
|
|
1079
|
+
@media (min-width:1024px) {
|
|
1080
|
+
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1055
1083
|
@media (min-width:740px) {
|
|
1056
1084
|
|
|
1057
1085
|
}
|
|
@@ -1060,6 +1088,10 @@ exports[`renders Single Message with no Image correctly 1`] = `
|
|
|
1060
1088
|
|
|
1061
1089
|
}
|
|
1062
1090
|
|
|
1091
|
+
@media (min-width:1024px) {
|
|
1092
|
+
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1063
1095
|
@media (min-width:740px) {
|
|
1064
1096
|
|
|
1065
1097
|
}
|
|
@@ -47,6 +47,7 @@ const Donate = _ref => {
|
|
|
47
47
|
defaultGivingType,
|
|
48
48
|
monthlyTitle,
|
|
49
49
|
monthlySubtitle,
|
|
50
|
+
paddingOption,
|
|
50
51
|
// Just to keep the function call character length under control
|
|
51
52
|
monthlyChooseAmountText: monthlyChoose,
|
|
52
53
|
monthlyOtherAmountText: monthlyOther
|
|
@@ -105,7 +106,8 @@ const Donate = _ref => {
|
|
|
105
106
|
}) : null, /*#__PURE__*/_react.default.createElement(_Donate.Wrapper, {
|
|
106
107
|
formAlignRight: formAlignRight,
|
|
107
108
|
"aria-live": "polite",
|
|
108
|
-
noTitlesAtAll: noTitlesAtAll
|
|
109
|
+
noTitlesAtAll: noTitlesAtAll,
|
|
110
|
+
paddingOption: paddingOption
|
|
109
111
|
}, !noTitlesAtAll && /*#__PURE__*/_react.default.createElement(_Donate.TitleWrapperOuter, {
|
|
110
112
|
formAlignRight: formAlignRight,
|
|
111
113
|
"data-test": "this-one-here"
|
|
@@ -169,6 +171,7 @@ Donate.defaultProps = {
|
|
|
169
171
|
monthlyTitle: '',
|
|
170
172
|
monthlySubtitle: '',
|
|
171
173
|
monthlyChooseAmountText: '',
|
|
172
|
-
monthlyOtherAmountText: ''
|
|
174
|
+
monthlyOtherAmountText: '',
|
|
175
|
+
paddingOption: null
|
|
173
176
|
};
|
|
174
177
|
var _default = exports.default = Donate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Donate
|
|
2
2
|
|
|
3
|
-
## Form align right, with red desktop overlay and purple mobile background colour, with a blue submit button
|
|
3
|
+
## Form align right, with red desktop overlay and purple mobile background colour, with a blue submit button and 'no top padding' option
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import data from './dev-data/data';
|
|
@@ -24,10 +24,11 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
24
24
|
cartID="default-comicrelief"
|
|
25
25
|
title="Donate Now"
|
|
26
26
|
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
27
|
+
paddingOption="upper_off"
|
|
27
28
|
/>;
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
## Form align left, with custom message after choosing an "Other amount" to donate, high value cart
|
|
31
|
+
## Form align left, with custom message after choosing an "Other amount" to donate, high value cart, and 'no bottom padding' option
|
|
31
32
|
```js
|
|
32
33
|
import data from './dev-data/data-high-value';
|
|
33
34
|
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
@@ -50,10 +51,11 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
50
51
|
title="Donate Now"
|
|
51
52
|
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
52
53
|
otherAmountText="Overridden via the 'Other amount text' prop"
|
|
54
|
+
paddingOption="lower_off"
|
|
53
55
|
/>;
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
## Single Giving
|
|
58
|
+
## Single Giving, with 'no padding' option
|
|
57
59
|
|
|
58
60
|
```js
|
|
59
61
|
import data from './dev-data/data-single';
|
|
@@ -76,6 +78,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
76
78
|
cartID="default-comicrelief"
|
|
77
79
|
title="Donate Now"
|
|
78
80
|
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
81
|
+
paddingOption="both_off"
|
|
79
82
|
/>;
|
|
80
83
|
```
|
|
81
84
|
|
|
@@ -13,6 +13,7 @@ var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
|
13
13
|
var _size = require("../../../theme/shared/size");
|
|
14
14
|
var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
15
15
|
var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
|
|
16
|
+
var _utils = _interopRequireDefault(require("../../../utils/_utils"));
|
|
16
17
|
const Container = exports.Container = _styledComponents.default.div.withConfig({
|
|
17
18
|
displayName: "Donatestyle__Container",
|
|
18
19
|
componentId: "sc-8rjm3t-0"
|
|
@@ -45,7 +46,7 @@ const BgImage = exports.BgImage = (0, _styledComponents.default)(_Picture.defaul
|
|
|
45
46
|
const Wrapper = exports.Wrapper = _styledComponents.default.div.withConfig({
|
|
46
47
|
displayName: "Donatestyle__Wrapper",
|
|
47
48
|
componentId: "sc-8rjm3t-3"
|
|
48
|
-
})(["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'), _ref4 => {
|
|
49
|
+
})(["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'), _ref4 => {
|
|
49
50
|
let {
|
|
50
51
|
formAlignRight
|
|
51
52
|
} = _ref4;
|
|
@@ -55,14 +56,19 @@ const Wrapper = exports.Wrapper = _styledComponents.default.div.withConfig({
|
|
|
55
56
|
noTitlesAtAll
|
|
56
57
|
} = _ref5;
|
|
57
58
|
return noTitlesAtAll === true && (0, _styledComponents.css)(["justify-content:center;"]);
|
|
58
|
-
}, (0, _size.media)('small'), (0, _spacing.default)('xl'), (0, _spacing.default)('md'), (0, _size.media)('medium'), (0, _spacing.default)('xl')
|
|
59
|
+
}, (0, _size.media)('small'), (0, _spacing.default)('xl'), (0, _spacing.default)('md'), (0, _size.media)('medium'), (0, _spacing.default)('xl'), _ref6 => {
|
|
60
|
+
let {
|
|
61
|
+
paddingOption
|
|
62
|
+
} = _ref6;
|
|
63
|
+
return (0, _utils.default)(paddingOption);
|
|
64
|
+
});
|
|
59
65
|
const TitleWrapperOuter = exports.TitleWrapperOuter = _styledComponents.default.div.withConfig({
|
|
60
66
|
displayName: "Donatestyle__TitleWrapperOuter",
|
|
61
67
|
componentId: "sc-8rjm3t-4"
|
|
62
|
-
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"],
|
|
68
|
+
})(["width:100%;display:flex;font-family:", ";", "{width:50%;padding:", ";align-items:center;}"], _ref7 => {
|
|
63
69
|
let {
|
|
64
70
|
theme
|
|
65
|
-
} =
|
|
71
|
+
} = _ref7;
|
|
66
72
|
return theme.fontFamilies(theme.font.regular);
|
|
67
73
|
}, (0, _size.media)('medium'), (0, _spacing.default)('xl'));
|
|
68
74
|
const TitleWrapperInner = exports.TitleWrapperInner = _styledComponents.default.div.withConfig({
|
|
@@ -72,33 +78,33 @@ const TitleWrapperInner = exports.TitleWrapperInner = _styledComponents.default.
|
|
|
72
78
|
const FormWrapper = exports.FormWrapper = _styledComponents.default.div.withConfig({
|
|
73
79
|
displayName: "Donatestyle__FormWrapper",
|
|
74
80
|
componentId: "sc-8rjm3t-6"
|
|
75
|
-
})(["position:relative;font-family:", ";", "{width:50%;}"],
|
|
81
|
+
})(["position:relative;font-family:", ";", "{width:50%;}"], _ref8 => {
|
|
76
82
|
let {
|
|
77
83
|
theme
|
|
78
|
-
} =
|
|
84
|
+
} = _ref8;
|
|
79
85
|
return theme.fontFamilies(theme.font.regular);
|
|
80
86
|
}, (0, _size.media)('medium'));
|
|
81
87
|
const Error = exports.Error = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
82
88
|
displayName: "Donatestyle__Error",
|
|
83
89
|
componentId: "sc-8rjm3t-7"
|
|
84
|
-
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"],
|
|
90
|
+
})(["color:", ";font-size:", ";font-weight:500;margin-top:", ";"], _ref9 => {
|
|
85
91
|
let {
|
|
86
92
|
theme
|
|
87
|
-
} =
|
|
93
|
+
} = _ref9;
|
|
88
94
|
return theme.color('red');
|
|
89
|
-
},
|
|
95
|
+
}, _ref10 => {
|
|
90
96
|
let {
|
|
91
97
|
theme
|
|
92
|
-
} =
|
|
98
|
+
} = _ref10;
|
|
93
99
|
return theme.fontSize('s');
|
|
94
100
|
}, (0, _spacing.default)('l'));
|
|
95
101
|
const Form = exports.Form = _styledComponents.default.form.withConfig({
|
|
96
102
|
displayName: "Donatestyle__Form",
|
|
97
103
|
componentId: "sc-8rjm3t-8"
|
|
98
|
-
})(["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;}"],
|
|
104
|
+
})(["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;}"], _ref11 => {
|
|
99
105
|
let {
|
|
100
106
|
theme
|
|
101
|
-
} =
|
|
107
|
+
} = _ref11;
|
|
102
108
|
return theme.color('white');
|
|
103
109
|
}, (0, _spacing.default)('md'), (0, _spacing.default)('md'), (0, _spacing.default)('l'), (0, _size.media)('small'));
|
|
104
110
|
const OuterFieldset = exports.OuterFieldset = _styledComponents.default.fieldset.withConfig({
|
|
@@ -124,20 +130,20 @@ const Label = exports.Label = (0, _styledComponents.default)(_Text.default).with
|
|
|
124
130
|
const AmountField = exports.AmountField = (0, _styledComponents.default)(_Input.default).withConfig({
|
|
125
131
|
displayName: "Donatestyle__AmountField",
|
|
126
132
|
componentId: "sc-8rjm3t-14"
|
|
127
|
-
})(["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'),
|
|
133
|
+
})(["position:relative;flex-basis:50%;flex-shrink:0;flex-grow:0;font-weight:400;display:block;", "{flex-basis:60%;}span{position:absolute;font-size:20px;top:50%;transform:translateY(-50%);left:0px;font-weight:500;padding:0px 15px;", ";}input{height:48px;border:2px solid ", ";background:", ";border-radius:10px;padding:", " ", " ", " ", ";&:focus{outline:none;border:2px solid ", ";}}"], (0, _size.media)('small'), (0, _zIndex.default)('high'), _ref12 => {
|
|
128
134
|
let {
|
|
129
135
|
theme
|
|
130
|
-
} =
|
|
136
|
+
} = _ref12;
|
|
131
137
|
return theme.color('grey');
|
|
132
|
-
},
|
|
138
|
+
}, _ref13 => {
|
|
133
139
|
let {
|
|
134
140
|
theme
|
|
135
|
-
} =
|
|
141
|
+
} = _ref13;
|
|
136
142
|
return theme.color('grey_light');
|
|
137
|
-
}, (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('sm'), (0, _spacing.default)('l'),
|
|
143
|
+
}, (0, _spacing.default)('sm'), (0, _spacing.default)('md'), (0, _spacing.default)('sm'), (0, _spacing.default)('l'), _ref14 => {
|
|
138
144
|
let {
|
|
139
145
|
theme
|
|
140
|
-
} =
|
|
146
|
+
} = _ref14;
|
|
141
147
|
return theme.color('grey');
|
|
142
148
|
});
|
|
143
149
|
const Copy = exports.Copy = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
@@ -147,25 +153,25 @@ const Copy = exports.Copy = (0, _styledComponents.default)(_Text.default).withCo
|
|
|
147
153
|
const Button = exports.Button = _styledComponents.default.button.withConfig({
|
|
148
154
|
displayName: "Donatestyle__Button",
|
|
149
155
|
componentId: "sc-8rjm3t-16"
|
|
150
|
-
})(["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'),
|
|
156
|
+
})(["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'), _ref15 => {
|
|
151
157
|
let {
|
|
152
158
|
theme
|
|
153
|
-
} =
|
|
159
|
+
} = _ref15;
|
|
154
160
|
return theme.color('white');
|
|
155
|
-
},
|
|
161
|
+
}, _ref16 => {
|
|
156
162
|
let {
|
|
157
163
|
theme
|
|
158
|
-
} =
|
|
164
|
+
} = _ref16;
|
|
159
165
|
return theme.fontSize('s');
|
|
160
|
-
},
|
|
166
|
+
}, _ref17 => {
|
|
161
167
|
let {
|
|
162
168
|
theme,
|
|
163
169
|
color
|
|
164
|
-
} =
|
|
170
|
+
} = _ref17;
|
|
165
171
|
return theme.color(color);
|
|
166
|
-
},
|
|
172
|
+
}, _ref18 => {
|
|
167
173
|
let {
|
|
168
174
|
theme
|
|
169
|
-
} =
|
|
175
|
+
} = _ref18;
|
|
170
176
|
return theme.color('coral_dark');
|
|
171
177
|
}, (0, _size.media)('small'), (0, _spacing.default)('md'), (0, _spacing.default)('l'));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const handlePadding = paddingOption => {
|
|
8
|
+
switch (paddingOption) {
|
|
9
|
+
case 'upper_off':
|
|
10
|
+
return 'padding-top: 0;';
|
|
11
|
+
case 'lower_off':
|
|
12
|
+
return 'padding-bottom: 0;';
|
|
13
|
+
case 'both_off':
|
|
14
|
+
return 'padding-top: 0; padding-bottom: 0';
|
|
15
|
+
// To leave pre-existing styles untouched
|
|
16
|
+
case 'both_on':
|
|
17
|
+
return null;
|
|
18
|
+
// Just in case
|
|
19
|
+
default:
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var _default = exports.default = handlePadding;
|
package/package.json
CHANGED
|
@@ -30,7 +30,8 @@ const SingleMessage = ({
|
|
|
30
30
|
fullImage,
|
|
31
31
|
vhFull,
|
|
32
32
|
videoID,
|
|
33
|
-
landscapeVideo
|
|
33
|
+
landscapeVideo,
|
|
34
|
+
paddingOption
|
|
34
35
|
}) => {
|
|
35
36
|
const hasImage = imageSet || false;
|
|
36
37
|
const doubleImage = (imageSet || image) && (imageSet2 || image2);
|
|
@@ -207,6 +208,7 @@ const SingleMessage = ({
|
|
|
207
208
|
copyFirst={copyFirst}
|
|
208
209
|
hasVideo={hasVideo}
|
|
209
210
|
vhFull={vhFull}
|
|
211
|
+
paddingOption={paddingOption}
|
|
210
212
|
>
|
|
211
213
|
{children}
|
|
212
214
|
</Copy>
|
|
@@ -234,7 +236,8 @@ SingleMessage.propTypes = {
|
|
|
234
236
|
/** Image will be the height of the viewport */
|
|
235
237
|
vhFull: PropTypes.bool,
|
|
236
238
|
videoID: PropTypes.string,
|
|
237
|
-
landscapeVideo: PropTypes.bool
|
|
239
|
+
landscapeVideo: PropTypes.bool,
|
|
240
|
+
paddingOption: PropTypes.string
|
|
238
241
|
};
|
|
239
242
|
|
|
240
243
|
SingleMessage.defaultProps = {
|
|
@@ -251,7 +254,8 @@ SingleMessage.defaultProps = {
|
|
|
251
254
|
children: null,
|
|
252
255
|
vhFull: false,
|
|
253
256
|
videoID: null,
|
|
254
|
-
landscapeVideo: false
|
|
257
|
+
landscapeVideo: false,
|
|
258
|
+
paddingOption: null
|
|
255
259
|
};
|
|
256
260
|
|
|
257
261
|
export default SingleMessage;
|
|
@@ -84,6 +84,59 @@ import Text from '../../Atoms/Text/Text';
|
|
|
84
84
|
</SingleMessage>;
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
Single Message with no Image - padding unmodified
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
import Text from '../../Atoms/Text/Text';
|
|
91
|
+
|
|
92
|
+
<SingleMessage backgroundColor="purple_dark" copyFirst={false} paddingOption="both_on">
|
|
93
|
+
<Text tag="p" color="white" size="xxl">
|
|
94
|
+
“The creativity that goes into helping people have a better life is
|
|
95
|
+
extraordinary.”
|
|
96
|
+
</Text>
|
|
97
|
+
</SingleMessage>;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Single Message with no Image - no bottom padding
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
import Text from '../../Atoms/Text/Text';
|
|
104
|
+
|
|
105
|
+
<SingleMessage backgroundColor="purple_dark" copyFirst={false} paddingOption="lower_off">
|
|
106
|
+
<Text tag="p" color="white" size="xxl">
|
|
107
|
+
“The creativity that goes into helping people have a better life is
|
|
108
|
+
extraordinary.”
|
|
109
|
+
</Text>
|
|
110
|
+
</SingleMessage>;
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
Single Message with no Image - no top padding
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
import Text from '../../Atoms/Text/Text';
|
|
118
|
+
|
|
119
|
+
<SingleMessage backgroundColor="purple_dark" copyFirst={false} paddingOption="upper_off">
|
|
120
|
+
<Text tag="p" color="white" size="xxl">
|
|
121
|
+
“The creativity that goes into helping people have a better life is
|
|
122
|
+
extraordinary.”
|
|
123
|
+
</Text>
|
|
124
|
+
</SingleMessage>;
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Single Message with no Image - no top and bottom padding
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
import Text from '../../Atoms/Text/Text';
|
|
131
|
+
|
|
132
|
+
<SingleMessage backgroundColor="purple_dark" copyFirst={false} paddingOption="both_off">
|
|
133
|
+
<Text tag="p" color="white" size="xxl">
|
|
134
|
+
“The creativity that goes into helping people have a better life is
|
|
135
|
+
extraordinary.”
|
|
136
|
+
</Text>
|
|
137
|
+
</SingleMessage>;
|
|
138
|
+
```
|
|
139
|
+
|
|
87
140
|
Single Message vertical height 100%
|
|
88
141
|
|
|
89
142
|
```js
|
|
@@ -5,6 +5,7 @@ import zIndex from '../../../theme/shared/zIndex';
|
|
|
5
5
|
import playIcon from './assets/video--play-icon.svg';
|
|
6
6
|
import playIconHover from './assets/video--play-icon__hover.svg';
|
|
7
7
|
import loadingIcon from './assets/loader.svg';
|
|
8
|
+
import handlePadding from '../../../utils/_utils';
|
|
8
9
|
|
|
9
10
|
const Container = styled.div`
|
|
10
11
|
display: flex;
|
|
@@ -31,6 +32,7 @@ const Copy = styled.div`
|
|
|
31
32
|
${zIndex('low')};
|
|
32
33
|
${({ hasVideo, fullImage }) => (hasVideo === true && fullImage === true ? 'display: none;' : null)};
|
|
33
34
|
padding: ${spacing('l')};
|
|
35
|
+
|
|
34
36
|
${media('small')} {
|
|
35
37
|
${({ vhFull, fullImage }) => (vhFull || fullImage
|
|
36
38
|
? 'min-height: calc(100vh - 5.625rem); flex-direction: column; justify-content: center;'
|
|
@@ -44,6 +46,7 @@ const Copy = styled.div`
|
|
|
44
46
|
justify-content: center;
|
|
45
47
|
padding: ${spacing('xl')};
|
|
46
48
|
}
|
|
49
|
+
|
|
47
50
|
${props => props.fullImage
|
|
48
51
|
&& css`
|
|
49
52
|
${media('small')} {
|
|
@@ -52,17 +55,13 @@ const Copy = styled.div`
|
|
|
52
55
|
right: 0;
|
|
53
56
|
top: 50%;
|
|
54
57
|
transform: translateY(-50%);
|
|
55
|
-
${props.copyFirst
|
|
56
|
-
? css`
|
|
57
|
-
left: 0;
|
|
58
|
-
`
|
|
59
|
-
: null}
|
|
58
|
+
${props.copyFirst ? css`left: 0;` : null}
|
|
60
59
|
width: 50%;
|
|
61
60
|
}
|
|
62
61
|
`};
|
|
62
|
+
|
|
63
63
|
${props => (props.hasImage
|
|
64
|
-
? css
|
|
65
|
-
@media ${({ theme }) => theme.breakpoint('small')} {
|
|
64
|
+
? css`@media ${({ theme }) => theme.breakpoint('small')} {
|
|
66
65
|
width: 50%;
|
|
67
66
|
}
|
|
68
67
|
`
|
|
@@ -75,6 +74,10 @@ const Copy = styled.div`
|
|
|
75
74
|
margin: auto;
|
|
76
75
|
padding: ${spacing('md')};
|
|
77
76
|
`)};
|
|
77
|
+
|
|
78
|
+
${media('medium')} {
|
|
79
|
+
${({ paddingOption }) => handlePadding(paddingOption)};
|
|
80
|
+
}
|
|
78
81
|
`;
|
|
79
82
|
|
|
80
83
|
const Media = styled.div`
|
|
@@ -104,6 +104,10 @@ exports[`renders Single Message with 100% vertical height image correctly 1`] =
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
@media (min-width:1024px) {
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
@media (min-width:740px) {
|
|
108
112
|
.c1 {
|
|
109
113
|
height: auto;
|
|
@@ -312,6 +316,10 @@ exports[`renders Single Message with Image correctly 1`] = `
|
|
|
312
316
|
}
|
|
313
317
|
}
|
|
314
318
|
|
|
319
|
+
@media (min-width:1024px) {
|
|
320
|
+
|
|
321
|
+
}
|
|
322
|
+
|
|
315
323
|
@media (min-width:740px) {
|
|
316
324
|
.c1 {
|
|
317
325
|
height: auto;
|
|
@@ -498,6 +506,10 @@ exports[`renders Single Message with double image correctly 1`] = `
|
|
|
498
506
|
}
|
|
499
507
|
}
|
|
500
508
|
|
|
509
|
+
@media (min-width:1024px) {
|
|
510
|
+
|
|
511
|
+
}
|
|
512
|
+
|
|
501
513
|
@media (min-width:740px) {
|
|
502
514
|
|
|
503
515
|
}
|
|
@@ -506,6 +518,10 @@ exports[`renders Single Message with double image correctly 1`] = `
|
|
|
506
518
|
|
|
507
519
|
}
|
|
508
520
|
|
|
521
|
+
@media (min-width:1024px) {
|
|
522
|
+
|
|
523
|
+
}
|
|
524
|
+
|
|
509
525
|
@media (min-width:740px) {
|
|
510
526
|
.c1 {
|
|
511
527
|
height: auto;
|
|
@@ -766,6 +782,10 @@ exports[`renders Single Message with full width correctly 1`] = `
|
|
|
766
782
|
}
|
|
767
783
|
}
|
|
768
784
|
|
|
785
|
+
@media (min-width:1024px) {
|
|
786
|
+
|
|
787
|
+
}
|
|
788
|
+
|
|
769
789
|
@media (min-width:740px) {
|
|
770
790
|
.c1 {
|
|
771
791
|
height: auto;
|
|
@@ -920,6 +940,10 @@ exports[`renders Single Message with full width image and no text correctly 1`]
|
|
|
920
940
|
|
|
921
941
|
}
|
|
922
942
|
|
|
943
|
+
@media (min-width:1024px) {
|
|
944
|
+
|
|
945
|
+
}
|
|
946
|
+
|
|
923
947
|
@media (min-width:740px) {
|
|
924
948
|
.c1 {
|
|
925
949
|
height: auto;
|
|
@@ -1052,6 +1076,10 @@ exports[`renders Single Message with no Image correctly 1`] = `
|
|
|
1052
1076
|
}
|
|
1053
1077
|
}
|
|
1054
1078
|
|
|
1079
|
+
@media (min-width:1024px) {
|
|
1080
|
+
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1055
1083
|
@media (min-width:740px) {
|
|
1056
1084
|
|
|
1057
1085
|
}
|
|
@@ -1060,6 +1088,10 @@ exports[`renders Single Message with no Image correctly 1`] = `
|
|
|
1060
1088
|
|
|
1061
1089
|
}
|
|
1062
1090
|
|
|
1091
|
+
@media (min-width:1024px) {
|
|
1092
|
+
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1063
1095
|
@media (min-width:740px) {
|
|
1064
1096
|
|
|
1065
1097
|
}
|
|
@@ -48,6 +48,7 @@ const Donate = ({
|
|
|
48
48
|
defaultGivingType,
|
|
49
49
|
monthlyTitle,
|
|
50
50
|
monthlySubtitle,
|
|
51
|
+
paddingOption,
|
|
51
52
|
// Just to keep the function call character length under control
|
|
52
53
|
monthlyChooseAmountText: monthlyChoose,
|
|
53
54
|
monthlyOtherAmountText: monthlyOther
|
|
@@ -113,7 +114,7 @@ const Donate = ({
|
|
|
113
114
|
/>
|
|
114
115
|
) : null}
|
|
115
116
|
|
|
116
|
-
<Wrapper formAlignRight={formAlignRight} aria-live="polite" noTitlesAtAll={noTitlesAtAll}>
|
|
117
|
+
<Wrapper formAlignRight={formAlignRight} aria-live="polite" noTitlesAtAll={noTitlesAtAll} paddingOption={paddingOption}>
|
|
117
118
|
|
|
118
119
|
{/* Only render if there is SOME title copy; otherwise,
|
|
119
120
|
we need to the space to centre-align the form */}
|
|
@@ -197,7 +198,8 @@ Donate.propTypes = {
|
|
|
197
198
|
monthlyTitle: PropTypes.string,
|
|
198
199
|
monthlySubtitle: PropTypes.string,
|
|
199
200
|
monthlyChooseAmountText: PropTypes.string,
|
|
200
|
-
monthlyOtherAmountText: PropTypes.string
|
|
201
|
+
monthlyOtherAmountText: PropTypes.string,
|
|
202
|
+
paddingOption: PropTypes.string
|
|
201
203
|
};
|
|
202
204
|
|
|
203
205
|
Donate.defaultProps = {
|
|
@@ -231,7 +233,8 @@ Donate.defaultProps = {
|
|
|
231
233
|
monthlyTitle: '',
|
|
232
234
|
monthlySubtitle: '',
|
|
233
235
|
monthlyChooseAmountText: '',
|
|
234
|
-
monthlyOtherAmountText: ''
|
|
236
|
+
monthlyOtherAmountText: '',
|
|
237
|
+
paddingOption: null
|
|
235
238
|
};
|
|
236
239
|
|
|
237
240
|
export default Donate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Donate
|
|
2
2
|
|
|
3
|
-
## Form align right, with red desktop overlay and purple mobile background colour, with a blue submit button
|
|
3
|
+
## Form align right, with red desktop overlay and purple mobile background colour, with a blue submit button and 'no top padding' option
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
import data from './dev-data/data';
|
|
@@ -24,10 +24,11 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
24
24
|
cartID="default-comicrelief"
|
|
25
25
|
title="Donate Now"
|
|
26
26
|
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
27
|
+
paddingOption="upper_off"
|
|
27
28
|
/>;
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
## Form align left, with custom message after choosing an "Other amount" to donate, high value cart
|
|
31
|
+
## Form align left, with custom message after choosing an "Other amount" to donate, high value cart, and 'no bottom padding' option
|
|
31
32
|
```js
|
|
32
33
|
import data from './dev-data/data-high-value';
|
|
33
34
|
const mobilePictures = require('../../../styleguide/data/data').mobileImages;
|
|
@@ -50,10 +51,11 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
50
51
|
title="Donate Now"
|
|
51
52
|
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
52
53
|
otherAmountText="Overridden via the 'Other amount text' prop"
|
|
54
|
+
paddingOption="lower_off"
|
|
53
55
|
/>;
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
## Single Giving
|
|
58
|
+
## Single Giving, with 'no padding' option
|
|
57
59
|
|
|
58
60
|
```js
|
|
59
61
|
import data from './dev-data/data-single';
|
|
@@ -76,6 +78,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
76
78
|
cartID="default-comicrelief"
|
|
77
79
|
title="Donate Now"
|
|
78
80
|
subtitle="Please help us fund life-changing projects in the UK and around the world."
|
|
81
|
+
paddingOption="both_off"
|
|
79
82
|
/>;
|
|
80
83
|
```
|
|
81
84
|
|
|
@@ -6,6 +6,7 @@ import spacing from '../../../theme/shared/spacing';
|
|
|
6
6
|
import { media } from '../../../theme/shared/size';
|
|
7
7
|
import Picture from '../../Atoms/Picture/Picture';
|
|
8
8
|
import zIndex from '../../../theme/shared/zIndex';
|
|
9
|
+
import handlePadding from '../../../utils/_utils';
|
|
9
10
|
|
|
10
11
|
const Container = styled.div`
|
|
11
12
|
position: relative;
|
|
@@ -58,9 +59,11 @@ const Wrapper = styled.div`
|
|
|
58
59
|
${media('small')} {
|
|
59
60
|
padding: ${spacing('xl')} ${spacing('md')};
|
|
60
61
|
}
|
|
62
|
+
|
|
61
63
|
${media('medium')} {
|
|
62
64
|
display: flex;
|
|
63
65
|
padding: ${spacing('xl')} 0;
|
|
66
|
+
${({ paddingOption }) => handlePadding(paddingOption)};
|
|
64
67
|
}
|
|
65
68
|
`;
|
|
66
69
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const handlePadding = paddingOption => {
|
|
2
|
+
switch (paddingOption) {
|
|
3
|
+
case 'upper_off':
|
|
4
|
+
return 'padding-top: 0;';
|
|
5
|
+
case 'lower_off':
|
|
6
|
+
return 'padding-bottom: 0;';
|
|
7
|
+
case 'both_off':
|
|
8
|
+
return 'padding-top: 0; padding-bottom: 0';
|
|
9
|
+
// To leave pre-existing styles untouched
|
|
10
|
+
case 'both_on':
|
|
11
|
+
return null;
|
|
12
|
+
// Just in case
|
|
13
|
+
default:
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default handlePadding;
|