@comicrelief/component-library 7.22.0 → 7.23.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/cypress/e2e/components/organisms/impactSlider.cy.js +72 -0
- package/dist/components/Atoms/Button/Button.js +4 -16
- package/dist/components/Atoms/Button/Button.test.js +0 -5
- package/dist/components/Atoms/ButtonWithStates/ButtonWithStates.js +14 -31
- package/dist/components/Atoms/Checkbox/Checkbox.js +4 -17
- package/dist/components/Atoms/Checkbox/Checkbox.test.js +0 -5
- package/dist/components/Atoms/Confetti/Confetti.js +8 -23
- package/dist/components/Atoms/Confetti/_TriggerConfetti.js +5 -13
- package/dist/components/Atoms/ErrorText/ErrorText.js +2 -14
- package/dist/components/Atoms/ErrorText/ErrorText.test.js +0 -5
- package/dist/components/Atoms/Icons/Arrow.js +7 -21
- package/dist/components/Atoms/Icons/AtSign.js +4 -14
- package/dist/components/Atoms/Icons/Chevron.js +7 -21
- package/dist/components/Atoms/Icons/Curve.js +1 -6
- package/dist/components/Atoms/Icons/Download.js +4 -14
- package/dist/components/Atoms/Icons/External.js +4 -14
- package/dist/components/Atoms/Icons/Favourite.js +4 -14
- package/dist/components/Atoms/Icons/Internal.js +4 -14
- package/dist/components/Atoms/Icons/index.js +14 -22
- package/dist/components/Atoms/Input/Input.js +15 -35
- package/dist/components/Atoms/Input/input.test.js +0 -5
- package/dist/components/Atoms/Label/Label.js +12 -24
- package/dist/components/Atoms/Link/Link.js +18 -35
- package/dist/components/Atoms/Link/Link.style.js +9 -25
- package/dist/components/Atoms/Link/Link.test.js +0 -6
- package/dist/components/Atoms/Logo/Logo.js +5 -22
- package/dist/components/Atoms/Logo/Logo.test.js +0 -5
- package/dist/components/Atoms/Pagination/Item/Item.js +3 -11
- package/dist/components/Atoms/Pagination/Item/Item.style.js +18 -30
- package/dist/components/Atoms/Pagination/List/List.js +10 -21
- package/dist/components/Atoms/Pagination/Pagination.js +25 -47
- package/dist/components/Atoms/Pagination/Pagination.test.js +0 -5
- package/dist/components/Atoms/Pagination/Utils/PaginationCalculator.js +14 -30
- package/dist/components/Atoms/Picture/Picture.js +19 -39
- package/dist/components/Atoms/Picture/Picture.test.js +0 -6
- package/dist/components/Atoms/RadioButton/RadioButton.js +6 -18
- package/dist/components/Atoms/RadioButton/RadioButton.test.js +0 -5
- package/dist/components/Atoms/RichText/RichText.js +4 -15
- package/dist/components/Atoms/RichText/RichText.test.js +0 -5
- package/dist/components/Atoms/Select/Select.js +19 -39
- package/dist/components/Atoms/Select/Select.test.js +0 -5
- package/dist/components/Atoms/SocialIcons/Icon/Icon.js +6 -18
- package/dist/components/Atoms/SocialIcons/SocialIcons.js +3 -17
- package/dist/components/Atoms/SocialIcons/SocialIcons.test.js +0 -5
- package/dist/components/Atoms/SocialIcons/Utils/Icons.js +2 -9
- package/dist/components/Atoms/SocialIcons/Utils/Links.js +2 -5
- package/dist/components/Atoms/Text/Text.js +16 -29
- package/dist/components/Atoms/Text/Text.test.js +0 -5
- package/dist/components/Atoms/TextArea/TextArea.js +10 -25
- package/dist/components/Atoms/TextArea/TextArea.test.js +0 -5
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +26 -53
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.style.js +8 -28
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.test.js +0 -6
- package/dist/components/Molecules/Accordion/Accordion.js +8 -29
- package/dist/components/Molecules/Accordion/Accordion.test.js +0 -6
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +14 -38
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +0 -6
- package/dist/components/Molecules/Banner/Banner.js +3 -13
- package/dist/components/Molecules/Banner/Banner.test.js +0 -6
- package/dist/components/Molecules/Box/Box.js +9 -22
- package/dist/components/Molecules/Box/Box.test.js +0 -6
- package/dist/components/Molecules/Card/Card.js +11 -24
- package/dist/components/Molecules/Card/Card.test.js +0 -6
- package/dist/components/Molecules/CardDs/CardDs.js +17 -41
- package/dist/components/Molecules/CardDs/CardDs.test.js +0 -7
- package/dist/components/Molecules/Chip/Chip.js +4 -10
- package/dist/components/Molecules/Chip/Chip.style.js +8 -48
- package/dist/components/Molecules/Chip/Chip.test.js +0 -6
- package/dist/components/Molecules/Countdown/Countdown.js +17 -32
- package/dist/components/Molecules/Countdown/Countdown.style.js +4 -13
- package/dist/components/Molecules/Descriptor/Descriptor.js +6 -50
- package/dist/components/Molecules/Descriptor/Descriptor.test.js +0 -5
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.js +2 -8
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.style.js +4 -13
- package/dist/components/Molecules/DoubleCopy/DoubleCopy.test.js +0 -6
- package/dist/components/Molecules/HeroBanner/HeroBanner.js +4 -13
- package/dist/components/Molecules/InfoBanner/InfoBanner.js +8 -19
- package/dist/components/Molecules/InfoBanner/InfoBanner.test.js +0 -5
- package/dist/components/Molecules/Logos/Logos.js +1 -11
- package/dist/components/Molecules/Lookup/Lookup.js +25 -57
- package/dist/components/Molecules/PartnerLink/PartnerLink.js +3 -14
- package/dist/components/Molecules/PartnerLink/PartnerLink.style.js +4 -13
- package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +0 -7
- package/dist/components/Molecules/Promo/Promo.js +43 -50
- package/dist/components/Molecules/Promo/Promo.md +18 -35
- package/dist/components/Molecules/Promo/Promo.style.js +23 -41
- package/dist/components/Molecules/Promo/Promo.test.js +0 -8
- package/dist/components/Molecules/Promo/_ProgressRing.js +7 -20
- package/dist/components/Molecules/Promo/_PromoVideo.js +42 -54
- package/dist/components/Molecules/Promo/_PromoVideoButton.js +5 -12
- package/dist/components/Molecules/Promo/_PromoVideoButton.style.js +33 -59
- package/dist/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +116 -72
- package/dist/components/Molecules/SchoolLookup/SchoolLookup.js +6 -23
- package/dist/components/Molecules/SchoolLookup/SchoolLookup.test.js +0 -5
- package/dist/components/Molecules/SearchInput/SearchInput.js +4 -12
- package/dist/components/Molecules/SearchInput/SearchInput.style.js +7 -25
- package/dist/components/Molecules/SearchInput/SearchInput.test.js +0 -5
- package/dist/components/Molecules/SearchResult/SearchResult.js +11 -25
- package/dist/components/Molecules/SearchResult/SearchResult.test.js +0 -6
- package/dist/components/Molecules/ShareButton/ShareButton.js +10 -23
- package/dist/components/Molecules/ShareButton/ShareButton.style.js +6 -21
- package/dist/components/Molecules/ShareButton/ShareButton.test.js +0 -5
- package/dist/components/Molecules/ShareButton/assets/ShareIcons.js +1 -6
- package/dist/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +4 -25
- package/dist/components/Molecules/SingleMessage/SingleMessage.js +48 -68
- package/dist/components/Molecules/SingleMessage/SingleMessage.style.js +19 -47
- package/dist/components/Molecules/SingleMessage/SingleMessage.test.js +0 -8
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.js +22 -46
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.style.js +13 -44
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +0 -8
- package/dist/components/Molecules/Typeahead/Typeahead.js +25 -51
- package/dist/components/Molecules/Typeahead/Typeahead.test.js +0 -12
- package/dist/components/Molecules/VideoBanner/VideoBanner.js +14 -28
- package/dist/components/Molecules/VideoBanner/VideoBanner.test.js +0 -6
- package/dist/components/Organisms/CookieBanner/CookieBanner.js +3 -9
- package/dist/components/Organisms/CookieBanner/CookieBanner.style.js +6 -18
- package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +0 -5
- package/dist/components/Organisms/Donate/Donate.js +36 -48
- package/dist/components/Organisms/Donate/Donate.style.js +23 -71
- package/dist/components/Organisms/Donate/Donate.test.js +0 -8
- package/dist/components/Organisms/Donate/Form/Form.js +53 -80
- package/dist/components/Organisms/Donate/Form/PopUpComponent.js +9 -27
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +4 -12
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +7 -25
- package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +7 -21
- package/dist/components/Organisms/Donate/dev-data/data-high-value.js +2 -3
- package/dist/components/Organisms/Donate/dev-data/data-single.js +2 -3
- package/dist/components/Organisms/Donate/dev-data/data.js +2 -3
- package/dist/components/Organisms/EmailSignUp/EmailSignUp.style.js +12 -37
- package/dist/components/Organisms/EmailSignUp/EmailSignUp.test.js +0 -9
- package/dist/components/Organisms/EmailSignUp/EmailSignUpForm.js +3 -24
- package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +19 -32
- package/dist/components/Organisms/EmailSignUp/_EmailSignUpConfig.js +6 -18
- package/dist/components/Organisms/EmailSignUp/_TextInput.js +7 -16
- package/dist/components/Organisms/Footer/Footer.js +5 -17
- package/dist/components/Organisms/Footer/Footer.style.js +10 -35
- package/dist/components/Organisms/Footer/Footer.test.js +1 -7
- package/dist/components/Organisms/Footer/Nav/Nav.js +15 -39
- package/dist/components/Organisms/Footer/Nav/Nav.style.js +16 -37
- package/dist/components/Organisms/Footer/data/data.js +2 -3
- package/dist/components/Organisms/Footer/data/footerCopy.js +2 -3
- package/dist/components/Organisms/Header/Burger/BurgerMenu.js +3 -8
- package/dist/components/Organisms/Header/Burger/BurgerMenu.style.js +8 -19
- package/dist/components/Organisms/Header/Header.js +4 -14
- package/dist/components/Organisms/Header/Header.style.js +5 -22
- package/dist/components/Organisms/Header/Nav/Nav.js +19 -44
- package/dist/components/Organisms/Header/Nav/Nav.style.js +19 -46
- package/dist/components/Organisms/Header/data/data.js +2 -3
- package/dist/components/Organisms/Header/header.test.js +5 -2
- package/dist/components/Organisms/ImpactSlider/ImpactMoneybuys.style.js +61 -0
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.js +71 -0
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.md +42 -0
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.style.js +56 -0
- package/dist/components/Organisms/ImpactSlider/Slider.style.js +30 -0
- package/dist/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +42 -0
- package/dist/components/Organisms/ImpactSlider/_Slider.js +32 -0
- package/dist/components/Organisms/ImpactSlider/_utils.js +30 -0
- package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDS.style.js +15 -54
- package/dist/components/Organisms/MarketingPreferencesDS/MarketingPreferencesDSForm.js +11 -20
- package/dist/components/Organisms/MarketingPreferencesDS/_AssociatedFields.js +1 -2
- package/dist/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +12 -23
- package/dist/components/Organisms/MarketingPreferencesDS/_DefaultCopy.js +4 -14
- package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +23 -35
- package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPrefsConfig.js +10 -19
- package/dist/components/Organisms/MarketingPreferencesDS/_TextInput.js +7 -16
- package/dist/components/Organisms/Membership/Form/Form.js +50 -83
- package/dist/components/Organisms/Membership/Membership.js +13 -21
- package/dist/components/Organisms/Membership/Membership.style.js +21 -63
- package/dist/components/Organisms/Membership/Membership.test.js +0 -7
- package/dist/components/Organisms/Membership/MoneyBox/MoneyBox.js +9 -21
- package/dist/components/Organisms/Membership/dev-data/data.js +2 -3
- package/dist/hoc/shallowWithTheme.js +0 -6
- package/dist/index.js +134 -187
- package/dist/styleguide/CRLogo.js +1 -9
- package/dist/styleguide/StyleGuideRenderer.js +6 -10
- package/dist/styleguide/ThemeWrapper.js +1 -8
- package/dist/styleguide/data/data.js +20 -5
- package/dist/theme/ThemeProvider.js +1 -5
- package/dist/theme/crTheme/buttonColors.js +2 -11
- package/dist/theme/crTheme/colors.js +3 -9
- package/dist/theme/crTheme/fontSizes.js +2 -6
- package/dist/theme/crTheme/linkStyles.js +2 -11
- package/dist/theme/crTheme/theme.js +2 -11
- package/dist/theme/shared/breakpoint.js +4 -9
- package/dist/theme/shared/fontFamilies.js +2 -7
- package/dist/theme/shared/hideVisually.js +1 -4
- package/dist/theme/shared/size.js +5 -11
- package/dist/theme/shared/spacing.js +1 -5
- package/dist/theme/shared/zIndex.js +1 -8
- package/dist/theme/srTheme/buttonColors.js +2 -11
- package/dist/theme/srTheme/colors.js +3 -9
- package/dist/theme/srTheme/fontSizes.js +2 -6
- package/dist/theme/srTheme/linkStyles.js +2 -11
- package/dist/theme/srTheme/theme.js +2 -11
- package/dist/utils/Membership.js +11 -28
- package/dist/utils/ShareButton/sharePopUpHelper.js +3 -8
- package/dist/utils/ShareButton/shareTracking.js +1 -5
- package/dist/utils/ShareButton/shareUrlHelper.js +3 -5
- package/dist/utils/allowListed.js +1 -5
- package/dist/utils/allowListed.test.js +0 -2
- package/dist/utils/internalLinkHelper.js +11 -20
- package/dist/utils/navHelper.js +1 -6
- package/package.json +2 -1
- package/react-range-slider-input.d.ts +2 -0
- package/src/components/Molecules/Promo/Promo.js +14 -8
- package/src/components/Molecules/Promo/Promo.md +18 -35
- package/src/components/Molecules/Promo/Promo.style.js +28 -16
- package/src/components/Molecules/Promo/_PromoVideo.js +13 -8
- package/src/components/Molecules/Promo/_PromoVideoButton.js +1 -1
- package/src/components/Molecules/Promo/_PromoVideoButton.style.js +26 -21
- package/src/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +116 -72
- package/src/components/Organisms/ImpactSlider/ImpactMoneybuys.style.js +96 -0
- package/src/components/Organisms/ImpactSlider/ImpactSlider.js +92 -0
- package/src/components/Organisms/ImpactSlider/ImpactSlider.md +42 -0
- package/src/components/Organisms/ImpactSlider/ImpactSlider.style.js +72 -0
- package/src/components/Organisms/ImpactSlider/Slider.style.js +70 -0
- package/src/components/Organisms/ImpactSlider/_ImpactMoneybuys.js +43 -0
- package/src/components/Organisms/ImpactSlider/_Slider.js +39 -0
- package/src/components/Organisms/ImpactSlider/_utils.js +32 -0
- package/src/index.js +1 -0
- package/src/styleguide/data/data.js +26 -1
|
@@ -4,14 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
/* Handles issues related to screen/browser positions on dual-screen setups- http://www.xtf.dk/ */
|
|
9
8
|
var popUpCentre = function popUpCentre(url, popUpWidth, popUpHeight) {
|
|
10
9
|
var dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screen.left;
|
|
11
10
|
var dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screen.top;
|
|
12
11
|
var browserWidth;
|
|
13
12
|
var browserHeight;
|
|
14
|
-
|
|
15
13
|
if (window.innerWidth) {
|
|
16
14
|
browserWidth = window.innerWidth;
|
|
17
15
|
} else if (document.documentElement.clientWidth) {
|
|
@@ -19,7 +17,6 @@ var popUpCentre = function popUpCentre(url, popUpWidth, popUpHeight) {
|
|
|
19
17
|
} else {
|
|
20
18
|
browserWidth = window.screen.width;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
if (window.innerHeight) {
|
|
24
21
|
browserHeight = window.innerHeight;
|
|
25
22
|
} else if (document.documentElement.clientHeight) {
|
|
@@ -27,15 +24,13 @@ var popUpCentre = function popUpCentre(url, popUpWidth, popUpHeight) {
|
|
|
27
24
|
} else {
|
|
28
25
|
browserHeight = window.screen.height;
|
|
29
26
|
}
|
|
30
|
-
|
|
31
27
|
var popUpLeft = browserWidth / 2 - popUpWidth / 2 + dualScreenLeft;
|
|
32
28
|
var popUpTop = browserHeight / 2 - popUpHeight / 2 + dualScreenTop;
|
|
33
|
-
var newWindow = window.open(url, '', "width=".concat(popUpWidth, ", height=").concat(popUpHeight, ", top=").concat(popUpTop, ", left=").concat(popUpLeft));
|
|
29
|
+
var newWindow = window.open(url, '', "width=".concat(popUpWidth, ", height=").concat(popUpHeight, ", top=").concat(popUpTop, ", left=").concat(popUpLeft));
|
|
34
30
|
|
|
31
|
+
// Shift browser focus to newWindow
|
|
35
32
|
if (window.focus) {
|
|
36
33
|
newWindow.focus();
|
|
37
34
|
}
|
|
38
35
|
};
|
|
39
|
-
|
|
40
|
-
var _default = popUpCentre;
|
|
41
|
-
exports.default = _default;
|
|
36
|
+
var _default = exports.default = popUpCentre;
|
|
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var shareTracking = function shareTracking(channel) {
|
|
9
8
|
if (!window.dataLayer) {
|
|
10
9
|
window.dataLayer = [];
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
window.dataLayer.push({
|
|
14
12
|
event: 'btn_social-share',
|
|
15
13
|
action: channel
|
|
16
14
|
});
|
|
17
15
|
};
|
|
18
|
-
|
|
19
|
-
var _default = shareTracking;
|
|
20
|
-
exports.default = _default;
|
|
16
|
+
var _default = exports.default = shareTracking;
|
|
@@ -4,18 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
/* Determine where to grab the URL, depending on the component type and values supplied */
|
|
9
8
|
var shareUrlHelper = function shareUrlHelper(urlToShare, typeOfShare) {
|
|
10
9
|
// Encode the URL so we can happily pass it as a parameter, fragments and all
|
|
11
|
-
var urlToShareEncoded = encodeURIComponent(urlToShare);
|
|
10
|
+
var urlToShareEncoded = encodeURIComponent(urlToShare);
|
|
12
11
|
|
|
12
|
+
// Construct all share urls
|
|
13
13
|
var shareURLs = {
|
|
14
14
|
Twitter: "http://www.twitter.com/intent/tweet?url=".concat(urlToShareEncoded),
|
|
15
15
|
Facebook: "https://www.facebook.com/sharer/sharer.php?u=".concat(urlToShareEncoded)
|
|
16
16
|
};
|
|
17
17
|
return shareURLs[typeOfShare];
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
var _default = shareUrlHelper;
|
|
21
|
-
exports.default = _default;
|
|
19
|
+
var _default = exports.default = shareUrlHelper;
|
|
@@ -5,16 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var allowList = ['https://giftaid.comicrelief.com', 'https://donation.comicrelief.com', 'https://www.comicrelief.com', 'https://www.sportrelief.com', 'https://app.beapplied.com/org/comic-relief', 'stories.comicrelief.com', 'https://form.typeform.com'];
|
|
8
|
-
|
|
9
8
|
var allowListed = function allowListed(url) {
|
|
10
9
|
if (url !== undefined && url !== null && allowList.some(function (v) {
|
|
11
10
|
return url.indexOf(v) >= 0;
|
|
12
11
|
})) {
|
|
13
12
|
return true;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
return false;
|
|
17
15
|
};
|
|
18
|
-
|
|
19
|
-
var _default = allowListed;
|
|
20
|
-
exports.default = _default;
|
|
16
|
+
var _default = exports.default = allowListed;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _allowListed = _interopRequireDefault(require("./allowListed"));
|
|
6
|
-
|
|
7
5
|
it('link is allowListed', function () {
|
|
8
6
|
expect((0, _allowListed.default)('https://www.comicrelief.com/home')).toBe(true);
|
|
9
7
|
});
|
|
@@ -1,42 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.getDomain = exports.InternalLinkHelper = void 0;
|
|
9
|
-
|
|
10
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
-
|
|
12
9
|
var domainRegEx = new RegExp('(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]');
|
|
13
|
-
|
|
14
|
-
var InternalLinkHelper = function InternalLinkHelper(link) {
|
|
10
|
+
var InternalLinkHelper = exports.InternalLinkHelper = function InternalLinkHelper(link) {
|
|
15
11
|
// Check our URL for a domain pattern, if so return it
|
|
16
12
|
if (domainRegEx.test(link)) {
|
|
17
13
|
return link;
|
|
18
|
-
}
|
|
19
|
-
|
|
14
|
+
}
|
|
20
15
|
|
|
16
|
+
// If domain-free and internal, prefix it with slash if it doesn't already have one
|
|
21
17
|
return link.substring(0, 1) === '/' ? link : "/".concat(link);
|
|
22
18
|
};
|
|
19
|
+
var getDomain = exports.getDomain = function getDomain(url) {
|
|
20
|
+
var thisURL = url;
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var getDomain = function getDomain(url) {
|
|
27
|
-
var thisURL = url; // Strip out protocol
|
|
28
|
-
|
|
29
|
-
thisURL = url.replace(/(https?:\/\/)?(www.)?/i, ''); // Strip out subdirectory/path
|
|
22
|
+
// Strip out protocol
|
|
23
|
+
thisURL = url.replace(/(https?:\/\/)?(www.)?/i, '');
|
|
30
24
|
|
|
25
|
+
// Strip out subdirectory/path
|
|
31
26
|
if (thisURL.indexOf('/') !== -1) {
|
|
32
27
|
var _thisURL$split = thisURL.split('/'),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
_thisURL$split2 = (0, _slicedToArray2.default)(_thisURL$split, 1),
|
|
29
|
+
splitURL = _thisURL$split2[0];
|
|
36
30
|
thisURL = splitURL;
|
|
37
31
|
}
|
|
38
|
-
|
|
39
32
|
return thisURL;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
exports.getDomain = getDomain;
|
|
33
|
+
};
|
package/dist/utils/navHelper.js
CHANGED
|
@@ -4,18 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
/* Determine where to grab the URL, depending on the component type and values supplied */
|
|
9
8
|
var NavHelper = function NavHelper(navItem) {
|
|
10
9
|
/* Default url path location for 'Pages' */
|
|
11
10
|
var thisUrl = navItem.path;
|
|
12
|
-
|
|
13
11
|
if (navItem.internal.type === 'ContentfulComponentLink') {
|
|
14
12
|
thisUrl = navItem.reference && navItem.reference.path ? navItem.reference.path : navItem.url;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
return thisUrl;
|
|
18
15
|
};
|
|
19
|
-
|
|
20
|
-
var _default = NavHelper;
|
|
21
|
-
exports.default = _default;
|
|
16
|
+
var _default = exports.default = NavHelper;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comicrelief/component-library",
|
|
3
3
|
"author": "Comic Relief Engineering Team",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.23.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"jest": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"react-hook-form": "^6.3.0",
|
|
38
38
|
"react-modal": "^3.16.1",
|
|
39
39
|
"react-responsive": "^9.0.2",
|
|
40
|
+
"react-range-slider-input": "^3.0.7",
|
|
40
41
|
"react-scripts": "4.0.3",
|
|
41
42
|
"react-spinners": "^0.11.0",
|
|
42
43
|
"react-styleguidist": "^11.1.7",
|
|
@@ -6,7 +6,7 @@ import { sizes } from '../../../theme/shared/breakpoint';
|
|
|
6
6
|
import Picture from '../../Atoms/Picture/Picture';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
Container, Wrapper, Copy, Media
|
|
9
|
+
Container, Wrapper, Copy, Media, Gradient
|
|
10
10
|
} from './Promo.style';
|
|
11
11
|
|
|
12
12
|
const Promo = ({
|
|
@@ -25,7 +25,8 @@ const Promo = ({
|
|
|
25
25
|
showPosterAfterPlaying,
|
|
26
26
|
videoSrc,
|
|
27
27
|
mobileVideoSrc,
|
|
28
|
-
|
|
28
|
+
behindTextGradient,
|
|
29
|
+
blackPlayButton
|
|
29
30
|
}) => {
|
|
30
31
|
// Store the appropriate prop in state, dependent on the breakpoint
|
|
31
32
|
const [thisVideoSrc, setThisVideoSrc] = useState(null);
|
|
@@ -80,7 +81,8 @@ const Promo = ({
|
|
|
80
81
|
<>
|
|
81
82
|
<PromoVideo
|
|
82
83
|
copyLeft={copyLeft}
|
|
83
|
-
|
|
84
|
+
behindTextGradient={behindTextGradient}
|
|
85
|
+
blackPlayButton={blackPlayButton}
|
|
84
86
|
thisVideoSrc={thisVideoSrc}
|
|
85
87
|
thisPoster={thisPoster}
|
|
86
88
|
showPosterAfterPlaying={showPosterAfterPlaying}
|
|
@@ -92,9 +94,11 @@ const Promo = ({
|
|
|
92
94
|
</Media>
|
|
93
95
|
|
|
94
96
|
<Wrapper copyLeft={copyLeft}>
|
|
95
|
-
<
|
|
96
|
-
{
|
|
97
|
-
|
|
97
|
+
<Gradient hasVideo={hasVideo} behindTextGradient={behindTextGradient} copyLeft={copyLeft}>
|
|
98
|
+
<Copy position={position} hasVideo={hasVideo} behindTextGradient={behindTextGradient}>
|
|
99
|
+
{children}
|
|
100
|
+
</Copy>
|
|
101
|
+
</Gradient>
|
|
98
102
|
</Wrapper>
|
|
99
103
|
</Container>
|
|
100
104
|
);
|
|
@@ -116,7 +120,8 @@ Promo.propTypes = {
|
|
|
116
120
|
poster: PropTypes.string,
|
|
117
121
|
mobilePoster: PropTypes.string,
|
|
118
122
|
showPosterAfterPlaying: PropTypes.bool,
|
|
119
|
-
|
|
123
|
+
behindTextGradient: PropTypes.oneOf(['black', 'white', 'none']),
|
|
124
|
+
blackPlayButton: PropTypes.bool
|
|
120
125
|
};
|
|
121
126
|
|
|
122
127
|
Promo.defaultProps = {
|
|
@@ -135,7 +140,8 @@ Promo.defaultProps = {
|
|
|
135
140
|
videoSrc: null,
|
|
136
141
|
mobileVideoSrc: null,
|
|
137
142
|
showPosterAfterPlaying: true,
|
|
138
|
-
|
|
143
|
+
behindTextGradient: 'none',
|
|
144
|
+
blackPlayButton: false
|
|
139
145
|
};
|
|
140
146
|
|
|
141
147
|
export default Promo;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Promo
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
const defaultData = require('../../../styleguide/data/data').defaultData;
|
|
4
|
+
const defaultData = require('../../../styleguide/data/data').defaultData;
|
|
5
|
+
import Text from '../../Atoms/Text/Text';
|
|
5
6
|
import Link from '../../Atoms/Link/Link';
|
|
6
7
|
|
|
7
8
|
<div>
|
|
@@ -15,7 +16,6 @@ import Link from '../../Atoms/Link/Link';
|
|
|
15
16
|
imageLow={defaultData.promoImage}
|
|
16
17
|
imageAltText=""
|
|
17
18
|
copyLeft={true}
|
|
18
|
-
hasOverlay={true}
|
|
19
19
|
position="upper"
|
|
20
20
|
>
|
|
21
21
|
<Text
|
|
@@ -51,7 +51,6 @@ import Link from '../../Atoms/Link/Link';
|
|
|
51
51
|
imageLow={defaultData.promoImage}
|
|
52
52
|
imageAltText=""
|
|
53
53
|
copyLeft={true}
|
|
54
|
-
hasOverlay={true}
|
|
55
54
|
position="end"
|
|
56
55
|
>
|
|
57
56
|
<Text
|
|
@@ -87,7 +86,6 @@ import Link from '../../Atoms/Link/Link';
|
|
|
87
86
|
imageLow={defaultData.promoImage}
|
|
88
87
|
imageAltText=""
|
|
89
88
|
copyLeft={true}
|
|
90
|
-
hasOverlay={true}
|
|
91
89
|
position="lower"
|
|
92
90
|
>
|
|
93
91
|
<Text
|
|
@@ -123,7 +121,6 @@ import Link from '../../Atoms/Link/Link';
|
|
|
123
121
|
imageLow={defaultData.promoImage}
|
|
124
122
|
imageAltText=""
|
|
125
123
|
copyLeft={true}
|
|
126
|
-
hasOverlay={true}
|
|
127
124
|
>
|
|
128
125
|
<Text
|
|
129
126
|
tag="h1"
|
|
@@ -164,7 +161,7 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
164
161
|
|
|
165
162
|
<div>
|
|
166
163
|
<Text tag="h2" size="xl" color="black">
|
|
167
|
-
Promo Upper w/Video (autoplay and loop)
|
|
164
|
+
Promo Upper w/Video (autoplay and loop, black text gradient overlay)
|
|
168
165
|
</Text>
|
|
169
166
|
<Promo
|
|
170
167
|
backgroundColor="blue_dark"
|
|
@@ -173,12 +170,12 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
173
170
|
imageLow={defaultData.promoImage}
|
|
174
171
|
imageAltText=""
|
|
175
172
|
copyLeft={true}
|
|
176
|
-
hasOverlay={true}
|
|
177
173
|
position="upper"
|
|
178
174
|
videoSrc={videoSrc}
|
|
179
175
|
poster={poster}
|
|
180
176
|
loop={true}
|
|
181
177
|
autoplay={true}
|
|
178
|
+
behindTextGradient='black'
|
|
182
179
|
>
|
|
183
180
|
<Text
|
|
184
181
|
tag="h1"
|
|
@@ -206,7 +203,7 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
206
203
|
<br />
|
|
207
204
|
|
|
208
205
|
<Text tag="h2" size="xl" color="black">
|
|
209
|
-
Promo End w/Video (loop only)
|
|
206
|
+
Promo End w/Video (loop only, no text gradient overlay)
|
|
210
207
|
</Text>
|
|
211
208
|
<Promo
|
|
212
209
|
backgroundColor="blue_dark"
|
|
@@ -215,7 +212,6 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
215
212
|
imageLow={defaultData.promoImage}
|
|
216
213
|
imageAltText=""
|
|
217
214
|
copyLeft={true}
|
|
218
|
-
hasOverlay={true}
|
|
219
215
|
position="end"
|
|
220
216
|
videoSrc={videoSrc}
|
|
221
217
|
poster={poster}
|
|
@@ -248,25 +244,25 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
248
244
|
<br />
|
|
249
245
|
|
|
250
246
|
<Text tag="h2" size="xl" color="black">
|
|
251
|
-
Promo Lower w/Video (autoplay only)
|
|
247
|
+
Promo Lower w/Video (autoplay only, white text gradient overlay)
|
|
252
248
|
</Text>
|
|
253
249
|
<Promo
|
|
254
|
-
backgroundColor="
|
|
250
|
+
backgroundColor="blue_light"
|
|
255
251
|
imageSet={defaultData.promoImage}
|
|
256
252
|
image={defaultData.promoImage}
|
|
257
253
|
imageLow={defaultData.promoImage}
|
|
258
254
|
imageAltText=""
|
|
259
255
|
copyLeft={true}
|
|
260
|
-
hasOverlay={true}
|
|
261
256
|
position="lower"
|
|
262
257
|
videoSrc={videoSrc}
|
|
263
258
|
poster={poster}
|
|
264
259
|
loop={false}
|
|
265
260
|
autoPlay={true}
|
|
261
|
+
behindTextGradient='white'
|
|
266
262
|
>
|
|
267
263
|
<Text
|
|
268
264
|
tag="h1"
|
|
269
|
-
color="
|
|
265
|
+
color="black"
|
|
270
266
|
size="super"
|
|
271
267
|
family="Anton"
|
|
272
268
|
uppercase
|
|
@@ -274,12 +270,12 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
274
270
|
>
|
|
275
271
|
Curabitur pretium tincidunt lacus
|
|
276
272
|
</Text>
|
|
277
|
-
<Text tag="p" color="
|
|
273
|
+
<Text tag="p" color="black">
|
|
278
274
|
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius,
|
|
279
275
|
turpis et commodo, est eros bibendum elit, nec luctus magna sollicitudin.
|
|
280
276
|
</Text>
|
|
281
277
|
<span>
|
|
282
|
-
<Link href="/" type="button" color="
|
|
278
|
+
<Link href="/" type="button" color="black">
|
|
283
279
|
<Text>
|
|
284
280
|
Show me this
|
|
285
281
|
</Text>
|
|
@@ -289,7 +285,7 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
289
285
|
|
|
290
286
|
<br />
|
|
291
287
|
<Text tag="h2" size="xl" color="black">
|
|
292
|
-
Promo None w/Video (no loop or autoplay)
|
|
288
|
+
Promo None w/Video (no loop or autoplay, no text gradient overlay, copy right aligned)
|
|
293
289
|
</Text>
|
|
294
290
|
<Promo
|
|
295
291
|
backgroundColor="blue_dark"
|
|
@@ -298,7 +294,6 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
298
294
|
imageLow={defaultData.promoImage}
|
|
299
295
|
imageAltText=""
|
|
300
296
|
copyLeft={false}
|
|
301
|
-
hasOverlay={true}
|
|
302
297
|
videoSrc={videoSrc}
|
|
303
298
|
poster={poster}
|
|
304
299
|
loop={false}
|
|
@@ -328,7 +323,7 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
328
323
|
</Promo>
|
|
329
324
|
|
|
330
325
|
<Text tag="h2" size="xl" color="black">
|
|
331
|
-
Promo None w/Video (no loop or autoplay,
|
|
326
|
+
Promo None w/Video (no loop or autoplay, white text gradient overlay, different videos and posters for mobile and desktop)
|
|
332
327
|
</Text>
|
|
333
328
|
<Promo
|
|
334
329
|
backgroundColor="blue_light"
|
|
@@ -337,14 +332,13 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
337
332
|
imageLow={defaultData.promoImage}
|
|
338
333
|
imageAltText=""
|
|
339
334
|
copyLeft={true}
|
|
340
|
-
hasOverlay={true}
|
|
341
335
|
videoSrc={videoSrc}
|
|
342
336
|
mobileVideoSrc={mobileVideoSrc}
|
|
343
337
|
poster={poster}
|
|
344
338
|
mobilePoster={mobilePoster}
|
|
345
339
|
loop={false}
|
|
346
340
|
autoPlay={false}
|
|
347
|
-
|
|
341
|
+
behindTextGradient='white'
|
|
348
342
|
>
|
|
349
343
|
<Text
|
|
350
344
|
tag="h1"
|
|
@@ -370,7 +364,7 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
370
364
|
</Promo>
|
|
371
365
|
|
|
372
366
|
<Text tag="h2" size="xl" color="black">
|
|
373
|
-
Promo None w/Video (no loop or autoplay,
|
|
367
|
+
Promo None w/Video (no loop or autoplay, white text gradient overlay, mobile-only video and poster, black play button)
|
|
374
368
|
</Text>
|
|
375
369
|
<Promo
|
|
376
370
|
backgroundColor="blue_light"
|
|
@@ -379,12 +373,12 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
379
373
|
imageLow={defaultData.promoImage}
|
|
380
374
|
imageAltText=""
|
|
381
375
|
copyLeft={true}
|
|
382
|
-
hasOverlay={true}
|
|
383
376
|
mobileVideoSrc={mobileVideoSrc}
|
|
384
377
|
mobilePoster={mobilePoster}
|
|
385
378
|
loop={false}
|
|
386
379
|
autoPlay={false}
|
|
387
|
-
|
|
380
|
+
behindTextGradient='white'
|
|
381
|
+
blackPlayButton={true}
|
|
388
382
|
>
|
|
389
383
|
<Text
|
|
390
384
|
tag="h1"
|
|
@@ -394,19 +388,8 @@ let mobileVideoSrc = 'https://samplelib.com/lib/preview/mp4/sample-10s.mp4';
|
|
|
394
388
|
uppercase
|
|
395
389
|
weight="normal"
|
|
396
390
|
>
|
|
397
|
-
|
|
391
|
+
One-Line Special
|
|
398
392
|
</Text>
|
|
399
|
-
<Text tag="p" color="black">
|
|
400
|
-
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius,
|
|
401
|
-
turpis et commodo, est eros bibendum elit, nec luctus magna sollicitudin.
|
|
402
|
-
</Text>
|
|
403
|
-
<span>
|
|
404
|
-
<Link href="/" type="button" color="black">
|
|
405
|
-
<Text>
|
|
406
|
-
Show me this
|
|
407
|
-
</Text>
|
|
408
|
-
</Link>
|
|
409
|
-
</span>
|
|
410
393
|
</Promo>
|
|
411
394
|
|
|
412
395
|
</div>
|
|
@@ -44,6 +44,7 @@ const Wrapper = styled.div`
|
|
|
44
44
|
margin: 0 auto;
|
|
45
45
|
display: flex;
|
|
46
46
|
align-items: center;
|
|
47
|
+
position: relative;
|
|
47
48
|
|
|
48
49
|
${({ copyLeft }) => !copyLeft && 'justify-content: flex-end'};
|
|
49
50
|
${media('medium')} {
|
|
@@ -57,22 +58,8 @@ const Copy = styled.div`
|
|
|
57
58
|
${zIndex('low')};
|
|
58
59
|
|
|
59
60
|
${media('medium')} {
|
|
60
|
-
width:
|
|
61
|
-
padding: ${spacing('xl')} ${spacing('m')};
|
|
62
|
-
}
|
|
63
|
-
${media('medium')} {
|
|
64
|
-
width: 50%;
|
|
61
|
+
width: 100%;
|
|
65
62
|
padding: ${spacing('xxl')} ${spacing('m')};
|
|
66
|
-
|
|
67
|
-
${({ hasVideo }) => hasVideo !== false && css`
|
|
68
|
-
background-color: rgba(0,0,0,0.75);
|
|
69
|
-
overflow: hidden;
|
|
70
|
-
box-shadow: 0px 0px 75px 100px rgba(0, 0, 0, 0.75);
|
|
71
|
-
`}
|
|
72
|
-
${({ hasVideo, lightColouredVideo }) => (hasVideo !== false && lightColouredVideo) && css`
|
|
73
|
-
background-color: rgba(255, 255, 255, 0.75);
|
|
74
|
-
box-shadow: 0px 0px 75px 100px rgba(255, 255, 255, 0.75);
|
|
75
|
-
`}
|
|
76
63
|
}
|
|
77
64
|
|
|
78
65
|
${({ position }) => position === 'lower' && css`
|
|
@@ -104,6 +91,31 @@ const Video = styled.video.attrs(() => ({
|
|
|
104
91
|
object-fit: cover;
|
|
105
92
|
`;
|
|
106
93
|
|
|
94
|
+
const Gradient = styled.div`
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
|
|
100
|
+
${media('medium')} {
|
|
101
|
+
width: 50%;
|
|
102
|
+
position: absolute;
|
|
103
|
+
top: 0;
|
|
104
|
+
left: 0;
|
|
105
|
+
|
|
106
|
+
${({ copyLeft }) => (!copyLeft) && css`
|
|
107
|
+
left: auto;
|
|
108
|
+
right: 0;
|
|
109
|
+
`};
|
|
110
|
+
|
|
111
|
+
${({ hasVideo, behindTextGradient }) => (hasVideo !== false && behindTextGradient !== 'none') && css`
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
background-color:${behindTextGradient === 'black' ? 'rgba(0,0,0,0.5)' : 'rgba(255, 255, 255, 0.5)'};
|
|
114
|
+
box-shadow: 0px 0px 50px 60px ${behindTextGradient === 'black' ? 'rgba(0,0,0,0.5)' : 'rgba(255, 255, 255, 0.5)'};
|
|
115
|
+
`};
|
|
116
|
+
}
|
|
117
|
+
`;
|
|
118
|
+
|
|
107
119
|
export {
|
|
108
|
-
Container, Wrapper, Copy, Media, Video
|
|
120
|
+
Container, Wrapper, Copy, Media, Video, Gradient
|
|
109
121
|
};
|
|
@@ -4,13 +4,14 @@ import { Video } from './Promo.style';
|
|
|
4
4
|
import PromoVideoButton from './_PromoVideoButton';
|
|
5
5
|
|
|
6
6
|
const PromoVideo = ({
|
|
7
|
-
|
|
7
|
+
behindTextGradient,
|
|
8
8
|
copyLeft,
|
|
9
9
|
thisVideoSrc,
|
|
10
10
|
thisPoster,
|
|
11
11
|
autoPlay,
|
|
12
12
|
loop,
|
|
13
|
-
showPosterAfterPlaying
|
|
13
|
+
showPosterAfterPlaying,
|
|
14
|
+
blackPlayButton
|
|
14
15
|
}) => {
|
|
15
16
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
16
17
|
const [isRestarting, setIsRestarting] = useState(false);
|
|
@@ -18,13 +19,15 @@ const PromoVideo = ({
|
|
|
18
19
|
const videoEl = useRef(null);
|
|
19
20
|
|
|
20
21
|
const togglePlay = () => {
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
if (videoEl.current) {
|
|
23
|
+
if (isPlaying) videoEl.current.pause();
|
|
24
|
+
else videoEl.current.play();
|
|
25
|
+
setIsPlaying(!isPlaying);
|
|
26
|
+
}
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
const updateTime = () => {
|
|
27
|
-
if (videoEl.current.duration) {
|
|
30
|
+
if (videoEl.current && videoEl.current.duration) {
|
|
28
31
|
// Calculate the percentage of the video played:
|
|
29
32
|
const percentage = Math.round((videoEl.current.currentTime / videoEl.current.duration) * 100);
|
|
30
33
|
// Because a completely smooth animation is impossible with the 250ms-ish frequency of
|
|
@@ -85,7 +88,8 @@ const PromoVideo = ({
|
|
|
85
88
|
videoProgress={videoProgress}
|
|
86
89
|
togglePlay={togglePlay}
|
|
87
90
|
isPlaying={isPlaying}
|
|
88
|
-
|
|
91
|
+
behindTextGradient={behindTextGradient}
|
|
92
|
+
blackPlayButton={blackPlayButton}
|
|
89
93
|
isRestarting={isRestarting}
|
|
90
94
|
/>
|
|
91
95
|
</>
|
|
@@ -94,7 +98,8 @@ const PromoVideo = ({
|
|
|
94
98
|
|
|
95
99
|
PromoVideo.propTypes = {
|
|
96
100
|
copyLeft: PropTypes.bool.isRequired,
|
|
97
|
-
|
|
101
|
+
behindTextGradient: PropTypes.oneOf(['black', 'white', 'none']).isRequired,
|
|
102
|
+
blackPlayButton: PropTypes.bool.isRequired,
|
|
98
103
|
thisVideoSrc: PropTypes.string.isRequired,
|
|
99
104
|
thisPoster: PropTypes.string.isRequired,
|
|
100
105
|
autoPlay: PropTypes.bool.isRequired,
|
|
@@ -6,7 +6,7 @@ import { PlayButtonWrapper, PlayButton, Icon } from './_PromoVideoButton.style';
|
|
|
6
6
|
const PromoVideoButton = ({
|
|
7
7
|
togglePlay, ...rest
|
|
8
8
|
}) => (
|
|
9
|
-
<PlayButtonWrapper>
|
|
9
|
+
<PlayButtonWrapper className="weewee">
|
|
10
10
|
<PlayButton
|
|
11
11
|
onClick={() => { togglePlay(); }}
|
|
12
12
|
{...rest}
|