gatsby-core-theme 44.4.46 → 44.4.48
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/CHANGELOG.md +17 -0
- package/package.json +1 -1
- package/src/components/atoms/author/index.js +6 -5
- package/src/components/molecules/header/variants/operator/template-one-two/index.js +4 -3
- package/src/components/molecules/header/variants/operator/template-one-two/template-one-two.stories.js +4 -3
- package/src/components/molecules/header/variants/slot/template-one/index.js +4 -3
- package/src/components/molecules/header/variants/slot/template-one/template-one.stories.js +4 -3
- package/src/components/organisms/cookie-consent/index.js +48 -34
- package/src/components/organisms/form/fields/index.js +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## [44.4.48](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.47...v44.4.48) (2025-09-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add lazy for comoponents ([732fdf7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/732fdf7c10c3bbd1e46ca1d2f4bef04d879c8409))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* Merge branch 'en-8-cwv-unused-js' into 'master' ([bcc5448](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/bcc5448cfce871e8189c7fbd42493c6f1d4c477e))
|
|
10
|
+
|
|
11
|
+
## [44.4.47](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.46...v44.4.47) (2025-09-01)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* checkbox issue ([dac5349](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/dac5349111ebd0c38bf1d84f05a35f34280dfe31))
|
|
17
|
+
|
|
1
18
|
## [44.4.46](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.45...v44.4.46) (2025-09-01)
|
|
2
19
|
|
|
3
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
2
|
/* eslint-disable arrow-body-style */
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { lazy, Suspense } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
|
|
6
6
|
import { formatDate } from '~helpers/date-time';
|
|
@@ -8,10 +8,11 @@ import { imagePrettyUrl } from '~helpers/getters';
|
|
|
8
8
|
import Link from '~hooks/link';
|
|
9
9
|
import LazyImage from '~hooks/lazy-image';
|
|
10
10
|
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
11
|
-
import Verify from '~images/icons/verify';
|
|
12
|
-
import Clock from '~images/icons/clock';
|
|
13
11
|
import styles from './author.module.scss';
|
|
14
12
|
|
|
13
|
+
const VerifyIcon = lazy(() => import('~images/icons/verify'));
|
|
14
|
+
const ClockIcon = lazy(() => import('~images/icons/clock'));
|
|
15
|
+
|
|
15
16
|
const Author = ({
|
|
16
17
|
name,
|
|
17
18
|
date,
|
|
@@ -26,11 +27,11 @@ const Author = ({
|
|
|
26
27
|
isCardsAuthor = false,
|
|
27
28
|
hasAuthorBox = false,
|
|
28
29
|
reviewer,
|
|
29
|
-
clock = <
|
|
30
|
+
clock = <Suspense fallback={null}><ClockIcon /></Suspense>,
|
|
30
31
|
authorImageWidth = 30,
|
|
31
32
|
authorImageHeight = 30,
|
|
32
33
|
showVerification = false,
|
|
33
|
-
verifyIcon = <
|
|
34
|
+
verifyIcon = <Suspense fallback={null}><VerifyIcon /></Suspense>,
|
|
34
35
|
}) => {
|
|
35
36
|
const prefixstyle = !link || !authorImg;
|
|
36
37
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { lazy, Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
4
|
import { FaStar } from '@react-icons/all-files/fa/FaStar';
|
|
@@ -7,7 +7,6 @@ import { getAltText } from '~helpers/image';
|
|
|
7
7
|
import LazyImage from '~hooks/lazy-image';
|
|
8
8
|
import StarRating from '~molecules/star-rating/one-star';
|
|
9
9
|
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
10
|
-
import Verify from '~images/icons/verify';
|
|
11
10
|
import Rating from '~atoms/ratings';
|
|
12
11
|
import OperatorBanner from '~atoms/header-operator-bannner';
|
|
13
12
|
import VariableComponent from '../variables';
|
|
@@ -16,6 +15,8 @@ import { TrackingKeys } from '~constants/tracking-api'
|
|
|
16
15
|
import PrettyLink from '~atoms/pretty-link';
|
|
17
16
|
import Ribbons from '~atoms/ribbons';
|
|
18
17
|
|
|
18
|
+
const VerifyIcon = lazy(() => import('~images/icons/verify'));
|
|
19
|
+
|
|
19
20
|
const TemplateOneTwo = ({
|
|
20
21
|
relation,
|
|
21
22
|
type,
|
|
@@ -70,7 +71,7 @@ const TemplateOneTwo = ({
|
|
|
70
71
|
>
|
|
71
72
|
<div className={styles.name}>
|
|
72
73
|
<h1>{name}</h1>
|
|
73
|
-
{icon || <
|
|
74
|
+
{icon || <Suspense fallback={null}><VerifyIcon /></Suspense>}
|
|
74
75
|
</div>
|
|
75
76
|
{ribbon && <Ribbons customStyle={template === 'template_two' ? styles.templateTwoRibbon : ''} item={[relation.ribbons[0]]} /> }
|
|
76
77
|
{!['coming_soon', 'inactive'].includes(relation?.status) ? (
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { lazy } from "react";
|
|
2
2
|
import TemplateOne from ".";
|
|
3
3
|
import getOperatorData from "../../../../../../../tests/factories/relations/operator.factory";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const VerifyIcon = lazy(() => import('~images/icons/verify'));
|
|
5
6
|
|
|
6
7
|
const pageOperatorData = getOperatorData();
|
|
7
8
|
|
|
@@ -45,7 +46,7 @@ export default {
|
|
|
45
46
|
},
|
|
46
47
|
icon: {
|
|
47
48
|
name: "Icon",
|
|
48
|
-
defaultValue: <
|
|
49
|
+
defaultValue: <VerifyIcon />,
|
|
49
50
|
},
|
|
50
51
|
},
|
|
51
52
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { lazy, Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
import { FaStar } from '@react-icons/all-files/fa/FaStar';
|
|
@@ -6,14 +6,15 @@ import { imagePrettyUrl } from '~helpers/getters';
|
|
|
6
6
|
import OperatorBanner from '~atoms/header-operator-bannner';
|
|
7
7
|
import Rating from '~atoms/ratings';
|
|
8
8
|
import { getAltText } from '~helpers/image';
|
|
9
|
-
import Verify from '~images/icons/verify';
|
|
10
9
|
import { TrackingKeys } from '~constants/tracking-api'
|
|
11
10
|
import styles from './slot.module.scss';
|
|
12
11
|
|
|
12
|
+
const VerifyIcon = lazy(() => import('~images/icons/verify'));
|
|
13
|
+
|
|
13
14
|
export default function SlotHeader({
|
|
14
15
|
page,
|
|
15
16
|
moduleName = TrackingKeys?.HEADERSLOTS,
|
|
16
|
-
image = <
|
|
17
|
+
image = <Suspense fallback={null}><VerifyIcon /></Suspense>,
|
|
17
18
|
showExtraRatings = false,
|
|
18
19
|
width = 170,
|
|
19
20
|
height = 170,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* eslint-disable react/destructuring-assignment */
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { lazy } from 'react';
|
|
3
3
|
import TemplateOne from '.';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const VerifyIcon = lazy(() => import('~images/icons/verify'));
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: 'Theme/Layout/Header/Games/Template One',
|
|
@@ -67,6 +68,6 @@ Default.args = {
|
|
|
67
68
|
},
|
|
68
69
|
},
|
|
69
70
|
},
|
|
70
|
-
image: <
|
|
71
|
+
image: <VerifyIcon />,
|
|
71
72
|
headerBonus: true,
|
|
72
73
|
};
|
|
@@ -1,70 +1,78 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
2
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3
3
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
4
|
-
import React, { useState, useEffect } from
|
|
5
|
-
import PropTypes from
|
|
4
|
+
import React, { useState, useEffect, lazy, Suspense } from "react";
|
|
5
|
+
import PropTypes from "prop-types";
|
|
6
6
|
|
|
7
|
-
import useTranslate from
|
|
8
|
-
import { setCookie, getCookie } from
|
|
9
|
-
import
|
|
10
|
-
import styles from './cookie-consent.module.scss';
|
|
7
|
+
import useTranslate from "~hooks/useTranslate/useTranslate";
|
|
8
|
+
import { setCookie, getCookie } from "~helpers/cookies";
|
|
9
|
+
import styles from "./cookie-consent.module.scss";
|
|
11
10
|
|
|
12
11
|
const CookieConsent = ({
|
|
13
|
-
acceptText =
|
|
14
|
-
rejectText =
|
|
12
|
+
acceptText = "Accept",
|
|
13
|
+
rejectText = "Reject",
|
|
15
14
|
settingsCookie,
|
|
16
15
|
children,
|
|
17
|
-
cookieName =
|
|
18
|
-
logo =
|
|
16
|
+
cookieName = "CookieConsent",
|
|
17
|
+
logo = "/images/logo.svg",
|
|
19
18
|
icon = null,
|
|
20
|
-
showRejectButton=false
|
|
19
|
+
showRejectButton = false,
|
|
21
20
|
}) => {
|
|
22
21
|
const [showModal, setShowModal] = useState(false);
|
|
23
22
|
|
|
24
23
|
const [showCookieConsent, setShowCookieConsent] = useState(false);
|
|
25
24
|
|
|
25
|
+
const CookieModal = lazy(() => import("../../molecules/cookie-modal"));
|
|
26
|
+
|
|
26
27
|
// when user declines
|
|
27
28
|
const handleDecline = () => {
|
|
28
|
-
setCookie(cookieName, false, 365,
|
|
29
|
-
setCookie(
|
|
29
|
+
setCookie(cookieName, false, 365, "/");
|
|
30
|
+
setCookie("showCookie", false, 365, "/");
|
|
30
31
|
setShowCookieConsent(false);
|
|
31
32
|
setShowModal(false);
|
|
32
|
-
document.body.style.overflow =
|
|
33
|
+
document.body.style.overflow = "auto";
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
// when user accepts
|
|
36
37
|
const handleAccept = () => {
|
|
37
|
-
setCookie(cookieName, true, 365,
|
|
38
|
-
setCookie(
|
|
38
|
+
setCookie(cookieName, true, 365, "/");
|
|
39
|
+
setCookie("showCookie", false, 365, "/");
|
|
39
40
|
setShowCookieConsent(false);
|
|
40
41
|
setShowModal(false);
|
|
41
|
-
document.body.style.overflow =
|
|
42
|
+
document.body.style.overflow = "auto";
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
const handleShowModalClick = () => {
|
|
45
46
|
setShowModal(!showModal);
|
|
46
|
-
document.body.style.overflow =
|
|
47
|
+
document.body.style.overflow = "hidden";
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
const closeModal = () => {
|
|
50
51
|
setShowModal(false);
|
|
51
|
-
document.body.style.overflow =
|
|
52
|
+
document.body.style.overflow = "auto";
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
useEffect(() => {
|
|
55
|
-
if (typeof window !== `undefined` && getCookie(
|
|
56
|
+
if (typeof window !== `undefined` && getCookie("showCookie") !== "false") {
|
|
56
57
|
setShowCookieConsent(true);
|
|
57
58
|
}
|
|
58
59
|
}, []);
|
|
59
60
|
|
|
60
|
-
const settingCookieText = useTranslate(
|
|
61
|
+
const settingCookieText = useTranslate(
|
|
62
|
+
"cookie_setting_button",
|
|
63
|
+
"Cookie Setting"
|
|
64
|
+
);
|
|
61
65
|
|
|
62
66
|
return (
|
|
63
67
|
<>
|
|
64
|
-
<div
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
<div
|
|
69
|
+
className={`${styles.cookieConsent} ${
|
|
70
|
+
(showCookieConsent && styles.show) || ""
|
|
71
|
+
}`}
|
|
72
|
+
>
|
|
73
|
+
<div className={`${styles?.consent || ""}`}>
|
|
74
|
+
<div className={styles?.content || ""}>{children}</div>
|
|
75
|
+
<div className={styles?.buttonsContainer || ""}>
|
|
68
76
|
{settingsCookie && (
|
|
69
77
|
<button
|
|
70
78
|
onClick={handleShowModalClick}
|
|
@@ -90,20 +98,22 @@ const CookieConsent = ({
|
|
|
90
98
|
className="cookie-consent-gtm btn-cta"
|
|
91
99
|
type="button"
|
|
92
100
|
>
|
|
93
|
-
{useTranslate(
|
|
101
|
+
{useTranslate("cookie_accept_button", acceptText)}
|
|
94
102
|
{icon && icon}
|
|
95
103
|
</button>
|
|
96
104
|
</div>
|
|
97
105
|
</div>
|
|
98
106
|
</div>
|
|
99
107
|
{settingsCookie && showModal && (
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
108
|
+
<Suspense fallback={null}>
|
|
109
|
+
<CookieModal
|
|
110
|
+
logo={logo}
|
|
111
|
+
hide={!showModal}
|
|
112
|
+
handleAcceptCookies={handleAccept}
|
|
113
|
+
handleDeclineCookies={handleDecline}
|
|
114
|
+
closeModal={closeModal}
|
|
115
|
+
/>
|
|
116
|
+
</Suspense>
|
|
107
117
|
)}
|
|
108
118
|
</>
|
|
109
119
|
);
|
|
@@ -116,7 +126,11 @@ CookieConsent.propTypes = {
|
|
|
116
126
|
settingsCookie: PropTypes.bool,
|
|
117
127
|
cookieName: PropTypes.string,
|
|
118
128
|
logo: PropTypes.string,
|
|
119
|
-
children: PropTypes.oneOfType([
|
|
129
|
+
children: PropTypes.oneOfType([
|
|
130
|
+
PropTypes.arrayOf(PropTypes.node),
|
|
131
|
+
PropTypes.node,
|
|
132
|
+
PropTypes.any,
|
|
133
|
+
]),
|
|
120
134
|
icon: PropTypes.node,
|
|
121
135
|
};
|
|
122
136
|
|
|
@@ -56,9 +56,7 @@ const getField = (field, handleChange, elements, state) => {
|
|
|
56
56
|
required={!!option?.required}
|
|
57
57
|
/>
|
|
58
58
|
<span
|
|
59
|
-
className={`${styles.checkboxLabel || ''} ${styles.slider}
|
|
60
|
-
(!state.isValid && !elements[option.id].length && styles.invalid) || ''
|
|
61
|
-
}`}
|
|
59
|
+
className={`${styles.checkboxLabel || ''} ${styles.slider}`}
|
|
62
60
|
/>
|
|
63
61
|
<span className={styles.switchLabel}>{generatePlaceholderString(
|
|
64
62
|
useTranslate(option.translationKey, option.label),
|