gatsby-core-theme 44.30.7 → 44.31.1

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,25 @@
1
+ ## [44.31.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.31.0...v44.31.1) (2026-07-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * give styling for external buttons as well ([108e1c1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/108e1c1b452be295ef72c7897977d281b58cbaa8))
7
+ * update classname ([09f16a2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/09f16a263580b099fe8fe95fe7858ae702136d8a))
8
+
9
+
10
+ * Merge branch 'en-590-buttons' into 'master' ([93e44f4](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/93e44f4a456cced4b88c1240db289c7755349d9d))
11
+
12
+ # [44.31.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.30.7...v44.31.0) (2026-07-07)
13
+
14
+
15
+ * Merge branch 'feat/coupon-acts-like-cta' into 'master' ([f5e1823](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/f5e182396a398e9fcf8dd598474483b4c05e0ff1))
16
+
17
+
18
+ ### Features
19
+
20
+ * coupon act as cta opt in option for bonus ([6e2bcb6](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6e2bcb67404c234e7935567762668cc694607811))
21
+ * share CTA tracking data-attributes and expose fireTracking for coupon CTA ([17025e2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/17025e229d2b097662aa81ea9b0de26b6758c1e8))
22
+
1
23
  ## [44.30.7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.30.6...v44.30.7) (2026-07-06)
2
24
 
3
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "44.30.7",
3
+ "version": "44.31.1",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -4,10 +4,9 @@ import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import useTranslate from '~hooks/useTranslate/useTranslate';
6
6
  import { prettyTracker } from '~helpers/getters';
7
- import { trackerLinkActive } from '~helpers/tracker';
7
+ import { trackerLinkActive, getCtaDataAttributes } from '~helpers/tracker';
8
8
  import styles from './button.module.scss';
9
9
  import useCtaClickHandler from '../../../hooks/useCtaClickHandler/index';
10
- import operatorTypes from "../../../constants/operatorTypes";
11
10
 
12
11
  const OperatorCtaButton = ({
13
12
  operator,
@@ -71,14 +70,6 @@ const OperatorCtaButton = ({
71
70
  const classes = `${styles[buttonType] || ''} ${status && styles[status] ? styles[status] : ''} ${buttonSize ? styles[`${buttonSize}_size`] : ''
72
71
  } `;
73
72
 
74
- const operatorName = operator?.short_name || operator?.name || undefined;
75
- const dataModule = moduleName && modulePosition ? `${moduleName}-${modulePosition}` : undefined;
76
- const dataLocation =
77
- moduleName && modulePosition
78
- ? `${moduleName}-${modulePosition}${
79
- itemPosition ? `-position-${itemPosition}` : ""
80
- }`
81
- : undefined;
82
73
  return (
83
74
  trackerLinkActive(operator, tracker) && status === "active" ? (
84
75
  <a
@@ -92,13 +83,12 @@ const OperatorCtaButton = ({
92
83
  target="_blank"
93
84
  rel={rel}
94
85
  onClick={handleCtaClick}
95
- data-interaction="outbound-click"
96
- {...(operator?.type && { 'data-vertical': operatorTypes[operator?.type] || operator?.type })}
97
- {...(operatorName && { 'data-operator': operatorName })}
98
- {...(trackerType && { 'data-tracker': trackerType })}
99
- {...(modulePosition && { 'data-location': dataLocation })}
100
- {...(itemPosition && { 'data-position': itemPosition })}
101
- {...(dataModule && { 'data-module': dataModule })}
86
+ {...getCtaDataAttributes(operator, {
87
+ tracker,
88
+ moduleName,
89
+ modulePosition,
90
+ itemPosition,
91
+ })}
102
92
  >
103
93
  {translateBtn}
104
94
  {icon && icon}
@@ -8,7 +8,7 @@ import OperatorCta from "~atoms/button/operator-cta";
8
8
  import Rating from "~molecules/star-rating/one-star";
9
9
  import Tnc from "~molecules/tnc";
10
10
  import PrettyLink from "~atoms/pretty-link";
11
- import { TrackingKeys } from '~constants/tracking-api'
11
+ import { TrackingKeys } from "~constants/tracking-api";
12
12
  import styles from "./bonus.module.scss";
13
13
  import Ribbons from "../../../atoms/ribbons";
14
14
 
@@ -26,12 +26,16 @@ export default function Bonus({
26
26
  ctaIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />,
27
27
  modulePosition,
28
28
  showRibbon = false,
29
- customClass='',
29
+ customClass = "",
30
+ couponActsAsCta = false,
30
31
  }) {
31
-
32
32
  const { logo, bonus, name } = operator || {};
33
33
  return (
34
- <div className={`${styles.operatorBanner || ""} ${customClass && styles[customClass]}`}>
34
+ <div
35
+ className={`${styles.operatorBanner || ""} ${
36
+ customClass && styles[customClass]
37
+ }`}
38
+ >
35
39
  <div className={styles.container}>
36
40
  {showRibbon && <Ribbons item={operator.ribbons} />}
37
41
  <div>
@@ -72,6 +76,7 @@ export default function Bonus({
72
76
  pageTemplate={pageTemplate}
73
77
  tracker={module?.type || "main"}
74
78
  modulePosition={modulePosition}
79
+ couponActsAsCta={couponActsAsCta}
75
80
  />
76
81
  {!tncFixed && (
77
82
  <Tnc
@@ -135,5 +140,6 @@ Bonus.propTypes = {
135
140
  ctaIcon: PropTypes.elementType,
136
141
  modulePosition: PropTypes.number,
137
142
  showRibbon: PropTypes.bool,
138
- customClass: PropTypes.string
143
+ customClass: PropTypes.string,
144
+ couponActsAsCta: PropTypes.bool,
139
145
  };
@@ -11,7 +11,7 @@ import Rating from "~molecules/star-rating/one-star";
11
11
  import Tnc from "~molecules/tnc";
12
12
  import PrettyLink from "~atoms/pretty-link";
13
13
  import useTranslate from "~hooks/useTranslate/useTranslate";
14
- import { TrackingKeys } from '~constants/tracking-api'
14
+ import { TrackingKeys } from "~constants/tracking-api";
15
15
  import styles from "./bonus.module.scss";
16
16
 
17
17
  export default function TemplateOne({
@@ -29,12 +29,12 @@ export default function TemplateOne({
29
29
  height = 120,
30
30
  showRatingLabel = false,
31
31
  showLabelMiddle = false,
32
- ctaIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />
33
-
32
+ couponActsAsCta = false,
33
+ ctaIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />,
34
34
  }) {
35
35
  const { logo, bonus, name } = operator || {};
36
36
  const hasTncEnable = getOperatorTnc(operator);
37
-
37
+
38
38
  const welcomeBonusText = useTranslate("welcome_bonus", "Welcome Bonus");
39
39
  const translationsObj = {
40
40
  active: {
@@ -54,8 +54,9 @@ export default function TemplateOne({
54
54
  ${hasTncEnable ? styles.operatorBannerTNC : ""}
55
55
  ${!closedBanner ? styles.show : styles.hide}
56
56
  ${styles.tncEnable}
57
- ${tncFixed ? styles.showTncFixed || "" : ""} ${floating ? styles.floating : ""
58
- }`}
57
+ ${tncFixed ? styles.showTncFixed || "" : ""} ${
58
+ floating ? styles.floating : ""
59
+ }`}
59
60
  >
60
61
  <div className={styles.container}>
61
62
  <div>
@@ -94,7 +95,13 @@ export default function TemplateOne({
94
95
  <p className={styles.welcomeBonus}>{welcomeBonusText}</p>
95
96
  )}
96
97
 
97
- <BonusBox moduleName={moduleName} item={operator} tracker={module?.type || "main"} pageTemplate={pageTemplate} />
98
+ <BonusBox
99
+ moduleName={moduleName}
100
+ item={operator}
101
+ tracker={module?.type || "main"}
102
+ pageTemplate={pageTemplate}
103
+ couponActsAsCta={couponActsAsCta}
104
+ />
98
105
  {!tncFixed && (
99
106
  <Tnc
100
107
  isFixed={tncFixed}
@@ -158,4 +165,5 @@ TemplateOne.propTypes = {
158
165
  showLabelMiddle: PropTypes.bool,
159
166
  ctaIcon: PropTypes.elementType,
160
167
  showRoundedRating: PropTypes.bool,
168
+ couponActsAsCta: PropTypes.bool,
161
169
  };
@@ -106,7 +106,9 @@ export default (
106
106
  pageTemplate={pageTemplate}
107
107
  moduleName={TrackingKeys?.CONTENT}
108
108
  tracker={module?.tracking_link_name || "main"}
109
- className="content-module-gtm"
109
+ className={[node?.attribs?.class, "content-module-gtm"]
110
+ .filter(Boolean)
111
+ .join(" ")}
110
112
  clickedElement="link"
111
113
  rel={node?.attribs?.rel}
112
114
  modulePosition={modulePosition}
@@ -3,6 +3,7 @@
3
3
  import { generateTrackerLink } from "./generators.mjs";
4
4
  import { stripSuffixSlash } from "./strings.mjs";
5
5
  import { getCookie } from "./cookies.mjs";
6
+ import operatorTypes from "../constants/operatorTypes.js";
6
7
 
7
8
  export function getTrackerName(operator, page, path) {
8
9
  const trackerLinks = operator ? Object.keys(operator.links) : [];
@@ -352,3 +353,33 @@ export function buildExternalRefererDeleteSetCookies(headers) {
352
353
 
353
354
  return buildDeleteCookie("");
354
355
  }
356
+
357
+ // Builds the GTM `data-*` attributes for an outbound CTA anchor so that every
358
+ // CTA (operator button, coupon redirect, …) tags clicks identically.
359
+ export function getCtaDataAttributes(
360
+ operator,
361
+ { tracker = "main", moduleName, modulePosition, itemPosition } = {}
362
+ ) {
363
+ const trackerType = tracker?.toLowerCase()?.replace(" ", "_");
364
+ const operatorName = operator?.short_name || operator?.name || undefined;
365
+ const dataModule =
366
+ moduleName && modulePosition ? `${moduleName}-${modulePosition}` : undefined;
367
+ const dataLocation =
368
+ moduleName && modulePosition
369
+ ? `${moduleName}-${modulePosition}${
370
+ itemPosition ? `-position-${itemPosition}` : ""
371
+ }`
372
+ : undefined;
373
+
374
+ return {
375
+ "data-interaction": "outbound-click",
376
+ ...(operator?.type && {
377
+ "data-vertical": operatorTypes[operator?.type] || operator?.type,
378
+ }),
379
+ ...(operatorName && { "data-operator": operatorName }),
380
+ ...(trackerType && { "data-tracker": trackerType }),
381
+ ...(modulePosition && { "data-location": dataLocation }),
382
+ ...(itemPosition && { "data-position": itemPosition }),
383
+ ...(dataModule && { "data-module": dataModule }),
384
+ };
385
+ }
@@ -470,4 +470,36 @@ describe("Tracker Helper", () => {
470
470
  expect(result[1]).toBe(`${cookieBase}; SameSite=Lax`);
471
471
  });
472
472
  });
473
+
474
+ describe("getCtaDataAttributes", () => {
475
+ test("builds outbound data-* attributes from operator + tracking context", () => {
476
+ const attrs = Tracker.getCtaDataAttributes(
477
+ { short_name: "rizk", type: "sportsbook" },
478
+ {
479
+ tracker: "PPC Fallback",
480
+ moduleName: "wageringCalculator",
481
+ modulePosition: 2,
482
+ itemPosition: 3,
483
+ }
484
+ );
485
+ expect(attrs).toEqual({
486
+ "data-interaction": "outbound-click",
487
+ "data-vertical": "sportsbook",
488
+ "data-operator": "rizk",
489
+ "data-tracker": "ppc_fallback",
490
+ "data-location": "wageringCalculator-2-position-3",
491
+ "data-position": 3,
492
+ "data-module": "wageringCalculator-2",
493
+ });
494
+ });
495
+
496
+ test("omits optional attributes when tracking context is missing", () => {
497
+ const attrs = Tracker.getCtaDataAttributes({ name: "Rizk Casino" });
498
+ expect(attrs).toEqual({
499
+ "data-interaction": "outbound-click",
500
+ "data-operator": "Rizk Casino",
501
+ "data-tracker": "main",
502
+ });
503
+ });
504
+ });
473
505
  });
@@ -76,7 +76,7 @@ const useCtaClickHandler = ({
76
76
  [fireTracking]
77
77
  );
78
78
 
79
- return { ctaRef, handleCtaClick };
79
+ return { ctaRef, handleCtaClick, fireTracking };
80
80
  };
81
81
 
82
82
  export default useCtaClickHandler;