@comicrelief/component-library 7.35.9 → 7.36.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/Atoms/Link/Link.js +3 -0
- package/dist/components/Atoms/Link/Link.md +2 -1
- package/dist/components/Atoms/Link/Link.style.js +30 -13
- package/dist/components/Atoms/Link/Link.test.js +5 -5
- package/dist/components/Molecules/CardDs/__snapshots__/CardDs.test.js.snap +12 -0
- package/dist/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +24 -0
- package/dist/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +32 -0
- package/dist/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +12 -0
- package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +4 -4
- package/dist/components/Organisms/WYMDCarousel/WYMDCarousel.style.js +3 -13
- package/dist/components/Organisms/WYMDCarousel/WYMDCarousel.test.js +1 -1
- package/dist/styleguide/data/data.js +2 -2
- package/package.json +1 -1
- package/src/components/Atoms/Link/Link.js +4 -0
- package/src/components/Atoms/Link/Link.md +2 -1
- package/src/components/Atoms/Link/Link.style.js +9 -0
- package/src/components/Atoms/Link/Link.test.js +21 -9
- package/src/components/Molecules/CardDs/__snapshots__/CardDs.test.js.snap +12 -0
- package/src/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +24 -0
- package/src/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +32 -0
- package/src/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +12 -0
- package/src/components/Organisms/CookieBanner/CookieBanner.test.js +21 -9
- package/src/components/Organisms/WYMDCarousel/WYMDCarousel.style.js +4 -11
- package/src/components/Organisms/WYMDCarousel/WYMDCarousel.test.js +6 -14
- package/src/styleguide/data/data.js +2 -2
|
@@ -15,6 +15,7 @@ const Link = _ref => {
|
|
|
15
15
|
let {
|
|
16
16
|
children,
|
|
17
17
|
color,
|
|
18
|
+
mobileColour,
|
|
18
19
|
href,
|
|
19
20
|
target,
|
|
20
21
|
type,
|
|
@@ -54,6 +55,7 @@ const Link = _ref => {
|
|
|
54
55
|
}, []);
|
|
55
56
|
return /*#__PURE__*/_react.default.createElement(_Link.default, Object.assign({}, rest, {
|
|
56
57
|
color: color,
|
|
58
|
+
mobileColour: mobileColour,
|
|
57
59
|
href: href,
|
|
58
60
|
target: window,
|
|
59
61
|
type: type,
|
|
@@ -66,6 +68,7 @@ const Link = _ref => {
|
|
|
66
68
|
Link.defaultProps = {
|
|
67
69
|
type: 'standard',
|
|
68
70
|
color: 'red',
|
|
71
|
+
mobileColour: null,
|
|
69
72
|
target: null,
|
|
70
73
|
home: false,
|
|
71
74
|
underline: true,
|
|
@@ -40,12 +40,13 @@ import { External, Download, Favourite, Internal, Chevron, Arrow, AtSign } from
|
|
|
40
40
|
<div style={{ display: 'block', marginBottom: '10px' }}>
|
|
41
41
|
<Link
|
|
42
42
|
color="red"
|
|
43
|
+
mobileColour="blue"
|
|
43
44
|
href="#anchor"
|
|
44
45
|
target="blank"
|
|
45
46
|
type="button"
|
|
46
47
|
icon={<Internal colour="white" />}
|
|
47
48
|
>
|
|
48
|
-
Internal link
|
|
49
|
+
Internal link, 'blue' on tablet and mobile
|
|
49
50
|
</Link>
|
|
50
51
|
</div>
|
|
51
52
|
|
|
@@ -9,7 +9,7 @@ exports.default = exports.IconWrapper = exports.HelperText = void 0;
|
|
|
9
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
10
|
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
11
11
|
var _hideVisually = _interopRequireDefault(require("../../../theme/shared/hideVisually"));
|
|
12
|
-
const buttonStyle = () => (0, _styledComponents.css)(["display:inline-flex;position:relative;padding:0.5rem 1.25rem;text-decoration:none;font-weight:700;font-size:", ";border-radius:2rem;transition:all 0.3s;height:3.125rem;width:100%;justify-content:center;align-items:center;cursor:pointer;", ";@media ", "{width:auto;}"], _ref => {
|
|
12
|
+
const buttonStyle = () => (0, _styledComponents.css)(["display:inline-flex;position:relative;padding:0.5rem 1.25rem;text-decoration:none;font-weight:700;font-size:", ";border-radius:2rem;transition:all 0.3s;height:3.125rem;width:100%;justify-content:center;align-items:center;cursor:pointer;", ";", ";@media ", "{width:auto;}@media ", "{", ";}"], _ref => {
|
|
13
13
|
let {
|
|
14
14
|
theme
|
|
15
15
|
} = _ref;
|
|
@@ -22,49 +22,66 @@ const buttonStyle = () => (0, _styledComponents.css)(["display:inline-flex;posit
|
|
|
22
22
|
return color ? theme.buttonColors(color) : theme.buttonColors('red');
|
|
23
23
|
}, _ref3 => {
|
|
24
24
|
let {
|
|
25
|
+
mobileColour,
|
|
25
26
|
theme
|
|
26
27
|
} = _ref3;
|
|
28
|
+
return mobileColour ? theme.buttonColors(mobileColour) : null;
|
|
29
|
+
}, _ref4 => {
|
|
30
|
+
let {
|
|
31
|
+
theme
|
|
32
|
+
} = _ref4;
|
|
27
33
|
return theme.breakpoint('small');
|
|
34
|
+
}, _ref5 => {
|
|
35
|
+
let {
|
|
36
|
+
theme
|
|
37
|
+
} = _ref5;
|
|
38
|
+
return theme.breakpoint('medium');
|
|
39
|
+
}, _ref6 => {
|
|
40
|
+
let {
|
|
41
|
+
color,
|
|
42
|
+
theme
|
|
43
|
+
} = _ref6;
|
|
44
|
+
return color ? theme.buttonColors(color) : theme.buttonColors('red');
|
|
28
45
|
});
|
|
29
|
-
const linkStyle = () => (0, _styledComponents.css)(["position:relative;text-decoration:none;display:inline;line-height:", ";", ";"],
|
|
46
|
+
const linkStyle = () => (0, _styledComponents.css)(["position:relative;text-decoration:none;display:inline;line-height:", ";", ";"], _ref7 => {
|
|
30
47
|
let {
|
|
31
48
|
theme
|
|
32
|
-
} =
|
|
49
|
+
} = _ref7;
|
|
33
50
|
return theme.fontSize('l');
|
|
34
|
-
},
|
|
51
|
+
}, _ref8 => {
|
|
35
52
|
let {
|
|
36
53
|
type,
|
|
37
54
|
theme,
|
|
38
55
|
underline
|
|
39
|
-
} =
|
|
56
|
+
} = _ref8;
|
|
40
57
|
return type ? theme.linkStyles(type, underline) : theme.linkStyles('standard', underline);
|
|
41
58
|
});
|
|
42
59
|
const IconWrapper = exports.IconWrapper = _styledComponents.default.span.withConfig({
|
|
43
60
|
displayName: "Linkstyle__IconWrapper",
|
|
44
61
|
componentId: "sc-t360tr-0"
|
|
45
|
-
})(["display:inline-flex;margin-left:", ";align-self:center;right:", ";", ";@media ", "{width:auto;right:auto;position:relative;", ";}"], (0, _spacing.default)('md'), (0, _spacing.default)('m'),
|
|
62
|
+
})(["display:inline-flex;margin-left:", ";align-self:center;right:", ";", ";@media ", "{width:auto;right:auto;position:relative;", ";}"], (0, _spacing.default)('md'), (0, _spacing.default)('m'), _ref9 => {
|
|
46
63
|
let {
|
|
47
64
|
type
|
|
48
|
-
} =
|
|
65
|
+
} = _ref9;
|
|
49
66
|
return type === 'standard' && (0, _styledComponents.css)(["position:absolute;right:-2rem;top:0;bottom:0;"]);
|
|
50
|
-
},
|
|
67
|
+
}, _ref10 => {
|
|
51
68
|
let {
|
|
52
69
|
theme
|
|
53
|
-
} =
|
|
70
|
+
} = _ref10;
|
|
54
71
|
return theme.breakpoint('small');
|
|
55
|
-
},
|
|
72
|
+
}, _ref11 => {
|
|
56
73
|
let {
|
|
57
74
|
type
|
|
58
|
-
} =
|
|
75
|
+
} = _ref11;
|
|
59
76
|
return type === 'standard' && (0, _styledComponents.css)(["position:absolute;right:-2rem;top:0;bottom:0;"]);
|
|
60
77
|
});
|
|
61
78
|
const StyledLink = _styledComponents.default.a.withConfig({
|
|
62
79
|
displayName: "Linkstyle__StyledLink",
|
|
63
80
|
componentId: "sc-t360tr-1"
|
|
64
|
-
})(["", " ", ";"], props => props.type === 'button' ? buttonStyle : linkStyle,
|
|
81
|
+
})(["", " ", ";"], props => props.type === 'button' ? buttonStyle : linkStyle, _ref12 => {
|
|
65
82
|
let {
|
|
66
83
|
iconFirst
|
|
67
|
-
} =
|
|
84
|
+
} = _ref12;
|
|
68
85
|
return iconFirst && (0, _styledComponents.css)(["flex-direction:row-reverse;span[type=\"button\"]{margin-left:0;margin-right:1rem;}"]);
|
|
69
86
|
});
|
|
70
87
|
const HelperText = exports.HelperText = _styledComponents.default.span.withConfig({
|
|
@@ -6,14 +6,14 @@ require("jest-styled-components");
|
|
|
6
6
|
var _shallowWithTheme = _interopRequireDefault(require("../../../hoc/shallowWithTheme"));
|
|
7
7
|
var _Link = _interopRequireDefault(require("./Link"));
|
|
8
8
|
var _index = require("../Icons/index");
|
|
9
|
-
it(
|
|
9
|
+
it("renders a standard styled link correctly", () => {
|
|
10
10
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
11
11
|
href: "/test",
|
|
12
12
|
type: "standard"
|
|
13
13
|
}, "A standard link")).toJSON();
|
|
14
14
|
expect(tree).toMatchInlineSnapshot("\n .c0 {\n position: relative;\n -webkit-text-decoration: none;\n text-decoration: none;\n display: inline;\n line-height: 1.5rem;\n color: #000000;\n border-bottom: 2px solid #000000;\n font-weight: normal;\n }\n\n .c0:hover {\n color: #000000;\n border-bottom: 2px solid #000000;\n }\n\n <a\n className=\"c0\"\n color=\"red\"\n href=\"/test\"\n target=\"_self\"\n type=\"standard\"\n >\n A standard link\n </a>\n ");
|
|
15
15
|
});
|
|
16
|
-
it(
|
|
16
|
+
it("renders a button with an icon", () => {
|
|
17
17
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
18
18
|
href: "/test",
|
|
19
19
|
type: "standard",
|
|
@@ -24,7 +24,7 @@ it('renders a button with an icon', () => {
|
|
|
24
24
|
}, "Internal link")).toJSON();
|
|
25
25
|
expect(tree).toMatchInlineSnapshot("\n .c1 {\n display: -webkit-inline-box;\n display: -webkit-inline-flex;\n display: -ms-inline-flexbox;\n display: inline-flex;\n margin-left: 1rem;\n -webkit-align-self: center;\n -ms-flex-item-align: center;\n align-self: center;\n right: 1.5rem;\n position: absolute;\n right: -2rem;\n top: 0;\n bottom: 0;\n }\n\n .c0 {\n position: relative;\n -webkit-text-decoration: none;\n text-decoration: none;\n display: inline;\n line-height: 1.5rem;\n color: #000000;\n border-bottom: 2px solid #000000;\n font-weight: normal;\n }\n\n .c0:hover {\n color: #000000;\n border-bottom: 2px solid #000000;\n }\n\n @media (min-width:740px) {\n .c1 {\n width: auto;\n right: auto;\n position: relative;\n position: absolute;\n right: -2rem;\n top: 0;\n bottom: 0;\n }\n }\n\n <a\n className=\"c0\"\n color=\"red\"\n href=\"/test\"\n target=\"_self\"\n type=\"standard\"\n >\n Internal link\n <span\n className=\"c1\"\n type=\"standard\"\n >\n <svg\n fill=\"#FFFFFF\"\n height={24}\n viewBox=\"0 0 96 96\"\n width={24}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M90.871 50.776c-.016.016-.026.036-.043.052l-32 32C58.047 83.609 57.024 84 56 84s-2.047-.391-2.829-1.171a4 4 0 010-5.657L78.343 52H8a4 4 0 010-8h70.343L53.171 18.829a4 4 0 015.657-5.657l32 32c.016.016.027.036.043.052.167.172.321.357.455.557.069.104.118.216.176.325.065.121.138.236.191.364.057.137.09.279.13.42.032.109.074.214.097.327a4.017 4.017 0 010 1.568c-.023.113-.065.217-.097.327-.041.141-.074.283-.13.42-.053.128-.126.243-.191.364-.059.109-.107.221-.176.325a4.035 4.035 0 01-.455.555z\"\n />\n </svg>\n </span>\n </a>\n ");
|
|
26
26
|
});
|
|
27
|
-
it(
|
|
27
|
+
it("renders a standard styled link correctly with target blank and assistive text", () => {
|
|
28
28
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
29
29
|
href: "/test",
|
|
30
30
|
type: "standard",
|
|
@@ -32,11 +32,11 @@ it('renders a standard styled link correctly with target blank and assistive tex
|
|
|
32
32
|
}, "A standard link")).toJSON();
|
|
33
33
|
expect(tree).toMatchInlineSnapshot("\n .c0 {\n position: relative;\n -webkit-text-decoration: none;\n text-decoration: none;\n display: inline;\n line-height: 1.5rem;\n color: #000000;\n border-bottom: 2px solid #000000;\n font-weight: normal;\n }\n\n .c0:hover {\n color: #000000;\n border-bottom: 2px solid #000000;\n }\n\n .c1 {\n border: 0;\n -webkit-clip: rect(0 0 0 0);\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n }\n\n <a\n className=\"c0\"\n color=\"red\"\n href=\"/test\"\n target=\"_blank\"\n type=\"standard\"\n >\n A standard link\n <span\n className=\"c1\"\n >\n (opens in new window)\n </span>\n </a>\n ");
|
|
34
34
|
});
|
|
35
|
-
it(
|
|
35
|
+
it("renders link styled as button correctly", () => {
|
|
36
36
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
37
37
|
href: "/test",
|
|
38
38
|
type: "button",
|
|
39
39
|
color: "yellow"
|
|
40
40
|
}, "A yellow button")).toJSON();
|
|
41
|
-
expect(tree).toMatchInlineSnapshot("\n .c0 {\n display: -webkit-inline-box;\n display: -webkit-inline-flex;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n padding: 0.5rem 1.25rem;\n -webkit-text-decoration: none;\n text-decoration: none;\n font-weight: 700;\n font-size: 1rem;\n border-radius: 2rem;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n height: 3.125rem;\n width: 100%;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n cursor: pointer;\n background-color: #FFE400;\n color: #000000;\n }\n\n .c0:hover {\n background-color: #FEFD5A;\n color: #000000;\n }\n\n @media (min-width:740px) {\n .c0 {\n width: auto;\n }\n }\n\n <a\n className=\"c0\"\n color=\"yellow\"\n href=\"/test\"\n target=\"_self\"\n type=\"button\"\n >\n A yellow button\n </a>\n ");
|
|
41
|
+
expect(tree).toMatchInlineSnapshot("\n .c0 {\n display: -webkit-inline-box;\n display: -webkit-inline-flex;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n padding: 0.5rem 1.25rem;\n -webkit-text-decoration: none;\n text-decoration: none;\n font-weight: 700;\n font-size: 1rem;\n border-radius: 2rem;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n height: 3.125rem;\n width: 100%;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n cursor: pointer;\n background-color: #FFE400;\n color: #000000;\n }\n\n .c0:hover {\n background-color: #FEFD5A;\n color: #000000;\n }\n\n @media (min-width:740px) {\n .c0 {\n width: auto;\n }\n }\n\n @media (min-width:1024px) {\n .c0 {\n background-color: #FFE400;\n color: #000000;\n }\n\n .c0:hover {\n background-color: #FEFD5A;\n color: #000000;\n }\n }\n\n <a\n className=\"c0\"\n color=\"yellow\"\n href=\"/test\"\n target=\"_self\"\n type=\"button\"\n >\n A yellow button\n </a>\n ");
|
|
42
42
|
});
|
|
@@ -129,6 +129,18 @@ exports[`renders correctly 1`] = `
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
@media (min-width:1024px) {
|
|
133
|
+
.c7 {
|
|
134
|
+
background-color: #E52630;
|
|
135
|
+
color: #FFFFFF;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.c7:hover {
|
|
139
|
+
background-color: #890B11;
|
|
140
|
+
color: #FFFFFF;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
132
144
|
@media (min-width:740px) {
|
|
133
145
|
.c0 {
|
|
134
146
|
-webkit-flex-direction: row;
|
|
@@ -159,6 +159,18 @@ exports[`renders Promo correctly 1`] = `
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
@media (min-width:1024px) {
|
|
163
|
+
.c9 {
|
|
164
|
+
background-color: #FFFFFF;
|
|
165
|
+
color: #000000;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.c9:hover {
|
|
169
|
+
background-color: #969598;
|
|
170
|
+
color: #000000;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
162
174
|
@media (min-width:1024px) {
|
|
163
175
|
.c0 {
|
|
164
176
|
-webkit-flex-direction: row;
|
|
@@ -425,6 +437,18 @@ exports[`renders Promo correctly end position 1`] = `
|
|
|
425
437
|
}
|
|
426
438
|
}
|
|
427
439
|
|
|
440
|
+
@media (min-width:1024px) {
|
|
441
|
+
.c9 {
|
|
442
|
+
background-color: #FFFFFF;
|
|
443
|
+
color: #000000;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.c9:hover {
|
|
447
|
+
background-color: #969598;
|
|
448
|
+
color: #000000;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
428
452
|
@media (min-width:1024px) {
|
|
429
453
|
.c0 {
|
|
430
454
|
-webkit-flex-direction: row;
|
|
@@ -284,6 +284,18 @@ exports[`renders Single Message with Image correctly 1`] = `
|
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
+
@media (min-width:1024px) {
|
|
288
|
+
.c8 {
|
|
289
|
+
background-color: #FFFFFF;
|
|
290
|
+
color: #000000;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.c8:hover {
|
|
294
|
+
background-color: #969598;
|
|
295
|
+
color: #000000;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
287
299
|
@media (min-width:740px) {
|
|
288
300
|
.c0 {
|
|
289
301
|
-webkit-flex-direction: row;
|
|
@@ -730,6 +742,18 @@ exports[`renders Single Message with full width correctly 1`] = `
|
|
|
730
742
|
}
|
|
731
743
|
}
|
|
732
744
|
|
|
745
|
+
@media (min-width:1024px) {
|
|
746
|
+
.c8 {
|
|
747
|
+
background-color: #FFFFFF;
|
|
748
|
+
color: #000000;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.c8:hover {
|
|
752
|
+
background-color: #969598;
|
|
753
|
+
color: #000000;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
733
757
|
@media (min-width:740px) {
|
|
734
758
|
.c0 {
|
|
735
759
|
-webkit-flex-direction: row;
|
|
@@ -920,6 +944,10 @@ exports[`renders Single Message with full width image and no text correctly 1`]
|
|
|
920
944
|
|
|
921
945
|
}
|
|
922
946
|
|
|
947
|
+
@media (min-width:1024px) {
|
|
948
|
+
|
|
949
|
+
}
|
|
950
|
+
|
|
923
951
|
@media (min-width:740px) {
|
|
924
952
|
.c0 {
|
|
925
953
|
-webkit-flex-direction: row;
|
|
@@ -1042,6 +1070,10 @@ exports[`renders Single Message with no Image correctly 1`] = `
|
|
|
1042
1070
|
|
|
1043
1071
|
}
|
|
1044
1072
|
|
|
1073
|
+
@media (min-width:1024px) {
|
|
1074
|
+
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1045
1077
|
@media (min-width:740px) {
|
|
1046
1078
|
.c0 {
|
|
1047
1079
|
-webkit-flex-direction: row;
|
package/dist/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap
CHANGED
|
@@ -163,6 +163,18 @@ exports[`renders correctly 1`] = `
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
@media (min-width:1024px) {
|
|
167
|
+
.c11 {
|
|
168
|
+
background-color: #2042AD;
|
|
169
|
+
color: #FFFFFF;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.c11:hover {
|
|
173
|
+
background-color: #274084;
|
|
174
|
+
color: #FFFFFF;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
166
178
|
@media (min-width:740px) {
|
|
167
179
|
.c0 {
|
|
168
180
|
-webkit-flex-direction: row;
|
|
@@ -5,17 +5,17 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
5
5
|
require("jest-styled-components");
|
|
6
6
|
var _shallowWithTheme = _interopRequireDefault(require("../../../hoc/shallowWithTheme"));
|
|
7
7
|
var _CookieBanner = _interopRequireDefault(require("./CookieBanner"));
|
|
8
|
-
it(
|
|
8
|
+
it("renders correctly", () => {
|
|
9
9
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_CookieBanner.default, {
|
|
10
10
|
acceptCookie: e => {
|
|
11
11
|
e.preventDefault();
|
|
12
|
-
return
|
|
12
|
+
return "User accept";
|
|
13
13
|
},
|
|
14
14
|
denyCookie: e => {
|
|
15
15
|
e.preventDefault();
|
|
16
|
-
return
|
|
16
|
+
return "User does not accept cookies";
|
|
17
17
|
},
|
|
18
18
|
cookiePolicyUrl: "https://www.comicrelief.com/cookies-policy"
|
|
19
19
|
})).toJSON();
|
|
20
|
-
expect(tree).toMatchInlineSnapshot("\n .c1 {\n color: #FFFFFF;\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c3 {\n position: relative;\n -webkit-text-decoration: none;\n text-decoration: none;\n display: inline;\n line-height: 1.5rem;\n color: #FFFFFF;\n border-bottom: 2px solid #FFFFFF;\n font-weight: normal;\n }\n\n .c3:hover {\n color: #FFFFFF;\n border-bottom: 2px solid #FFFFFF;\n }\n\n .c5 {\n display: -webkit-inline-box;\n display: -webkit-inline-flex;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n padding: 0.5rem 1.25rem;\n -webkit-text-decoration: none;\n text-decoration: none;\n font-weight: 700;\n font-size: 1rem;\n border-radius: 2rem;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n height: 3.125rem;\n width: 100%;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n cursor: pointer;\n background-color: #FFFFFF;\n color: #000000;\n }\n\n .c5:hover {\n background-color: #969598;\n color: #000000;\n }\n\n .c0 {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n position: relative;\n padding: 1rem;\n background: #2C0230;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n z-index: 3;\n }\n\n .c2 {\n line-height: 1.5;\n margin: 0;\n }\n\n .c2:first-of-type {\n margin-bottom: 0.5rem;\n }\n\n .c6 {\n padding: 0.5rem 1rem;\n display: block;\n margin-bottom: 10px;\n }\n\n .c4 {\n color: #FFFFFF;\n padding: 0 0.25rem 1px;\n border-bottom: 2px solid;\n }\n\n @media (min-width:740px) {\n .c5 {\n width: auto;\n }\n }\n\n @media (min-width:740px) {\n .c2 {\n width: 75%;\n margin: 0 auto;\n }\n\n .c2:first-of-type {\n margin-bottom: 1rem;\n }\n }\n\n @media (min-width:740px) {\n .c6 {\n margin: 0 0.25rem 0 0;\n display: inline-block;\n }\n }\n\n <div\n className=\"c0\"\n >\n <p\n className=\"c1 c2\"\n color=\"white\"\n size=\"s\"\n >\n Hello! Comic Relief uses cookies to help make this website better and improve our services. You can learn more about\n <a\n className=\"c3 c4\"\n color=\"red\"\n href=\"https://www.comicrelief.com/cookies-policy\"\n target=\"_self\"\n type=\"standard_white\"\n >\n our use of cookies\n </a>\n . We also use optional cookies for marketing purposes:\n </p>\n <p\n className=\"c1 c2\"\n color=\"white\"\n size=\"s\"\n >\n <a\n className=\"c5 c6\"\n color=\"white\"\n href=\"/comic\"\n onClick={[Function]}\n target=\"_self\"\n type=\"button\"\n >\n Accept\n </a>\n Or click\n <a\n className=\"c3 c4\"\n color=\"red\"\n href=\"\"\n onClick={[Function]}\n target=\"_self\"\n type=\"standard_white\"\n >\n here\n </a>\n to deny these.\n </p>\n </div>\n ");
|
|
20
|
+
expect(tree).toMatchInlineSnapshot("\n .c1 {\n color: #FFFFFF;\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c3 {\n position: relative;\n -webkit-text-decoration: none;\n text-decoration: none;\n display: inline;\n line-height: 1.5rem;\n color: #FFFFFF;\n border-bottom: 2px solid #FFFFFF;\n font-weight: normal;\n }\n\n .c3:hover {\n color: #FFFFFF;\n border-bottom: 2px solid #FFFFFF;\n }\n\n .c5 {\n display: -webkit-inline-box;\n display: -webkit-inline-flex;\n display: -ms-inline-flexbox;\n display: inline-flex;\n position: relative;\n padding: 0.5rem 1.25rem;\n -webkit-text-decoration: none;\n text-decoration: none;\n font-weight: 700;\n font-size: 1rem;\n border-radius: 2rem;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n height: 3.125rem;\n width: 100%;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n cursor: pointer;\n background-color: #FFFFFF;\n color: #000000;\n }\n\n .c5:hover {\n background-color: #969598;\n color: #000000;\n }\n\n .c0 {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n position: relative;\n padding: 1rem;\n background: #2C0230;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n z-index: 3;\n }\n\n .c2 {\n line-height: 1.5;\n margin: 0;\n }\n\n .c2:first-of-type {\n margin-bottom: 0.5rem;\n }\n\n .c6 {\n padding: 0.5rem 1rem;\n display: block;\n margin-bottom: 10px;\n }\n\n .c4 {\n color: #FFFFFF;\n padding: 0 0.25rem 1px;\n border-bottom: 2px solid;\n }\n\n @media (min-width:740px) {\n .c5 {\n width: auto;\n }\n }\n\n @media (min-width:1024px) {\n .c5 {\n background-color: #FFFFFF;\n color: #000000;\n }\n\n .c5:hover {\n background-color: #969598;\n color: #000000;\n }\n }\n\n @media (min-width:740px) {\n .c2 {\n width: 75%;\n margin: 0 auto;\n }\n\n .c2:first-of-type {\n margin-bottom: 1rem;\n }\n }\n\n @media (min-width:740px) {\n .c6 {\n margin: 0 0.25rem 0 0;\n display: inline-block;\n }\n }\n\n <div\n className=\"c0\"\n >\n <p\n className=\"c1 c2\"\n color=\"white\"\n size=\"s\"\n >\n Hello! Comic Relief uses cookies to help make this website better and improve our services. You can learn more about\n <a\n className=\"c3 c4\"\n color=\"red\"\n href=\"https://www.comicrelief.com/cookies-policy\"\n target=\"_self\"\n type=\"standard_white\"\n >\n our use of cookies\n </a>\n . We also use optional cookies for marketing purposes:\n </p>\n <p\n className=\"c1 c2\"\n color=\"white\"\n size=\"s\"\n >\n <a\n className=\"c5 c6\"\n color=\"white\"\n href=\"/comic\"\n onClick={[Function]}\n target=\"_self\"\n type=\"button\"\n >\n Accept\n </a>\n Or click\n <a\n className=\"c3 c4\"\n color=\"red\"\n href=\"\"\n onClick={[Function]}\n target=\"_self\"\n type=\"standard_white\"\n >\n here\n </a>\n to deny these.\n </p>\n </div>\n ");
|
|
21
21
|
});
|
|
@@ -83,7 +83,7 @@ const Including = exports.Including = (0, _styledComponents.default)(_Text.defau
|
|
|
83
83
|
const CarouselWrapper = exports.CarouselWrapper = _styledComponents.default.div.withConfig({
|
|
84
84
|
displayName: "WYMDCarouselstyle__CarouselWrapper",
|
|
85
85
|
componentId: "sc-115z54p-6"
|
|
86
|
-
})(["height:100%;background-color:", ";max-width:760px;padding:", ";margin:0 auto;border-radius:20px;box-shadow:0px 0px 20px rgba(0,0,0,0.15);.carousel{position:relative;margin:0 auto;padding-top:", ";@media ", "{padding-top:", ";}button.carousel__back-button,button.carousel__next-button{position:absolute;left:0;top:0;width:33% !important;height:100%;padding:0 !important;box-shadow:none;text-indent:-9999px;background-color:transparent;border:none;&:after{content:\"\";position:absolute;top:0;left:0;width:50%;height:100%;transition:opacity 0.2s linear;background:linear-gradient(90deg,rgba(255,255,255,1),rgba(255,255,255,0.5),rgba(255,255,255,0));}&:hover{&:after{opacity:0.5;}}@media ", "{width:33.3% !important;&:after{width:100%;}}}button.carousel__next-button{left:auto;right:0;&:before{transform:translate(0,-50%) rotate(-90deg);}&:after{left:auto;right:0;background:linear-gradient(270deg,rgba(255,255,255,1),rgba(255,255,255,0.5),rgba(255,255,255,0));}}.wymd-carousel{transition:-webkit-transform ", "s;-o-transition:transform ", "s;transition:transform ", "s;-webkit-transform:", "s;will-change:transform;.last-slide{.image-wrapper:after{content:none;}}.carousel__slide{padding-bottom:", "px !important;@media ", "{padding-bottom:", "px !important
|
|
86
|
+
})(["height:100%;background-color:", ";max-width:760px;padding:", ";margin:0 auto;border-radius:20px;box-shadow:0px 0px 20px rgba(0,0,0,0.15);.carousel{position:relative;margin:0 auto;padding-top:", ";@media ", "{padding-top:", ";}button.carousel__back-button,button.carousel__next-button{position:absolute;left:0;top:0;width:33% !important;height:100%;padding:0 !important;box-shadow:none;text-indent:-9999px;background-color:transparent;border:none;&:after{content:\"\";position:absolute;top:0;left:0;width:50%;height:100%;transition:opacity 0.2s linear;background:linear-gradient(90deg,rgba(255,255,255,1),rgba(255,255,255,0.5),rgba(255,255,255,0));}&:hover{&:after{opacity:0.5;}}@media ", "{width:33.3% !important;&:after{width:100%;}}}button.carousel__next-button{left:auto;right:0;&:before{transform:translate(0,-50%) rotate(-90deg);}&:after{left:auto;right:0;background:linear-gradient(270deg,rgba(255,255,255,1),rgba(255,255,255,0.5),rgba(255,255,255,0));}}.wymd-carousel{transition:-webkit-transform ", "s;-o-transition:transform ", "s;transition:transform ", "s;-webkit-transform:", "s;will-change:transform;.last-slide{.image-wrapper:after{content:none;}}.carousel__slide{padding-bottom:", "px !important;@media ", "{padding-bottom:", "px !important;.carousel__inner-slide{> div:first-child{transition:transform ", "s ease;transform:scale(0.5);&:after{transition:transform ", "s ease,width ", "s ease,right ", "s ease;right:calc(-300% - 6px);transform:scale(1);width:300%;}}.all-text-wrapper{transition:transform ", "s ease;transform-origin:top;transform:translateY(calc(-", "px + ", "%)) scale(0.5)}}&.carousel__slide--visible{.carousel__inner-slide{> div:first-child{&:after{right:calc(-300% - 6px);transform:scale(1);width:300%;}}}+ .carousel__slide--visible{.carousel__inner-slide{> div:first-child{transform:scale(1);&:after{right:calc(-222% - 6px);transform:scale(0.5);width:300%;}}}.all-text-wrapper{transform:translateY(0) scale(1);}+ .carousel__slide--visible{> div > div:first-child{transform:scale(0.5);&:after{right:calc(-300% - 6px);transform:scale(1);width:300%;}}.all-text-wrapper{transform:translateY(calc(-", "px + ", "%)) scale(0.5)}}}}}@media ", "{padding-bottom:", "px !important;&.carousel__slide--visible{.carousel__inner-slide{> div:first-child{&:after{right:calc(-250% - 6px);width:250%;}}}+ .carousel__slide--visible{.carousel__inner-slide{> div:first-child{&:after{right:calc(-187% - 6px);width:250%;}}}+ .carousel__slide--visible{.carousel__inner-slide{> div:first-child{&:after{right:calc(-250% - 6px);width:250%;}}}}}}}.carousel__inner-slide{text-align:center;display:inline-flex;align-items:center;justify-content:flex-start;flex-direction:column;}}}}"], _ref9 => {
|
|
87
87
|
let {
|
|
88
88
|
theme
|
|
89
89
|
} = _ref9;
|
|
@@ -103,19 +103,9 @@ const CarouselWrapper = exports.CarouselWrapper = _styledComponents.default.div.
|
|
|
103
103
|
theme
|
|
104
104
|
} = _ref12;
|
|
105
105
|
return theme.breakpoint('small');
|
|
106
|
-
}, props => props.tabletHeight, _ref13 => {
|
|
106
|
+
}, props => props.tabletHeight, animationSpeed, animationSpeed, animationSpeed, animationSpeed, animationSpeed, textScaleOffsetA, textScaleOffsetB, textScaleOffsetA, textScaleOffsetB, _ref13 => {
|
|
107
107
|
let {
|
|
108
108
|
theme
|
|
109
109
|
} = _ref13;
|
|
110
110
|
return theme.breakpoint('medium');
|
|
111
|
-
}, props => props.
|
|
112
|
-
let {
|
|
113
|
-
theme
|
|
114
|
-
} = _ref14;
|
|
115
|
-
return theme.breakpoint('small');
|
|
116
|
-
}, props => props.desktopHeight, animationSpeed, animationSpeed, animationSpeed, animationSpeed, animationSpeed, textScaleOffsetA, textScaleOffsetB, textScaleOffsetA, textScaleOffsetB, _ref15 => {
|
|
117
|
-
let {
|
|
118
|
-
theme
|
|
119
|
-
} = _ref15;
|
|
120
|
-
return theme.breakpoint('medium');
|
|
121
|
-
});
|
|
111
|
+
}, props => props.desktopHeight);
|
|
@@ -12,5 +12,5 @@ it("renders correctly", () => {
|
|
|
12
12
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_WYMDCarousel.default, {
|
|
13
13
|
data: carouselItemsComplete
|
|
14
14
|
})).toJSON();
|
|
15
|
-
expect(tree).toMatchInlineSnapshot("\n .c1 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n font-weight: bold;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c3 {\n color: #E52630;\n font-size: 1rem;\n line-height: 1rem;\n text-transform: uppercase;\n font-weight: normal;\n font-family: 'Anton',Impact,sans-serif;\n -webkit-letter-spacing: 0.03rem;\n -moz-letter-spacing: 0.03rem;\n -ms-letter-spacing: 0.03rem;\n letter-spacing: 0.03rem;\n }\n\n .c5 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c2 {\n width: 75%;\n margin: 0 auto;\n }\n\n .c2:first-child {\n margin-bottom: 2rem;\n text-align: center;\n font-size: 16px;\n line-height: 19.5px;\n }\n\n .c4 {\n margin-bottom: 2rem;\n text-align: center;\n font-size: 34px;\n line-height: 37px;\n }\n\n .c6 {\n margin-bottom: 0;\n text-align: center;\n font-size: 12px;\n line-height: 14.63px;\n }\n\n .c0 {\n height: 100%;\n background-color: #FFFFFF;\n max-width: 760px;\n padding: 2rem;\n margin: 0 auto;\n border-radius: 20px;\n box-shadow: 0px 0px 20px rgba(0,0,0,0.15);\n }\n\n .c0 .carousel {\n position: relative;\n margin: 0 auto;\n padding-top: 2rem;\n }\n\n .c0 .carousel button.carousel__back-button,\n .c0 .carousel button.carousel__next-button {\n position: absolute;\n left: 0;\n top: 0;\n width: 33% !important;\n height: 100%;\n padding: 0 !important;\n box-shadow: none;\n text-indent: -9999px;\n background-color: transparent;\n border: none;\n }\n\n .c0 .carousel button.carousel__back-button:after,\n .c0 .carousel button.carousel__next-button:after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n -webkit-transition: opacity 0.2s linear;\n transition: opacity 0.2s linear;\n background: linear-gradient(90deg,rgba(255,255,255,1),rgba(255,255,255,0.5),rgba(255,255,255,0));\n }\n\n .c0 .carousel button.carousel__back-button:hover:after,\n .c0 .carousel button.carousel__next-button:hover:after {\n opacity: 0.5;\n }\n\n .c0 .carousel button.carousel__next-button {\n left: auto;\n right: 0;\n }\n\n .c0 .carousel button.carousel__next-button:before {\n -webkit-transform: translate(0,-50%) rotate(-90deg);\n -ms-transform: translate(0,-50%) rotate(-90deg);\n transform: translate(0,-50%) rotate(-90deg);\n }\n\n .c0 .carousel button.carousel__next-button:after {\n left: auto;\n right: 0;\n background: linear-gradient(270deg,rgba(255,255,255,1),rgba(255,255,255,0.5),rgba(255,255,255,0));\n }\n\n .c0 .carousel .wymd-carousel {\n -webkit-transition: -webkit-transform 0.75s;\n -webkit-transition: -webkit-transform 0.75s;\n transition: -webkit-transform 0.75s;\n -o-transition: transform 0.75s;\n -webkit-transition: -webkit-transform 0.75s;\n -webkit-transition: transform 0.75s;\n transition: transform 0.75s;\n -webkit-transform: 0.75s;\n will-change: transform;\n }\n\n .c0 .carousel .wymd-carousel .last-slide .image-wrapper:after {\n content: none;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide {\n padding-bottom: 450px !important;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide .carousel__inner-slide {\n text-align: center;\n display: -webkit-inline-box;\n display: -webkit-inline-flex;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: start;\n -webkit-justify-content: flex-start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n @media (min-width:1024px) {\n .c2:first-child {\n font-size: 20px;\n line-height: 24.38px;\n }\n }\n\n @media (min-width:740px) {\n .c4 {\n font-size: 60px;\n line-height: 60px;\n }\n }\n\n @media (min-width:1024px) {\n .c4 {\n font-size: 64px;\n line-height: 68px;\n }\n }\n\n @media (min-width:740px) {\n .c6 {\n font-size: 17px;\n line-height: 19px;\n }\n }\n\n @media (min-width:1024px) {\n .c0 .carousel {\n padding-top: 2rem;\n }\n }\n\n @media (min-width:740px) {\n .c0 .carousel button.carousel__back-button,\n .c0 .carousel button.carousel__next-button {\n width: 33.3% !important;\n }\n\n .c0 .carousel button.carousel__back-button:after,\n .c0 .carousel button.carousel__next-button:after {\n width: 100%;\n }\n }\n\n @media (min-width:740px) {\n .c0 .carousel .wymd-carousel .carousel__slide {\n padding-bottom: 500px !important;\n }\n }\n\n @media (min-width:1024px) {\n .c0 .carousel .wymd-carousel .carousel__slide {\n padding-bottom: 500px !important;\n }\n }\n\n @media (min-width:740px) {\n .c0 .carousel .wymd-carousel .carousel__slide {\n padding-bottom: 475px !important;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide .carousel__inner-slide > div:first-child {\n -webkit-transition: -webkit-transform 0.75s ease;\n -webkit-transition: transform 0.75s ease;\n transition: transform 0.75s ease;\n -webkit-transform: scale(0.5);\n -ms-transform: scale(0.5);\n transform: scale(0.5);\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide .carousel__inner-slide > div:first-child:after {\n -webkit-transition: -webkit-transform 0.75s ease,width 0.75s ease,right 0.75s ease;\n -webkit-transition: transform 0.75s ease,width 0.75s ease,right 0.75s ease;\n transition: transform 0.75s ease,width 0.75s ease,right 0.75s ease;\n right: calc(-300% - 6px);\n -webkit-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n width: 300%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide .carousel__inner-slide .all-text-wrapper {\n -webkit-transition: -webkit-transform 0.75s ease;\n -webkit-transition: transform 0.75s ease;\n transition: transform 0.75s ease;\n -webkit-transform-origin: top;\n -ms-transform-origin: top;\n transform-origin: top;\n -webkit-transform: translateY(calc(-45px + 5%)) scale(0.5);\n -ms-transform: translateY(calc(-45px + 5%)) scale(0.5);\n transform: translateY(calc(-45px + 5%)) scale(0.5);\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible .carousel__inner-slide > div:first-child:after {\n right: calc(-300% - 6px);\n -webkit-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n width: 300%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible .carousel__inner-slide > div:first-child {\n -webkit-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible .carousel__inner-slide > div:first-child:after {\n right: calc(-222% - 6px);\n -webkit-transform: scale(0.5);\n -ms-transform: scale(0.5);\n transform: scale(0.5);\n width: 300%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible .all-text-wrapper {\n -webkit-transform: translateY(0) scale(1);\n -ms-transform: translateY(0) scale(1);\n transform: translateY(0) scale(1);\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible + .carousel__slide--visible > div > div:first-child {\n -webkit-transform: scale(0.5);\n -ms-transform: scale(0.5);\n transform: scale(0.5);\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible + .carousel__slide--visible > div > div:first-child:after {\n right: calc(-300% - 6px);\n -webkit-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n width: 300%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible + .carousel__slide--visible .all-text-wrapper {\n -webkit-transform: translateY(calc(-45px + 5%)) scale(0.5);\n -ms-transform: translateY(calc(-45px + 5%)) scale(0.5);\n transform: translateY(calc(-45px + 5%)) scale(0.5);\n }\n }\n\n @media (min-width:1024px) {\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible .carousel__inner-slide > div:first-child:after {\n right: calc(-250% - 6px);\n width: 250%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible .carousel__inner-slide > div:first-child:after {\n right: calc(-187% - 6px);\n width: 250%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible + .carousel__slide--visible .carousel__inner-slide > div:first-child:after {\n right: calc(-250% - 6px);\n width: 250%;\n }\n }\n\n <div\n className=\"c0 CarouselWrapper\"\n id=\"7zdR84QkZwrTh9NWx2H926\"\n >\n <p\n className=\"c1 c2\"\n color=\"inherit\"\n size=\"s\"\n >\n Over the past two years, we\u2019ve supported\n </p>\n <h1\n className=\"c3 c4\"\n color=\"red\"\n size=\"s\"\n >\n 11.7 million people\n </h1>\n <p\n className=\"c5 c6\"\n color=\"inherit\"\n size=\"s\"\n >\n including...\n </p>\n </div>\n ");
|
|
15
|
+
expect(tree).toMatchInlineSnapshot("\n .c1 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n font-weight: bold;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c3 {\n color: #E52630;\n font-size: 1rem;\n line-height: 1rem;\n text-transform: uppercase;\n font-weight: normal;\n font-family: 'Anton',Impact,sans-serif;\n -webkit-letter-spacing: 0.03rem;\n -moz-letter-spacing: 0.03rem;\n -ms-letter-spacing: 0.03rem;\n letter-spacing: 0.03rem;\n }\n\n .c5 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c2 {\n width: 75%;\n margin: 0 auto;\n }\n\n .c2:first-child {\n margin-bottom: 2rem;\n text-align: center;\n font-size: 16px;\n line-height: 19.5px;\n }\n\n .c4 {\n margin-bottom: 2rem;\n text-align: center;\n font-size: 34px;\n line-height: 37px;\n }\n\n .c6 {\n margin-bottom: 0;\n text-align: center;\n font-size: 12px;\n line-height: 14.63px;\n }\n\n .c0 {\n height: 100%;\n background-color: #FFFFFF;\n max-width: 760px;\n padding: 2rem;\n margin: 0 auto;\n border-radius: 20px;\n box-shadow: 0px 0px 20px rgba(0,0,0,0.15);\n }\n\n .c0 .carousel {\n position: relative;\n margin: 0 auto;\n padding-top: 2rem;\n }\n\n .c0 .carousel button.carousel__back-button,\n .c0 .carousel button.carousel__next-button {\n position: absolute;\n left: 0;\n top: 0;\n width: 33% !important;\n height: 100%;\n padding: 0 !important;\n box-shadow: none;\n text-indent: -9999px;\n background-color: transparent;\n border: none;\n }\n\n .c0 .carousel button.carousel__back-button:after,\n .c0 .carousel button.carousel__next-button:after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n -webkit-transition: opacity 0.2s linear;\n transition: opacity 0.2s linear;\n background: linear-gradient(90deg,rgba(255,255,255,1),rgba(255,255,255,0.5),rgba(255,255,255,0));\n }\n\n .c0 .carousel button.carousel__back-button:hover:after,\n .c0 .carousel button.carousel__next-button:hover:after {\n opacity: 0.5;\n }\n\n .c0 .carousel button.carousel__next-button {\n left: auto;\n right: 0;\n }\n\n .c0 .carousel button.carousel__next-button:before {\n -webkit-transform: translate(0,-50%) rotate(-90deg);\n -ms-transform: translate(0,-50%) rotate(-90deg);\n transform: translate(0,-50%) rotate(-90deg);\n }\n\n .c0 .carousel button.carousel__next-button:after {\n left: auto;\n right: 0;\n background: linear-gradient(270deg,rgba(255,255,255,1),rgba(255,255,255,0.5),rgba(255,255,255,0));\n }\n\n .c0 .carousel .wymd-carousel {\n -webkit-transition: -webkit-transform 0.75s;\n -webkit-transition: -webkit-transform 0.75s;\n transition: -webkit-transform 0.75s;\n -o-transition: transform 0.75s;\n -webkit-transition: -webkit-transform 0.75s;\n -webkit-transition: transform 0.75s;\n transition: transform 0.75s;\n -webkit-transform: 0.75s;\n will-change: transform;\n }\n\n .c0 .carousel .wymd-carousel .last-slide .image-wrapper:after {\n content: none;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide {\n padding-bottom: 425px !important;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide .carousel__inner-slide {\n text-align: center;\n display: -webkit-inline-box;\n display: -webkit-inline-flex;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: start;\n -webkit-justify-content: flex-start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n @media (min-width:1024px) {\n .c2:first-child {\n font-size: 20px;\n line-height: 24.38px;\n }\n }\n\n @media (min-width:740px) {\n .c4 {\n font-size: 60px;\n line-height: 60px;\n }\n }\n\n @media (min-width:1024px) {\n .c4 {\n font-size: 64px;\n line-height: 68px;\n }\n }\n\n @media (min-width:740px) {\n .c6 {\n font-size: 17px;\n line-height: 19px;\n }\n }\n\n @media (min-width:1024px) {\n .c0 .carousel {\n padding-top: 2rem;\n }\n }\n\n @media (min-width:740px) {\n .c0 .carousel button.carousel__back-button,\n .c0 .carousel button.carousel__next-button {\n width: 33.3% !important;\n }\n\n .c0 .carousel button.carousel__back-button:after,\n .c0 .carousel button.carousel__next-button:after {\n width: 100%;\n }\n }\n\n @media (min-width:740px) {\n .c0 .carousel .wymd-carousel .carousel__slide {\n padding-bottom: 450px !important;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide .carousel__inner-slide > div:first-child {\n -webkit-transition: -webkit-transform 0.75s ease;\n -webkit-transition: transform 0.75s ease;\n transition: transform 0.75s ease;\n -webkit-transform: scale(0.5);\n -ms-transform: scale(0.5);\n transform: scale(0.5);\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide .carousel__inner-slide > div:first-child:after {\n -webkit-transition: -webkit-transform 0.75s ease,width 0.75s ease,right 0.75s ease;\n -webkit-transition: transform 0.75s ease,width 0.75s ease,right 0.75s ease;\n transition: transform 0.75s ease,width 0.75s ease,right 0.75s ease;\n right: calc(-300% - 6px);\n -webkit-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n width: 300%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide .carousel__inner-slide .all-text-wrapper {\n -webkit-transition: -webkit-transform 0.75s ease;\n -webkit-transition: transform 0.75s ease;\n transition: transform 0.75s ease;\n -webkit-transform-origin: top;\n -ms-transform-origin: top;\n transform-origin: top;\n -webkit-transform: translateY(calc(-45px + 5%)) scale(0.5);\n -ms-transform: translateY(calc(-45px + 5%)) scale(0.5);\n transform: translateY(calc(-45px + 5%)) scale(0.5);\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible .carousel__inner-slide > div:first-child:after {\n right: calc(-300% - 6px);\n -webkit-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n width: 300%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible .carousel__inner-slide > div:first-child {\n -webkit-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible .carousel__inner-slide > div:first-child:after {\n right: calc(-222% - 6px);\n -webkit-transform: scale(0.5);\n -ms-transform: scale(0.5);\n transform: scale(0.5);\n width: 300%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible .all-text-wrapper {\n -webkit-transform: translateY(0) scale(1);\n -ms-transform: translateY(0) scale(1);\n transform: translateY(0) scale(1);\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible + .carousel__slide--visible > div > div:first-child {\n -webkit-transform: scale(0.5);\n -ms-transform: scale(0.5);\n transform: scale(0.5);\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible + .carousel__slide--visible > div > div:first-child:after {\n right: calc(-300% - 6px);\n -webkit-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n width: 300%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible + .carousel__slide--visible .all-text-wrapper {\n -webkit-transform: translateY(calc(-45px + 5%)) scale(0.5);\n -ms-transform: translateY(calc(-45px + 5%)) scale(0.5);\n transform: translateY(calc(-45px + 5%)) scale(0.5);\n }\n }\n\n @media (min-width:1024px) {\n .c0 .carousel .wymd-carousel .carousel__slide {\n padding-bottom: 475px !important;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible .carousel__inner-slide > div:first-child:after {\n right: calc(-250% - 6px);\n width: 250%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible .carousel__inner-slide > div:first-child:after {\n right: calc(-187% - 6px);\n width: 250%;\n }\n\n .c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible + .carousel__slide--visible + .carousel__slide--visible .carousel__inner-slide > div:first-child:after {\n right: calc(-250% - 6px);\n width: 250%;\n }\n }\n\n <div\n className=\"c0 CarouselWrapper\"\n id=\"7zdR84QkZwrTh9NWx2H926\"\n >\n <p\n className=\"c1 c2\"\n color=\"inherit\"\n size=\"s\"\n >\n Over the past two years, we\u2019ve supported\n </p>\n <h1\n className=\"c3 c4\"\n color=\"red\"\n size=\"s\"\n >\n 11.7 million people\n </h1>\n <p\n className=\"c5 c6\"\n color=\"inherit\"\n size=\"s\"\n >\n including...\n </p>\n </div>\n ");
|
|
16
16
|
});
|
|
@@ -43,8 +43,8 @@ const testImpactSliderItems = exports.testImpactSliderItems = [{
|
|
|
43
43
|
const carouselItemsComplete = exports.carouselItemsComplete = {
|
|
44
44
|
__typename: 'ContentfulWhatYourMoneyDoesCarousel',
|
|
45
45
|
contentful_id: '7zdR84QkZwrTh9NWx2H926',
|
|
46
|
-
mobileHeight:
|
|
47
|
-
tabletHeight:
|
|
46
|
+
mobileHeight: 425,
|
|
47
|
+
tabletHeight: 450,
|
|
48
48
|
desktopHeight: 475,
|
|
49
49
|
headerCopy: 'Over the past two years, we’ve supported',
|
|
50
50
|
peopleHelpedText: '11.7 million people',
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ let window = '';
|
|
|
10
10
|
const Link = ({
|
|
11
11
|
children,
|
|
12
12
|
color,
|
|
13
|
+
mobileColour,
|
|
13
14
|
href,
|
|
14
15
|
target,
|
|
15
16
|
type,
|
|
@@ -54,6 +55,7 @@ const Link = ({
|
|
|
54
55
|
<StyledLink
|
|
55
56
|
{...rest}
|
|
56
57
|
color={color}
|
|
58
|
+
mobileColour={mobileColour}
|
|
57
59
|
href={href}
|
|
58
60
|
target={window}
|
|
59
61
|
type={type}
|
|
@@ -72,6 +74,7 @@ Link.propTypes = {
|
|
|
72
74
|
type: PropTypes.oneOf(['button', 'standard', 'standard_white']),
|
|
73
75
|
/** Color for button style link. See buttonColors in theme */
|
|
74
76
|
color: PropTypes.string,
|
|
77
|
+
mobileColour: PropTypes.string,
|
|
75
78
|
/** Link target */
|
|
76
79
|
target: PropTypes.string,
|
|
77
80
|
/** Set to true if link rel attribute should be home */
|
|
@@ -89,6 +92,7 @@ Link.propTypes = {
|
|
|
89
92
|
Link.defaultProps = {
|
|
90
93
|
type: 'standard',
|
|
91
94
|
color: 'red',
|
|
95
|
+
mobileColour: null,
|
|
92
96
|
target: null,
|
|
93
97
|
home: false,
|
|
94
98
|
underline: true,
|
|
@@ -40,12 +40,13 @@ import { External, Download, Favourite, Internal, Chevron, Arrow, AtSign } from
|
|
|
40
40
|
<div style={{ display: 'block', marginBottom: '10px' }}>
|
|
41
41
|
<Link
|
|
42
42
|
color="red"
|
|
43
|
+
mobileColour="blue"
|
|
43
44
|
href="#anchor"
|
|
44
45
|
target="blank"
|
|
45
46
|
type="button"
|
|
46
47
|
icon={<Internal colour="white" />}
|
|
47
48
|
>
|
|
48
|
-
Internal link
|
|
49
|
+
Internal link, 'blue' on tablet and mobile
|
|
49
50
|
</Link>
|
|
50
51
|
</div>
|
|
51
52
|
|
|
@@ -17,9 +17,18 @@ const buttonStyle = () => css`
|
|
|
17
17
|
align-items: center;
|
|
18
18
|
cursor: pointer;
|
|
19
19
|
${({ color, theme }) => (color ? theme.buttonColors(color) : theme.buttonColors('red'))};
|
|
20
|
+
|
|
21
|
+
// Override with mobile-specific colours where available:
|
|
22
|
+
${({ mobileColour, theme }) => (mobileColour ? theme.buttonColors(mobileColour) : null)};
|
|
23
|
+
|
|
20
24
|
@media ${({ theme }) => theme.breakpoint('small')} {
|
|
21
25
|
width: auto;
|
|
22
26
|
}
|
|
27
|
+
|
|
28
|
+
// Reinstate general styles for 'desktop':
|
|
29
|
+
@media ${({ theme }) => theme.breakpoint('medium')} {
|
|
30
|
+
${({ color, theme }) => (color ? theme.buttonColors(color) : theme.buttonColors('red'))};
|
|
31
|
+
}
|
|
23
32
|
`;
|
|
24
33
|
|
|
25
34
|
const linkStyle = () => css`
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
3
|
-
import renderWithTheme from
|
|
4
|
-
import Link from
|
|
5
|
-
import { Internal } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "jest-styled-components";
|
|
3
|
+
import renderWithTheme from "../../../hoc/shallowWithTheme";
|
|
4
|
+
import Link from "./Link";
|
|
5
|
+
import { Internal } from "../Icons/index";
|
|
6
6
|
|
|
7
|
-
it(
|
|
7
|
+
it("renders a standard styled link correctly", () => {
|
|
8
8
|
const tree = renderWithTheme(
|
|
9
9
|
<Link href="/test" type="standard">
|
|
10
10
|
A standard link
|
|
@@ -40,7 +40,7 @@ it('renders a standard styled link correctly', () => {
|
|
|
40
40
|
`);
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
it(
|
|
43
|
+
it("renders a button with an icon", () => {
|
|
44
44
|
const tree = renderWithTheme(
|
|
45
45
|
<Link
|
|
46
46
|
href="/test"
|
|
@@ -125,7 +125,7 @@ it('renders a button with an icon', () => {
|
|
|
125
125
|
`);
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
it(
|
|
128
|
+
it("renders a standard styled link correctly with target blank and assistive text", () => {
|
|
129
129
|
const tree = renderWithTheme(
|
|
130
130
|
<Link href="/test" type="standard" target="blank">
|
|
131
131
|
A standard link
|
|
@@ -181,7 +181,7 @@ it('renders a standard styled link correctly with target blank and assistive tex
|
|
|
181
181
|
`);
|
|
182
182
|
});
|
|
183
183
|
|
|
184
|
-
it(
|
|
184
|
+
it("renders link styled as button correctly", () => {
|
|
185
185
|
const tree = renderWithTheme(
|
|
186
186
|
<Link href="/test" type="button" color="yellow">
|
|
187
187
|
A yellow button
|
|
@@ -229,6 +229,18 @@ it('renders link styled as button correctly', () => {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
+
@media (min-width:1024px) {
|
|
233
|
+
.c0 {
|
|
234
|
+
background-color: #FFE400;
|
|
235
|
+
color: #000000;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.c0:hover {
|
|
239
|
+
background-color: #FEFD5A;
|
|
240
|
+
color: #000000;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
232
244
|
<a
|
|
233
245
|
className="c0"
|
|
234
246
|
color="yellow"
|
|
@@ -129,6 +129,18 @@ exports[`renders correctly 1`] = `
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
@media (min-width:1024px) {
|
|
133
|
+
.c7 {
|
|
134
|
+
background-color: #E52630;
|
|
135
|
+
color: #FFFFFF;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.c7:hover {
|
|
139
|
+
background-color: #890B11;
|
|
140
|
+
color: #FFFFFF;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
132
144
|
@media (min-width:740px) {
|
|
133
145
|
.c0 {
|
|
134
146
|
-webkit-flex-direction: row;
|
|
@@ -159,6 +159,18 @@ exports[`renders Promo correctly 1`] = `
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
@media (min-width:1024px) {
|
|
163
|
+
.c9 {
|
|
164
|
+
background-color: #FFFFFF;
|
|
165
|
+
color: #000000;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.c9:hover {
|
|
169
|
+
background-color: #969598;
|
|
170
|
+
color: #000000;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
162
174
|
@media (min-width:1024px) {
|
|
163
175
|
.c0 {
|
|
164
176
|
-webkit-flex-direction: row;
|
|
@@ -425,6 +437,18 @@ exports[`renders Promo correctly end position 1`] = `
|
|
|
425
437
|
}
|
|
426
438
|
}
|
|
427
439
|
|
|
440
|
+
@media (min-width:1024px) {
|
|
441
|
+
.c9 {
|
|
442
|
+
background-color: #FFFFFF;
|
|
443
|
+
color: #000000;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.c9:hover {
|
|
447
|
+
background-color: #969598;
|
|
448
|
+
color: #000000;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
428
452
|
@media (min-width:1024px) {
|
|
429
453
|
.c0 {
|
|
430
454
|
-webkit-flex-direction: row;
|
|
@@ -284,6 +284,18 @@ exports[`renders Single Message with Image correctly 1`] = `
|
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
+
@media (min-width:1024px) {
|
|
288
|
+
.c8 {
|
|
289
|
+
background-color: #FFFFFF;
|
|
290
|
+
color: #000000;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.c8:hover {
|
|
294
|
+
background-color: #969598;
|
|
295
|
+
color: #000000;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
287
299
|
@media (min-width:740px) {
|
|
288
300
|
.c0 {
|
|
289
301
|
-webkit-flex-direction: row;
|
|
@@ -730,6 +742,18 @@ exports[`renders Single Message with full width correctly 1`] = `
|
|
|
730
742
|
}
|
|
731
743
|
}
|
|
732
744
|
|
|
745
|
+
@media (min-width:1024px) {
|
|
746
|
+
.c8 {
|
|
747
|
+
background-color: #FFFFFF;
|
|
748
|
+
color: #000000;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.c8:hover {
|
|
752
|
+
background-color: #969598;
|
|
753
|
+
color: #000000;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
733
757
|
@media (min-width:740px) {
|
|
734
758
|
.c0 {
|
|
735
759
|
-webkit-flex-direction: row;
|
|
@@ -920,6 +944,10 @@ exports[`renders Single Message with full width image and no text correctly 1`]
|
|
|
920
944
|
|
|
921
945
|
}
|
|
922
946
|
|
|
947
|
+
@media (min-width:1024px) {
|
|
948
|
+
|
|
949
|
+
}
|
|
950
|
+
|
|
923
951
|
@media (min-width:740px) {
|
|
924
952
|
.c0 {
|
|
925
953
|
-webkit-flex-direction: row;
|
|
@@ -1042,6 +1070,10 @@ exports[`renders Single Message with no Image correctly 1`] = `
|
|
|
1042
1070
|
|
|
1043
1071
|
}
|
|
1044
1072
|
|
|
1073
|
+
@media (min-width:1024px) {
|
|
1074
|
+
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1045
1077
|
@media (min-width:740px) {
|
|
1046
1078
|
.c0 {
|
|
1047
1079
|
-webkit-flex-direction: row;
|
|
@@ -163,6 +163,18 @@ exports[`renders correctly 1`] = `
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
@media (min-width:1024px) {
|
|
167
|
+
.c11 {
|
|
168
|
+
background-color: #2042AD;
|
|
169
|
+
color: #FFFFFF;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.c11:hover {
|
|
173
|
+
background-color: #274084;
|
|
174
|
+
color: #FFFFFF;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
166
178
|
@media (min-width:740px) {
|
|
167
179
|
.c0 {
|
|
168
180
|
-webkit-flex-direction: row;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
3
|
-
import renderWithTheme from
|
|
4
|
-
import CookieBanner from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "jest-styled-components";
|
|
3
|
+
import renderWithTheme from "../../../hoc/shallowWithTheme";
|
|
4
|
+
import CookieBanner from "./CookieBanner";
|
|
5
5
|
|
|
6
|
-
it(
|
|
6
|
+
it("renders correctly", () => {
|
|
7
7
|
const tree = renderWithTheme(
|
|
8
8
|
<CookieBanner
|
|
9
|
-
acceptCookie={e => {
|
|
9
|
+
acceptCookie={(e) => {
|
|
10
10
|
e.preventDefault();
|
|
11
|
-
return
|
|
11
|
+
return "User accept";
|
|
12
12
|
}}
|
|
13
|
-
denyCookie={e => {
|
|
13
|
+
denyCookie={(e) => {
|
|
14
14
|
e.preventDefault();
|
|
15
|
-
return
|
|
15
|
+
return "User does not accept cookies";
|
|
16
16
|
}}
|
|
17
17
|
cookiePolicyUrl="https://www.comicrelief.com/cookies-policy"
|
|
18
18
|
/>
|
|
@@ -119,6 +119,18 @@ it('renders correctly', () => {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
@media (min-width:1024px) {
|
|
123
|
+
.c5 {
|
|
124
|
+
background-color: #FFFFFF;
|
|
125
|
+
color: #000000;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.c5:hover {
|
|
129
|
+
background-color: #969598;
|
|
130
|
+
color: #000000;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
122
134
|
@media (min-width:740px) {
|
|
123
135
|
.c2 {
|
|
124
136
|
width: 75%;
|
|
@@ -161,7 +161,6 @@ const CarouselWrapper = styled.div`
|
|
|
161
161
|
rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
|
|
165
164
|
&:hover {
|
|
166
165
|
&:after {
|
|
167
166
|
opacity: 0.5;
|
|
@@ -207,18 +206,13 @@ const CarouselWrapper = styled.div`
|
|
|
207
206
|
}
|
|
208
207
|
|
|
209
208
|
.carousel__slide {
|
|
209
|
+
// 'Mobile'
|
|
210
210
|
padding-bottom: ${props => props.mobileHeight}px !important;
|
|
211
211
|
|
|
212
|
+
// 'Tablet' (and up) tweaks for the 3-visible layout
|
|
212
213
|
@media ${({ theme }) => theme.breakpoint('small')} {
|
|
213
|
-
padding-bottom: ${props => props.tabletHeight}px !important;
|
|
214
|
-
}
|
|
215
214
|
|
|
216
|
-
@media ${({ theme }) => theme.breakpoint('medium')} {
|
|
217
215
|
padding-bottom: ${props => props.tabletHeight}px !important;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
@media ${({ theme }) => theme.breakpoint('small')} {
|
|
221
|
-
padding-bottom: ${props => props.desktopHeight}px !important;
|
|
222
216
|
|
|
223
217
|
// All slides:
|
|
224
218
|
.carousel__inner-slide {
|
|
@@ -258,7 +252,6 @@ const CarouselWrapper = styled.div`
|
|
|
258
252
|
}
|
|
259
253
|
}
|
|
260
254
|
|
|
261
|
-
|
|
262
255
|
// 2nd and 3rd:
|
|
263
256
|
+ .carousel__slide--visible {
|
|
264
257
|
.carousel__inner-slide {
|
|
@@ -294,9 +287,9 @@ const CarouselWrapper = styled.div`
|
|
|
294
287
|
}
|
|
295
288
|
}
|
|
296
289
|
|
|
297
|
-
//
|
|
298
|
-
// START OF DESKTOP
|
|
290
|
+
// 'Desktop'
|
|
299
291
|
@media ${({ theme }) => theme.breakpoint('medium')} {
|
|
292
|
+
padding-bottom: ${props => props.desktopHeight}px !important;
|
|
300
293
|
|
|
301
294
|
// First
|
|
302
295
|
&.carousel__slide--visible {
|
|
@@ -149,7 +149,7 @@ it("renders correctly", () => {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
.c0 .carousel .wymd-carousel .carousel__slide {
|
|
152
|
-
padding-bottom:
|
|
152
|
+
padding-bottom: 425px !important;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
.c0 .carousel .wymd-carousel .carousel__slide .carousel__inner-slide {
|
|
@@ -219,19 +219,7 @@ it("renders correctly", () => {
|
|
|
219
219
|
|
|
220
220
|
@media (min-width:740px) {
|
|
221
221
|
.c0 .carousel .wymd-carousel .carousel__slide {
|
|
222
|
-
padding-bottom:
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
@media (min-width:1024px) {
|
|
227
|
-
.c0 .carousel .wymd-carousel .carousel__slide {
|
|
228
|
-
padding-bottom: 500px !important;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
@media (min-width:740px) {
|
|
233
|
-
.c0 .carousel .wymd-carousel .carousel__slide {
|
|
234
|
-
padding-bottom: 475px !important;
|
|
222
|
+
padding-bottom: 450px !important;
|
|
235
223
|
}
|
|
236
224
|
|
|
237
225
|
.c0 .carousel .wymd-carousel .carousel__slide .carousel__inner-slide > div:first-child {
|
|
@@ -316,6 +304,10 @@ it("renders correctly", () => {
|
|
|
316
304
|
}
|
|
317
305
|
|
|
318
306
|
@media (min-width:1024px) {
|
|
307
|
+
.c0 .carousel .wymd-carousel .carousel__slide {
|
|
308
|
+
padding-bottom: 475px !important;
|
|
309
|
+
}
|
|
310
|
+
|
|
319
311
|
.c0 .carousel .wymd-carousel .carousel__slide.carousel__slide--visible .carousel__inner-slide > div:first-child:after {
|
|
320
312
|
right: calc(-250% - 6px);
|
|
321
313
|
width: 250%;
|
|
@@ -52,8 +52,8 @@ const testImpactSliderItems = [
|
|
|
52
52
|
const carouselItemsComplete = {
|
|
53
53
|
__typename: 'ContentfulWhatYourMoneyDoesCarousel',
|
|
54
54
|
contentful_id: '7zdR84QkZwrTh9NWx2H926',
|
|
55
|
-
mobileHeight:
|
|
56
|
-
tabletHeight:
|
|
55
|
+
mobileHeight: 425,
|
|
56
|
+
tabletHeight: 450,
|
|
57
57
|
desktopHeight: 475,
|
|
58
58
|
headerCopy: 'Over the past two years, we’ve supported',
|
|
59
59
|
peopleHelpedText: '11.7 million people',
|