gatsby-matrix-theme 53.3.12 → 53.3.14

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,20 @@
1
+ ## [53.3.14](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.3.13...v53.3.14) (2025-11-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update core version ([ee8380f](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/ee8380f27009c66ddaa2408481003fc91d0e44e6))
7
+
8
+ ## [53.3.13](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.3.12...v53.3.13) (2025-11-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add a new component on body ([15ea2ad](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/15ea2ad7ad8e39af754f44806723e7b37345ab4c))
14
+
15
+
16
+ * Merge branch 'en-161-sticky-operator-banner' into 'master' ([305b65a](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/305b65a540ac3b37a95928cd0465ddfb3d6c2958))
17
+
1
18
  ## [53.3.12](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.3.11...v53.3.12) (2025-10-30)
2
19
 
3
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "53.3.12",
3
+ "version": "53.3.14",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@react-icons/all-files": "^4.1.0",
27
27
  "gatsby": "^5.11.0",
28
- "gatsby-core-theme": "44.5.3",
28
+ "gatsby-core-theme": "44.6.0",
29
29
  "gatsby-plugin-sharp": "^5.11.0",
30
30
  "gatsby-transformer-sharp": "^5.11.0",
31
31
  "gatsby-plugin-sitemap": "^6.13.1",
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { imagePrettyUrl } from '~helpers/getters';
4
+ import LazyImage from '~hooks/lazy-image';
5
+ import PrettyLink from '~atoms/pretty-link';
6
+ import styles from './stickyOperatorBanner.module.scss';
7
+
8
+ const StickyOperatorBanner = ({ data, template }) => {
9
+ const getRandomItem = (array) => {
10
+ if (!array || array.length === 0) return null;
11
+ const randomIndex = Math.floor(Math.random() * array.length);
12
+ return array[randomIndex];
13
+ };
14
+
15
+ const gif = data?.extra_fields?.gif;
16
+ const toplist = data?.modules?.find((module) => module.name === 'top_list');
17
+ const tracker = toplist?.items?.[0]?.tracker || 'main';
18
+ const randomItem = getRandomItem(toplist?.items?.[0]?.items);
19
+
20
+ if (!gif || !randomItem) return null;
21
+
22
+ return (
23
+ <PrettyLink
24
+ operator={randomItem}
25
+ tracker={tracker}
26
+ template={template}
27
+ className={styles.container}
28
+ >
29
+ <LazyImage src={imagePrettyUrl(gif, 'auto', 'auto')} alt="Sticky Operator Banner" />
30
+ </PrettyLink>
31
+ );
32
+ };
33
+
34
+ StickyOperatorBanner.propTypes = {
35
+ data: PropTypes.shape({
36
+ extra_fields: PropTypes.shape({
37
+ gif: PropTypes.string,
38
+ }),
39
+ modules: PropTypes.arrayOf(
40
+ PropTypes.shape({
41
+ name: PropTypes.string,
42
+ items: PropTypes.arrayOf(
43
+ PropTypes.shape({
44
+ tracker: PropTypes.string,
45
+
46
+ items: PropTypes.shape({}),
47
+ })
48
+ ),
49
+ })
50
+ ),
51
+ }),
52
+ template: PropTypes.string,
53
+ };
54
+
55
+ export default StickyOperatorBanner;
@@ -0,0 +1,12 @@
1
+ .container {
2
+ position: fixed;
3
+ bottom: 0;
4
+ width: 100%;
5
+ height: 8.8rem;
6
+ z-index: 2;
7
+
8
+ img {
9
+ width: 100%;
10
+ height: 8.8rem;
11
+ };
12
+ }
@@ -0,0 +1,79 @@
1
+ /* eslint-disable react/prop-types */
2
+ /* eslint-disable react/destructuring-assignment */
3
+ import React from 'react';
4
+ import { render, screen } from '@testing-library/react';
5
+ import StickyOperatorBanner from ".";
6
+
7
+ // Mock dependencies
8
+ jest.mock('~helpers/getters', () => ({
9
+ imagePrettyUrl: jest.fn((url) => `pretty/${url}`),
10
+ }));
11
+ jest.mock('~hooks/lazy-image', () => (props) => <img data-testid="lazy-image" {...props} alt='Test' />);
12
+ jest.mock('~atoms/pretty-link', () => (props) => (
13
+ <a data-testid="pretty-link" {...props}>
14
+ {props.children}
15
+ </a>
16
+ ));
17
+
18
+ describe('StickyOperatorBanner', () => {
19
+ const mockData = {
20
+ extra_fields: { gif: 'banner.gif' },
21
+ modules: [
22
+ {
23
+ name: 'top_list',
24
+ items: [
25
+ {
26
+ tracker: 'test-tracker',
27
+ items: [
28
+ { id: 1, name: 'Operator A' },
29
+ { id: 2, name: 'Operator B' },
30
+ ],
31
+ },
32
+ ],
33
+ },
34
+ ],
35
+ };
36
+
37
+ it('renders banner with LazyImage and PrettyLink', () => {
38
+ render(<StickyOperatorBanner data={mockData} template="casino" />);
39
+
40
+ const image = screen.getByTestId('lazy-image');
41
+ const link = screen.getByTestId('pretty-link');
42
+
43
+ expect(image).toBeInTheDocument();
44
+ expect(image).toHaveAttribute('src', 'pretty/banner.gif');
45
+ expect(link).toBeInTheDocument();
46
+ });
47
+
48
+ it('renders null if gif is missing', () => {
49
+ const dataWithoutGif = { ...mockData, extra_fields: {} };
50
+ const { container } = render(<StickyOperatorBanner data={dataWithoutGif} />);
51
+ expect(container.firstChild).toBeNull();
52
+ });
53
+
54
+ it('renders null if toplist items missing', () => {
55
+ const dataWithoutItems = { ...mockData, modules: [] };
56
+ const { container } = render(<StickyOperatorBanner data={dataWithoutItems} />);
57
+ expect(container.firstChild).toBeNull();
58
+ });
59
+
60
+ it('uses default tracker if not provided', () => {
61
+ const dataNoTracker = {
62
+ extra_fields: { gif: 'banner.gif' },
63
+ modules: [
64
+ {
65
+ name: 'top_list',
66
+ items: [
67
+ {
68
+ items: [{ id: 1, name: 'Operator X' }],
69
+ },
70
+ ],
71
+ },
72
+ ],
73
+ };
74
+
75
+ render(<StickyOperatorBanner data={dataNoTracker} />);
76
+ const link = screen.getByTestId('pretty-link');
77
+ expect(link).toHaveAttribute('tracker', 'main');
78
+ });
79
+ });
@@ -16,6 +16,7 @@ import Popup from '../../../../components/organisms/popup';
16
16
  import LinkMenu from '../../../../components/atoms/link-menu';
17
17
  import { isSearchPath } from '~helpers/isSearchPath';
18
18
  import ExclusiveOperator from '../../../../components/molecules/operator-exclusive';
19
+ import StickyOperatorBanner from '../../../../components/molecules/stickyOperatorBanner';
19
20
  import { setCookie, getCookie } from '~helpers/cookies';
20
21
 
21
22
  function Body({ pageContext, children, serverData }) {
@@ -35,6 +36,12 @@ function Body({ pageContext, children, serverData }) {
35
36
  pageContext
36
37
  );
37
38
 
39
+ const stickyOperatorBanner = getMarketSection(
40
+ pageTypes[template]?.operatorBannerSection || pageTypes.default.operatorBannerSection,
41
+ pageContext
42
+ );
43
+
44
+
38
45
  const footer = pageTypes[template]?.disableFooter
39
46
  ? null
40
47
  : getMarketSection('footer', pageContext);
@@ -48,6 +55,8 @@ function Body({ pageContext, children, serverData }) {
48
55
 
49
56
  const excOperator = navigation?.modules.find((module) => module.name === 'bonus');
50
57
 
58
+ const toplistInStickyBanner = stickyOperatorBanner?.modules.find((module) => module.name === 'top_list');
59
+
51
60
  const isContactUsPage = !!main?.modules?.filter((module) => module.name === 'contact_form')
52
61
  .length;
53
62
 
@@ -63,10 +72,15 @@ function Body({ pageContext, children, serverData }) {
63
72
  const exclusiveOperator =
64
73
  pageTypes[template]?.exclusiveOperator ?? pageTypes.default.exclusiveOperator;
65
74
 
75
+ const stickyOperator = pageTypes[template]?.stickyOperatorBanner ?? pageTypes.default.stickyOperatorBanner;
76
+
66
77
  const disablePopup = pageTypes[template]?.disablePopup ?? pageTypes.default.disablePopup;
67
78
 
68
79
  const showExclusiveOperator = excOperator && pageType !== 'operator' && exclusiveOperator;
69
80
 
81
+ const showStickyOperatorBanner =
82
+ toplistInStickyBanner && pageType !== 'operator' && stickyOperator;
83
+
70
84
  const popupData = pageContext?.marketSections?.popup?.modules?.find((m) => m.name === 'top_list');
71
85
 
72
86
  const popupImage = pageContext?.marketSections?.popup?.extra_fields?.popup_image;
@@ -133,6 +147,10 @@ function Body({ pageContext, children, serverData }) {
133
147
  image={popupImage}
134
148
  />
135
149
  )}
150
+ {showStickyOperatorBanner && (
151
+ <StickyOperatorBanner data={stickyOperatorBanner} template={template} />
152
+ )}
153
+
136
154
  <FloatingArea pageContext={pageContext} template={template} />
137
155
  </>
138
156
  );