@comicrelief/component-library 8.20.1 → 8.22.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.test.js +4 -4
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +2 -2
- package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +1 -1
- package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +3 -3
- package/dist/components/Organisms/Footer/Footer.js +3 -1
- package/dist/components/Organisms/Footer/Footer.md +2 -1
- package/dist/components/Organisms/Footer/Footer.style.js +1 -1
- package/dist/components/Organisms/Footer/FundraisingRegulatorLogo.js +31 -0
- package/dist/components/Organisms/Footer/Nav/Nav.style.js +20 -14
- package/dist/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +3 -3
- package/package.json +1 -1
- package/src/components/Atoms/Link/Link.test.js +9 -9
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +7 -7
- package/src/components/Molecules/PartnerLink/PartnerLink.test.js +7 -7
- package/src/components/Organisms/CookieBanner/CookieBanner.test.js +7 -7
- package/src/components/Organisms/Footer/Footer.js +8 -2
- package/src/components/Organisms/Footer/Footer.md +2 -1
- package/src/components/Organisms/Footer/Footer.style.js +1 -1
- package/src/components/Organisms/Footer/FundraisingRegulatorLogo.js +25 -0
- package/src/components/Organisms/Footer/Nav/Nav.style.js +3 -2
- package/src/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +3 -3
|
@@ -6,14 +6,14 @@ require("jest-styled-components");
|
|
|
6
6
|
var _shallowWithTheme = _interopRequireDefault(require("../../../../tests/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 .c2 {\n fill: #FFFFFF;\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 @media (min-width:1024px) {\n .c2 {\n fill: #FFFFFF;\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 className=\"c2\"\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,7 +32,7 @@ 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",
|
|
@@ -6,7 +6,7 @@ require("jest-styled-components");
|
|
|
6
6
|
var _shallowWithTheme = _interopRequireDefault(require("../../../../tests/hoc/shallowWithTheme"));
|
|
7
7
|
var _ArticleTeaser = _interopRequireDefault(require("./ArticleTeaser"));
|
|
8
8
|
var _data = require("../../../styleguide/data/data");
|
|
9
|
-
it(
|
|
9
|
+
it('renders article teaser correctly', () => {
|
|
10
10
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_ArticleTeaser.default, {
|
|
11
11
|
href: "/test",
|
|
12
12
|
images: _data.defaultData.images,
|
|
@@ -20,7 +20,7 @@ it("renders article teaser correctly", () => {
|
|
|
20
20
|
})).toJSON();
|
|
21
21
|
expect(tree).toMatchInlineSnapshot("\n .c8 {\n font-size: 0.75rem;\n line-height: 0.75rem;\n text-transform: inherit;\n font-weight: bold;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c10 {\n font-size: 2rem;\n line-height: 2rem;\n text-transform: uppercase;\n font-weight: normal;\n line-height: 2rem;\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 .c4 {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n .c6 {\n width: 100%;\n height: 100%;\n display: block;\n object-fit: cover;\n }\n\n .c1 {\n position: relative;\n -webkit-text-decoration: none;\n text-decoration: none;\n display: inline;\n line-height: 1.5rem;\n color: #000000;\n font-weight: normal;\n }\n\n .c1:hover {\n color: #000000;\n }\n\n .c0 {\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n background-color: #FFFFFF;\n border-radius: 1rem;\n box-shadow: 0px 0px 20px rgba(0,0,0,0.15);\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n }\n\n .c0:hover {\n box-shadow: 0px 0px 20px rgba(0,0,0,0.3);\n -webkit-transform: translateY(-4px);\n -ms-transform: translateY(-4px);\n transform: translateY(-4px);\n }\n\n .c2 {\n padding: 0;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n height: 100%;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-text-decoration: none;\n text-decoration: none;\n color: inherit;\n width: 100%;\n }\n\n .c3 {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n position: relative;\n }\n\n .c3 img {\n border-radius: 1rem 1rem 0 0;\n }\n\n .c7 {\n padding: 2rem;\n height: 100%;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n .c11 {\n margin: 0;\n }\n\n .c9 {\n display: block;\n margin-bottom: 1rem;\n }\n\n .c5 {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n }\n\n @media (min-width:740px) {\n .c2 {\n -webkit-flex-direction: row;\n -ms-flex-direction: row;\n flex-direction: row;\n }\n }\n\n @media (min-width:1024px) {\n .c2 {\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n }\n\n @media (min-width:740px) {\n .c3 {\n width: 45%;\n }\n\n .c3 img {\n border-radius: 1rem 0 0 1rem;\n }\n }\n\n @media (min-width:1024px) {\n .c3 {\n width: 100%;\n }\n\n .c3 img {\n border-radius: 1rem 1rem 0 0;\n }\n }\n\n @media (min-width:740px) {\n .c7 {\n width: 55%;\n }\n }\n\n @media (min-width:1024px) {\n .c7 {\n width: 100%;\n }\n }\n\n <article\n className=\"c0\"\n >\n <a\n className=\"c1 c2\"\n color=\"red\"\n href=\"/test\"\n target=\"_self\"\n type=\"standard\"\n >\n <div\n className=\"c3\"\n >\n <div\n className=\"c4 c5\"\n height=\"100%\"\n width=\"100%\"\n >\n <img\n alt=\"Image's description\"\n className=\"c6 lazyload\"\n data-lowsrc={null}\n data-sizes=\"auto\"\n data-src=\"http://images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg\"\n data-srcset=\"//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=200&h=150&q=50 200w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=400&h=300&q=50 400w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=800&h=600&q=50 800w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=1200&h=900&q=50 1200w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=1440&h=1080&q=50 1440w\"\n height=\"100%\"\n src=\"http://images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg\"\n srcSet=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n width=\"100%\"\n />\n </div>\n </div>\n <div\n className=\"c7\"\n >\n <span\n className=\"c8 c9\"\n color=\"inherit\"\n size=\"xs\"\n >\n 01 July 2019\n </span>\n <h3\n className=\"c10 c11\"\n color=\"inherit\"\n height=\"2rem\"\n size=\"xl\"\n >\n News article\n </h3>\n </div>\n </a>\n </article>\n ");
|
|
22
22
|
});
|
|
23
|
-
it(
|
|
23
|
+
it('renders press realese correctly', () => {
|
|
24
24
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_ArticleTeaser.default, {
|
|
25
25
|
href: "/test",
|
|
26
26
|
category: "",
|
|
@@ -7,7 +7,7 @@ var _shallowWithTheme = _interopRequireDefault(require("../../../../tests/hoc/sh
|
|
|
7
7
|
var _PartnerLink = _interopRequireDefault(require("./PartnerLink"));
|
|
8
8
|
var _Picture = _interopRequireDefault(require("../../Atoms/Picture/Picture"));
|
|
9
9
|
var _data = require("../../../styleguide/data/data");
|
|
10
|
-
it(
|
|
10
|
+
it('renders correctly', () => {
|
|
11
11
|
const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_PartnerLink.default, {
|
|
12
12
|
link: "https://www.comicrelief.com"
|
|
13
13
|
}, /*#__PURE__*/_react.default.createElement(_Picture.default, {
|
|
@@ -5,15 +5,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
5
5
|
require("jest-styled-components");
|
|
6
6
|
var _shallowWithTheme = _interopRequireDefault(require("../../../../tests/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();
|
|
@@ -10,6 +10,7 @@ var _Text = _interopRequireDefault(require("../../Atoms/Text/Text"));
|
|
|
10
10
|
var _Logo = _interopRequireDefault(require("../../Atoms/Logo/Logo"));
|
|
11
11
|
var _Nav = _interopRequireDefault(require("./Nav/Nav"));
|
|
12
12
|
var _SocialIcons = _interopRequireDefault(require("../../Atoms/SocialIcons/SocialIcons"));
|
|
13
|
+
var _FundraisingRegulatorLogo = _interopRequireDefault(require("./FundraisingRegulatorLogo"));
|
|
13
14
|
var _Footer = require("./Footer.style");
|
|
14
15
|
const Footer = _ref => {
|
|
15
16
|
let {
|
|
@@ -18,6 +19,7 @@ const Footer = _ref => {
|
|
|
18
19
|
campaign = 'Comic Relief',
|
|
19
20
|
additionalLegalLine = '',
|
|
20
21
|
overrideallowList = false,
|
|
22
|
+
showFundraisingRegulatorLogo = false,
|
|
21
23
|
...rest
|
|
22
24
|
} = _ref;
|
|
23
25
|
// Remove white space between words
|
|
@@ -40,7 +42,7 @@ const Footer = _ref => {
|
|
|
40
42
|
}))), /*#__PURE__*/_react.default.createElement(_Nav.default, Object.assign({
|
|
41
43
|
navItems: navItems,
|
|
42
44
|
overrideallowList: overrideallowList
|
|
43
|
-
}, rest)), /*#__PURE__*/_react.default.createElement(_Footer.FooterCopyright, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
45
|
+
}, rest)), showFundraisingRegulatorLogo && /*#__PURE__*/_react.default.createElement(_FundraisingRegulatorLogo.default, null), /*#__PURE__*/_react.default.createElement(_Footer.FooterCopyright, null, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
44
46
|
tag: "p",
|
|
45
47
|
color: "grey"
|
|
46
48
|
}, footerCopy)))));
|
|
@@ -16,12 +16,13 @@ import footerCopy from './data/footerCopy';
|
|
|
16
16
|
overrideallowList
|
|
17
17
|
/>
|
|
18
18
|
|
|
19
|
-
<p>Adding a additionalLegalLine to the top of the footer</p>
|
|
19
|
+
<p>Adding a additionalLegalLine to the top of the footer, add FR logo</p>
|
|
20
20
|
<Footer
|
|
21
21
|
additionalLegalLine="CHICKEN RUN: DAWN OF THE NUGGET ™/ © Aardman. Netflix ™/© Netflix. Used with permission/Wallace & Gromit Ltd. All rights reserved/ Shaun the Sheep © & TM /Morph ©/TM Aardman Animations Ltd. All rights reserved."
|
|
22
22
|
navItems={data}
|
|
23
23
|
footerCopy={footerCopy.copy}
|
|
24
24
|
campaign="Comic Relief"
|
|
25
|
+
showFundraisingRegulatorLogo
|
|
25
26
|
/>
|
|
26
27
|
</>
|
|
27
28
|
```
|
|
@@ -49,7 +49,7 @@ const FooterBranding = exports.FooterBranding = _styledComponents.default.div.wi
|
|
|
49
49
|
const FooterCopyright = exports.FooterCopyright = _styledComponents.default.div.withConfig({
|
|
50
50
|
displayName: "Footerstyle__FooterCopyright",
|
|
51
51
|
componentId: "sc-167xaf5-5"
|
|
52
|
-
})(["display:block;width:100%;height:100%;text-align:left;margin-top:
|
|
52
|
+
})(["display:block;width:100%;height:100%;text-align:left;margin-top:0;p{font-size:15px;line-height:24px;margin-bottom:5px;@media ", "{font-size:16px;line-height:27px;}}"], _ref4 => {
|
|
53
53
|
let {
|
|
54
54
|
theme
|
|
55
55
|
} = _ref4;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _spacing = _interopRequireDefault(require("../../../theme/shared/spacing"));
|
|
11
|
+
const FundraisingRegulatorWrapper = _styledComponents.default.div.withConfig({
|
|
12
|
+
displayName: "FundraisingRegulatorLogo__FundraisingRegulatorWrapper",
|
|
13
|
+
componentId: "sc-1uvaky7-0"
|
|
14
|
+
})(["width:75%;margin:", " 0;max-width:200px;img{display:block;}"], (0, _spacing.default)('lg'));
|
|
15
|
+
const FundraisingRegulatorLogo = () => /*#__PURE__*/_react.default.createElement(FundraisingRegulatorWrapper, null, /*#__PURE__*/_react.default.createElement("a", {
|
|
16
|
+
href: "https://www.fundraisingregulator.org.uk/validate?registrant=COMIC+RELIEF",
|
|
17
|
+
className: "fr-digital-badge",
|
|
18
|
+
style: {
|
|
19
|
+
height: 'auto',
|
|
20
|
+
width: '150px',
|
|
21
|
+
textDecoration: 'none'
|
|
22
|
+
},
|
|
23
|
+
target: "_blank",
|
|
24
|
+
rel: "noreferrer"
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
26
|
+
src: "https://www.fundraisingregulator.org.uk/fr-badge/80983ed7-ea80-40db-8e52-4a3351d9e77d/en/white",
|
|
27
|
+
width: "100%",
|
|
28
|
+
alt: "Fundraising Regulator badge with validation link",
|
|
29
|
+
loading: "lazy"
|
|
30
|
+
})));
|
|
31
|
+
var _default = exports.default = FundraisingRegulatorLogo;
|
|
@@ -8,6 +8,7 @@ exports.SubNavMenu = exports.SubNavLink = exports.SubNavItem = exports.NavMenu =
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
var _Link = _interopRequireDefault(require("../../../Atoms/Link/Link"));
|
|
10
10
|
var _hideVisually = _interopRequireDefault(require("../../../../theme/shared/hideVisually"));
|
|
11
|
+
var _spacing = _interopRequireDefault(require("../../../../theme/shared/spacing"));
|
|
11
12
|
const NavLinkClass = (0, _styledComponents.default)(_Link.default).withConfig({
|
|
12
13
|
displayName: "Navstyle__NavLinkClass",
|
|
13
14
|
componentId: "sc-uzf5hs-0"
|
|
@@ -96,10 +97,15 @@ const SubNavLink = exports.SubNavLink = (0, _styledComponents.default)(NavLinkCl
|
|
|
96
97
|
const NavMenu = exports.NavMenu = _styledComponents.default.ul.withConfig({
|
|
97
98
|
displayName: "Navstyle__NavMenu",
|
|
98
99
|
componentId: "sc-uzf5hs-5"
|
|
99
|
-
})(["background-color:inherit;list-style:none outside;padding:0;
|
|
100
|
+
})(["background-color:inherit;list-style:none outside;padding:0 0 ", ";border-bottom:1px solid ", ";@media ", "{display:flex;flex-wrap:wrap;justify-content:start;}"], (0, _spacing.default)('xl'), _ref10 => {
|
|
100
101
|
let {
|
|
101
102
|
theme
|
|
102
103
|
} = _ref10;
|
|
104
|
+
return theme.color('white');
|
|
105
|
+
}, _ref11 => {
|
|
106
|
+
let {
|
|
107
|
+
theme
|
|
108
|
+
} = _ref11;
|
|
103
109
|
return theme.allBreakpoints('M');
|
|
104
110
|
});
|
|
105
111
|
|
|
@@ -117,39 +123,39 @@ const NavLink = exports.NavLink = (0, _styledComponents.default)(NavLinkClass).w
|
|
|
117
123
|
const NavItem = exports.NavItem = _styledComponents.default.li.withConfig({
|
|
118
124
|
displayName: "Navstyle__NavItem",
|
|
119
125
|
componentId: "sc-uzf5hs-7"
|
|
120
|
-
})(["position:relative;font-weight:700;margin:0;margin-bottom:1rem;@media ", "{flex:0 0 30%;margin:0;}@media ", "{flex:0 0 calc(25% - 1rem);margin-right:1rem;margin-bottom:1rem;> span{padding:0;}}a{width:auto;padding:0;height:auto;position:relative;background-color:inherit;font-size:19px;line-height:40px;font-weight:800;@media ", "{font-size:20px;line-height:40px;}&:after{content:'\\2303';position:absolute;font-family:Arial;margin-left:4px;overflow:hidden;line-height:19px;font-size:23px;color:", ";font-weight:100;transition:transform 0.2s ease;transform:", ";top:", ";right:-25px;}@media ", "{cursor:default;display:inline;&:after{content:none;}}}"],
|
|
121
|
-
let {
|
|
122
|
-
theme
|
|
123
|
-
} = _ref11;
|
|
124
|
-
return theme.allBreakpoints('M');
|
|
125
|
-
}, _ref12 => {
|
|
126
|
+
})(["position:relative;font-weight:700;margin:0;margin-bottom:1rem;@media ", "{flex:0 0 30%;margin:0;}@media ", "{flex:0 0 calc(25% - 1rem);margin-right:1rem;margin-bottom:1rem;> span{padding:0;}}a{width:auto;padding:0;height:auto;position:relative;background-color:inherit;font-size:19px;line-height:40px;font-weight:800;@media ", "{font-size:20px;line-height:40px;}&:after{content:'\\2303';position:absolute;font-family:Arial;margin-left:4px;overflow:hidden;line-height:19px;font-size:23px;color:", ";font-weight:100;transition:transform 0.2s ease;transform:", ";top:", ";right:-25px;}@media ", "{cursor:default;display:inline;&:after{content:none;}}}"], _ref12 => {
|
|
126
127
|
let {
|
|
127
128
|
theme
|
|
128
129
|
} = _ref12;
|
|
129
|
-
return theme.allBreakpoints('
|
|
130
|
+
return theme.allBreakpoints('M');
|
|
130
131
|
}, _ref13 => {
|
|
131
132
|
let {
|
|
132
133
|
theme
|
|
133
134
|
} = _ref13;
|
|
134
|
-
return theme.allBreakpoints('
|
|
135
|
+
return theme.allBreakpoints('L');
|
|
135
136
|
}, _ref14 => {
|
|
136
137
|
let {
|
|
137
138
|
theme
|
|
138
139
|
} = _ref14;
|
|
139
|
-
return theme.
|
|
140
|
+
return theme.allBreakpoints('M');
|
|
140
141
|
}, _ref15 => {
|
|
141
142
|
let {
|
|
142
|
-
|
|
143
|
+
theme
|
|
143
144
|
} = _ref15;
|
|
144
|
-
return
|
|
145
|
+
return theme.color('white');
|
|
145
146
|
}, _ref16 => {
|
|
146
147
|
let {
|
|
147
148
|
isSubMenuOpen
|
|
148
149
|
} = _ref16;
|
|
149
|
-
return isSubMenuOpen ? '
|
|
150
|
+
return isSubMenuOpen ? 'rotate(0deg)' : 'rotate(180deg)';
|
|
150
151
|
}, _ref17 => {
|
|
151
152
|
let {
|
|
152
|
-
|
|
153
|
+
isSubMenuOpen
|
|
153
154
|
} = _ref17;
|
|
155
|
+
return isSubMenuOpen ? '6px' : '0';
|
|
156
|
+
}, _ref18 => {
|
|
157
|
+
let {
|
|
158
|
+
theme
|
|
159
|
+
} = _ref18;
|
|
154
160
|
return theme.allBreakpoints('M');
|
|
155
161
|
});
|
|
@@ -239,8 +239,8 @@ exports[`renders correctly 1`] = `
|
|
|
239
239
|
.c13 {
|
|
240
240
|
background-color: inherit;
|
|
241
241
|
list-style: none outside;
|
|
242
|
-
padding: 0;
|
|
243
|
-
|
|
242
|
+
padding: 0 0 4rem;
|
|
243
|
+
border-bottom: 1px solid #FFFFFF;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
.c14 {
|
|
@@ -320,7 +320,7 @@ exports[`renders correctly 1`] = `
|
|
|
320
320
|
width: 100%;
|
|
321
321
|
height: 100%;
|
|
322
322
|
text-align: left;
|
|
323
|
-
margin-top:
|
|
323
|
+
margin-top: 0;
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
.c24 p {
|
package/package.json
CHANGED
|
@@ -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 '../../../../tests/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"
|
|
@@ -136,7 +136,7 @@ it("renders a button with an icon", () => {
|
|
|
136
136
|
`);
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
-
it(
|
|
139
|
+
it('renders a standard styled link correctly with target blank and assistive text', () => {
|
|
140
140
|
const tree = renderWithTheme(
|
|
141
141
|
<Link href="/test" type="standard" target="blank">
|
|
142
142
|
A standard link
|
|
@@ -192,7 +192,7 @@ it("renders a standard styled link correctly with target blank and assistive tex
|
|
|
192
192
|
`);
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
-
it(
|
|
195
|
+
it('renders link styled as button correctly', () => {
|
|
196
196
|
const tree = renderWithTheme(
|
|
197
197
|
<Link href="/test" type="button" color="yellow">
|
|
198
198
|
A yellow button
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
3
|
-
import renderWithTheme from
|
|
4
|
-
import ArticleTeaser from
|
|
5
|
-
import { defaultData } from
|
|
6
|
-
it(
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'jest-styled-components';
|
|
3
|
+
import renderWithTheme from '../../../../tests/hoc/shallowWithTheme';
|
|
4
|
+
import ArticleTeaser from './ArticleTeaser';
|
|
5
|
+
import { defaultData } from '../../../styleguide/data/data';
|
|
6
|
+
it('renders article teaser correctly', () => {
|
|
7
7
|
const tree = renderWithTheme(
|
|
8
8
|
<ArticleTeaser
|
|
9
9
|
href="/test"
|
|
@@ -258,7 +258,7 @@ it("renders article teaser correctly", () => {
|
|
|
258
258
|
`);
|
|
259
259
|
});
|
|
260
260
|
|
|
261
|
-
it(
|
|
261
|
+
it('renders press realese correctly', () => {
|
|
262
262
|
const tree = renderWithTheme(
|
|
263
263
|
<ArticleTeaser
|
|
264
264
|
href="/test"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'jest-styled-components';
|
|
3
3
|
|
|
4
|
-
import renderWithTheme from
|
|
5
|
-
import PartnerLink from
|
|
6
|
-
import Picture from
|
|
7
|
-
import { defaultData } from
|
|
8
|
-
it(
|
|
4
|
+
import renderWithTheme from '../../../../tests/hoc/shallowWithTheme';
|
|
5
|
+
import PartnerLink from './PartnerLink';
|
|
6
|
+
import Picture from '../../Atoms/Picture/Picture';
|
|
7
|
+
import { defaultData } from '../../../styleguide/data/data';
|
|
8
|
+
it('renders correctly', () => {
|
|
9
9
|
const tree = renderWithTheme(
|
|
10
10
|
<PartnerLink link="https://www.comicrelief.com">
|
|
11
11
|
<Picture
|
|
@@ -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 '../../../../tests/hoc/shallowWithTheme';
|
|
4
|
+
import CookieBanner from './CookieBanner';
|
|
5
5
|
|
|
6
|
-
it(
|
|
6
|
+
it('renders correctly', () => {
|
|
7
7
|
const tree = renderWithTheme(
|
|
8
8
|
<CookieBanner
|
|
9
9
|
acceptCookie={(e) => {
|
|
10
10
|
e.preventDefault();
|
|
11
|
-
return
|
|
11
|
+
return 'User accept';
|
|
12
12
|
}}
|
|
13
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
|
/>
|
|
@@ -4,6 +4,7 @@ import Text from '../../Atoms/Text/Text';
|
|
|
4
4
|
import Logo from '../../Atoms/Logo/Logo';
|
|
5
5
|
import FooterNav from './Nav/Nav';
|
|
6
6
|
import SocialIcons from '../../Atoms/SocialIcons/SocialIcons';
|
|
7
|
+
import FundraisingRegulatorLogo from './FundraisingRegulatorLogo';
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
FooterWrapper,
|
|
@@ -16,7 +17,7 @@ import {
|
|
|
16
17
|
} from './Footer.style';
|
|
17
18
|
|
|
18
19
|
const Footer = ({
|
|
19
|
-
navItems = {}, footerCopy = '', campaign = 'Comic Relief', additionalLegalLine = '', overrideallowList = false, ...rest
|
|
20
|
+
navItems = {}, footerCopy = '', campaign = 'Comic Relief', additionalLegalLine = '', overrideallowList = false, showFundraisingRegulatorLogo = false, ...rest
|
|
20
21
|
}) => {
|
|
21
22
|
// Remove white space between words
|
|
22
23
|
const campaignName = campaign.replace(/\s/g, '').toLowerCase();
|
|
@@ -32,11 +33,15 @@ const Footer = ({
|
|
|
32
33
|
<SocialIconWrapper>
|
|
33
34
|
<SocialIcons campaign={campaignName} />
|
|
34
35
|
</SocialIconWrapper>
|
|
36
|
+
|
|
35
37
|
<Brand href="/" title={`Go to ${campaign} homepage`}>
|
|
36
38
|
<Logo sizeSm="48px" sizeMd="72px" rotate={false} campaign={campaign} />
|
|
37
39
|
</Brand>
|
|
38
40
|
</FooterBranding>
|
|
39
41
|
<FooterNav navItems={navItems} overrideallowList={overrideallowList} {...rest} />
|
|
42
|
+
|
|
43
|
+
{ showFundraisingRegulatorLogo && <FundraisingRegulatorLogo /> }
|
|
44
|
+
|
|
40
45
|
<FooterCopyright>
|
|
41
46
|
<Text tag="p" color="grey">
|
|
42
47
|
{footerCopy}
|
|
@@ -53,7 +58,8 @@ Footer.propTypes = {
|
|
|
53
58
|
footerCopy: PropTypes.string,
|
|
54
59
|
campaign: PropTypes.string,
|
|
55
60
|
overrideallowList: PropTypes.bool,
|
|
56
|
-
additionalLegalLine: PropTypes.string
|
|
61
|
+
additionalLegalLine: PropTypes.string,
|
|
62
|
+
showFundraisingRegulatorLogo: PropTypes.bool
|
|
57
63
|
};
|
|
58
64
|
|
|
59
65
|
export default Footer;
|
|
@@ -16,12 +16,13 @@ import footerCopy from './data/footerCopy';
|
|
|
16
16
|
overrideallowList
|
|
17
17
|
/>
|
|
18
18
|
|
|
19
|
-
<p>Adding a additionalLegalLine to the top of the footer</p>
|
|
19
|
+
<p>Adding a additionalLegalLine to the top of the footer, add FR logo</p>
|
|
20
20
|
<Footer
|
|
21
21
|
additionalLegalLine="CHICKEN RUN: DAWN OF THE NUGGET ™/ © Aardman. Netflix ™/© Netflix. Used with permission/Wallace & Gromit Ltd. All rights reserved/ Shaun the Sheep © & TM /Morph ©/TM Aardman Animations Ltd. All rights reserved."
|
|
22
22
|
navItems={data}
|
|
23
23
|
footerCopy={footerCopy.copy}
|
|
24
24
|
campaign="Comic Relief"
|
|
25
|
+
showFundraisingRegulatorLogo
|
|
25
26
|
/>
|
|
26
27
|
</>
|
|
27
28
|
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import spacing from '../../../theme/shared/spacing';
|
|
4
|
+
|
|
5
|
+
const FundraisingRegulatorWrapper = styled.div`
|
|
6
|
+
// Overriding the baked-in styles for ease of update
|
|
7
|
+
width: 75%;
|
|
8
|
+
margin: ${spacing('lg')} 0;
|
|
9
|
+
max-width: 200px;
|
|
10
|
+
|
|
11
|
+
img {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
const FundraisingRegulatorLogo = () => (
|
|
17
|
+
<FundraisingRegulatorWrapper>
|
|
18
|
+
{/* Code from https://www.fundraisingregulator.org.uk/ */}
|
|
19
|
+
<a href="https://www.fundraisingregulator.org.uk/validate?registrant=COMIC+RELIEF" className="fr-digital-badge" style={{ height: 'auto', width: '150px', textDecoration: 'none' }} target="_blank" rel="noreferrer">
|
|
20
|
+
<img src="https://www.fundraisingregulator.org.uk/fr-badge/80983ed7-ea80-40db-8e52-4a3351d9e77d/en/white" width="100%" alt="Fundraising Regulator badge with validation link" loading="lazy" />
|
|
21
|
+
</a>
|
|
22
|
+
</FundraisingRegulatorWrapper>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export default FundraisingRegulatorLogo;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import Link from '../../../Atoms/Link/Link';
|
|
3
3
|
import hideVisually from '../../../../theme/shared/hideVisually';
|
|
4
|
+
import spacing from '../../../../theme/shared/spacing';
|
|
4
5
|
|
|
5
6
|
const NavLinkClass = styled(Link)`
|
|
6
7
|
border: 0;
|
|
@@ -119,8 +120,8 @@ const SubNavLink = styled(NavLinkClass)`
|
|
|
119
120
|
const NavMenu = styled.ul`
|
|
120
121
|
background-color: inherit;
|
|
121
122
|
list-style: none outside;
|
|
122
|
-
padding: 0;
|
|
123
|
-
|
|
123
|
+
padding: 0 0 ${spacing('xl')};
|
|
124
|
+
border-bottom: 1px solid ${({ theme }) => theme.color('white')};
|
|
124
125
|
|
|
125
126
|
@media ${({ theme }) => theme.allBreakpoints('M')} {
|
|
126
127
|
display: flex;
|
|
@@ -239,8 +239,8 @@ exports[`renders correctly 1`] = `
|
|
|
239
239
|
.c13 {
|
|
240
240
|
background-color: inherit;
|
|
241
241
|
list-style: none outside;
|
|
242
|
-
padding: 0;
|
|
243
|
-
|
|
242
|
+
padding: 0 0 4rem;
|
|
243
|
+
border-bottom: 1px solid #FFFFFF;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
.c14 {
|
|
@@ -320,7 +320,7 @@ exports[`renders correctly 1`] = `
|
|
|
320
320
|
width: 100%;
|
|
321
321
|
height: 100%;
|
|
322
322
|
text-align: left;
|
|
323
|
-
margin-top:
|
|
323
|
+
margin-top: 0;
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
.c24 p {
|