gatsby-core-theme 44.4.47 → 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 CHANGED
@@ -1,3 +1,13 @@
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
+
1
11
  ## [44.4.47](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.46...v44.4.47) (2025-09-01)
2
12
 
3
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "44.4.47",
3
+ "version": "44.4.48",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -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 = <Clock />,
30
+ clock = <Suspense fallback={null}><ClockIcon /></Suspense>,
30
31
  authorImageWidth = 30,
31
32
  authorImageHeight = 30,
32
33
  showVerification = false,
33
- verifyIcon = <Verify />,
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 || <Verify />}
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
- import Verify from '~images/icons/verify';
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: <Verify />,
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 = <Verify />,
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
- import Verify from '~images/icons/verify';
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: <Verify />,
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 'react';
5
- import PropTypes from 'prop-types';
4
+ import React, { useState, useEffect, lazy, Suspense } from "react";
5
+ import PropTypes from "prop-types";
6
6
 
7
- import useTranslate from '~hooks/useTranslate/useTranslate';
8
- import { setCookie, getCookie } from '~helpers/cookies';
9
- import CookieModal from '../../molecules/cookie-modal';
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 = 'Accept',
14
- rejectText = 'Reject',
12
+ acceptText = "Accept",
13
+ rejectText = "Reject",
15
14
  settingsCookie,
16
15
  children,
17
- cookieName = 'CookieConsent',
18
- logo = '/images/logo.svg',
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('showCookie', false, 365, '/');
29
+ setCookie(cookieName, false, 365, "/");
30
+ setCookie("showCookie", false, 365, "/");
30
31
  setShowCookieConsent(false);
31
32
  setShowModal(false);
32
- document.body.style.overflow = 'auto';
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('showCookie', false, 365, '/');
38
+ setCookie(cookieName, true, 365, "/");
39
+ setCookie("showCookie", false, 365, "/");
39
40
  setShowCookieConsent(false);
40
41
  setShowModal(false);
41
- document.body.style.overflow = 'auto';
42
+ document.body.style.overflow = "auto";
42
43
  };
43
44
 
44
45
  const handleShowModalClick = () => {
45
46
  setShowModal(!showModal);
46
- document.body.style.overflow = 'hidden';
47
+ document.body.style.overflow = "hidden";
47
48
  };
48
49
 
49
50
  const closeModal = () => {
50
51
  setShowModal(false);
51
- document.body.style.overflow = 'auto';
52
+ document.body.style.overflow = "auto";
52
53
  };
53
54
 
54
55
  useEffect(() => {
55
- if (typeof window !== `undefined` && getCookie('showCookie') !== "false") {
56
+ if (typeof window !== `undefined` && getCookie("showCookie") !== "false") {
56
57
  setShowCookieConsent(true);
57
58
  }
58
59
  }, []);
59
60
 
60
- const settingCookieText = useTranslate('cookie_setting_button', 'Cookie Setting');
61
+ const settingCookieText = useTranslate(
62
+ "cookie_setting_button",
63
+ "Cookie Setting"
64
+ );
61
65
 
62
66
  return (
63
67
  <>
64
- <div className={`${styles.cookieConsent} ${(showCookieConsent && styles.show) || ''}`}>
65
- <div className={`${styles?.consent || ''}`}>
66
- <div className={styles?.content || ''}>{children}</div>
67
- <div className={styles?.buttonsContainer || ''}>
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('cookie_accept_button', acceptText)}
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
- <CookieModal
101
- logo={logo}
102
- hide={!showModal}
103
- handleAcceptCookies={handleAccept}
104
- handleDeclineCookies={handleDecline}
105
- closeModal={closeModal}
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([PropTypes.arrayOf(PropTypes.node), PropTypes.node, PropTypes.any]),
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