gatsby-core-theme 44.3.1 → 45.0.0-beta.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +6 -161
  2. package/gatsby-node.mjs +0 -3
  3. package/package.json +1 -1
  4. package/src/components/atoms/admin/bar/layout-section/index.js +5 -5
  5. package/src/components/atoms/button/operator-cta.js +3 -1
  6. package/src/components/atoms/notifications/notification-items/cards-v2/index.js +33 -15
  7. package/src/components/molecules/bonus-box/template-one/index.js +0 -1
  8. package/src/components/molecules/bonus-box/template-three/index.js +1 -2
  9. package/src/components/molecules/floating-area/index.js +22 -22
  10. package/src/components/organisms/cookie-consent/cookie-consent.module.scss +1 -2
  11. package/src/components/organisms/cookie-consent/index.js +1 -1
  12. package/src/components/organisms/search/index.js +14 -11
  13. package/src/components/organisms/search/variable/index.js +1 -1
  14. package/src/components/organisms/search/variable/searchVariable.test.js +2 -0
  15. package/src/constants/site-settings/main.mjs +1 -1
  16. package/src/constants/site-settings/navigation.js +0 -1
  17. package/src/context/MainProvider.js +4 -12
  18. package/src/helpers/date-time.js +0 -22
  19. package/src/helpers/date-time.test.js +1 -16
  20. package/src/helpers/getters.mjs +0 -17
  21. package/src/helpers/getters.test.js +0 -52
  22. package/src/resolver/archive.mjs +0 -1
  23. package/src/resolver/common.mjs +1 -1
  24. package/src/resolver/index.mjs +33 -40
  25. package/src/resolver/modules.mjs +85 -116
  26. package/src/resolver/relations.mjs +0 -21
  27. package/src/resolver/sports-relations.mjs +0 -1
  28. package/src/services/api.mjs +0 -4
  29. package/src/services/fetch.mjs +4 -8
  30. package/src/resolver/build-toplist-filter.mjs +0 -66
  31. package/src/resolver/build-toplist-filter.test.js +0 -104
package/CHANGELOG.md CHANGED
@@ -1,173 +1,18 @@
1
- ## [44.3.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.3.0...v44.3.1) (2025-06-30)
1
+ # [45.0.0-beta.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.6...v45.0.0-beta.1) (2025-06-13)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * flag module as toplist ([b0715ee](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b0715ee5aa6ad3d2f9ed86d8f5381b7e67e2181f))
7
- * move filters to page, flag toplist that has filters ([7f40833](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7f408336481a5f53febc7eb8504364971d3683d0))
6
+ * merge conflicts + alignments to master ([c6815ca](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c6815cad23928ec02d7b8db27d7ee34ba467b3e6))
7
+ * reset version ([b07bcd3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b07bcd34878e57aec199c7df1614b9ffeadece02))
8
8
 
9
9
 
10
- * Merge branch 'tm-5525-toplist-filters' into 'master' ([30427fb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/30427fbdaa89b0abf48243ad80ed81e1af23047f))
11
-
12
- # [44.3.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.20...v44.3.0) (2025-06-25)
13
-
14
-
15
- ### Bug Fixes
16
-
17
- * filters order ([78bae80](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/78bae801cd85a65cf30007997e7c8973d17d505a))
18
- * notification time ([355d437](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/355d4373ae1d7636c70e3822f1be52f502143927))
19
- * rm consoel logs ([9d02b9d](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/9d02b9d9808b904d53f4fb63ee72bb7c76bc52d6))
20
- * rm old tests ([41d19a8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/41d19a859a1d9a76e16aa19c374ab5e27f7f8557))
21
- * sync with main ([dfcc323](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/dfcc323274e8578b9de12a04345ec77692c6ca6a))
22
- * use filterOperators in processFilters ([c6745f1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c6745f1c331746565a769bb3a77f77811f4febce))
23
-
24
-
25
- * Merge branch 'tm-5525-toplist-filters' into 'master' ([e5b1468](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e5b1468a565a367351fe065d44592383ed1d31f0))
26
- * Merge branch 'tm-5536-notifications-time' into 'master' ([48889f9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/48889f94b175238fffac8fa91e88e5bf15f504f2))
27
-
28
-
29
- ### Features
30
-
31
- * build filters for enabled templates ([3d201c2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3d201c20fa5e1794b00a7522953d2ab195168bfb))
32
- * build filters on top list ([908a65f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/908a65fbb2b6fcf6869fadce2e83d96267e2c29e))
33
- * slice toplists on filters ([6074186](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/60741862f3bc6f9d30a107921a9c1866f9b1d7ac))
34
- * split filter operators, remove promises ([55483bb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/55483bbe76ed03673ce6feae7ed62bce6e8dda58))
35
-
36
-
37
- ### Tests
38
-
39
- * buildTopListFilter ([ab811e7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ab811e791e631c6fffb1cd76c05cdce36ec07987))
40
- * process filters ([d396159](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/d396159e6789b86b63d14cd743f7838e9d6dd7e3))
41
-
42
- ## [44.2.20](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.19...v44.2.20) (2025-06-24)
43
-
44
-
45
- ### Bug Fixes
46
-
47
- * typo ([68823f3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/68823f353806c946ff9602e61f9046c77d6fcd1c))
48
-
49
-
50
- * Merge branch 'fix-typo' into 'master' ([1cbb641](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/1cbb641c00625d0d84668bc74e6c8249cd06d5c3))
51
-
52
- ## [44.2.19](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.18...v44.2.19) (2025-06-24)
53
-
54
-
55
- ### Bug Fixes
56
-
57
- * remove unecessary eslint disable ([976eea0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/976eea0ca4c72e1e3b7f60f66a388849889d0ed9))
58
- * replace coupon code extra field with promo code in sites data ([2c2fbd9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2c2fbd9dd48594c54fce741e28ca54c094276fc0))
59
- * replace coupon code extra field with promo code in sites data ([96166c2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/96166c2e3acb43f0806fbca588d672570166e5cb))
60
-
61
-
62
- * Merge branch 'tm-5539-replace-coupon-code' into 'master' ([ad894e3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ad894e372eea6dab322cf04790cd91c528cef647))
63
-
64
- ## [44.2.18](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.17...v44.2.18) (2025-06-23)
65
-
66
-
67
- ### Bug Fixes
68
-
69
- * add time translations for notifications ([8635372](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8635372cb96cd6afb817bd25b1f6d094b16c077f))
70
- * add translation ([3646134](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/36461348749e99752e08ff4fc16ff8c11b9861bf))
71
- * conflicts ([b4a714f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b4a714f50b5da363067570f425be34be3b49cbd8))
72
- * operator cta ([2498397](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/24983978555b5d72b19e4e55e9c981266e4dcd4c))
73
- * resolve mentioned issues ([efc2af3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/efc2af3c70a2d000246d7b626ff7b681e5dd10b7))
74
- * test ([4e99e0b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4e99e0ba5fe28f0997d33379fd4b22e62de43334))
75
- * test ([5b776de](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5b776def206fd0472a53a3e44ded5505ffeda13c))
76
- * test ([3c20ccb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3c20ccb5e3d6d7a0ca2ed4d227da330de016deb2))
77
- * validate data ([d76d52b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/d76d52b3b58cb5412b6436fd8845482f61d2960c))
78
-
79
-
80
- * Merge branch 'tm-5453-cta-button' into 'master' ([5fd74f4](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5fd74f4a828e8520e516760c0f462292866f7f19))
81
- * Merge branch 'tm-5536-time-translations' into 'master' ([d7f6855](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/d7f68553a167bddbdf44a4c5e091d491f4d735c4))
82
-
83
- ## [44.2.17](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.16...v44.2.17) (2025-06-20)
84
-
85
-
86
- ### Bug Fixes
87
-
88
- * autosuggest logic ([75fb409](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/75fb409a4b6f72d93adbb4b98525ba655599e51b))
89
-
90
-
91
- * Merge branch 'tm-5552-autosuggest-logic' into 'master' ([6520798](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6520798d46a2be6beaf5ff24f8bb37aad90de7dc))
92
-
93
- ## [44.2.16](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.15...v44.2.16) (2025-06-19)
94
-
95
-
96
- ### Bug Fixes
97
-
98
- * added var to cookie consets ([e569b0e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e569b0e6af31ade16b8223665cc6fc0f655fee22))
99
-
100
- ## [44.2.15](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.14...v44.2.15) (2025-06-19)
101
-
102
-
103
- ### Bug Fixes
104
-
105
- * added no wrap to buttons on cookies ([62e0adc](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/62e0adc846d11ad1e66cf5a2d9b1c4452b2a5e2c))
106
- * fix the software label name ([65654fb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/65654fb209f5083031d35ab10ae9696bb77dc209))
107
-
108
- ## [44.2.14](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.13...v44.2.14) (2025-06-19)
109
-
110
-
111
- ### Bug Fixes
112
-
113
- * added props to floating area ([6868daa](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6868daab638a33bc7b73f0889901286dc20021c9))
114
-
115
- ## [44.2.13](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.12...v44.2.13) (2025-06-18)
116
-
117
-
118
- ### Bug Fixes
119
-
120
- * cookie consent not showing ([b081522](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b081522c26040bc00328ac5db67e45f19ccb38f1))
121
-
122
- ## [44.2.12](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.11...v44.2.12) (2025-06-18)
123
-
124
-
125
- ### Bug Fixes
126
-
127
- * recommended casino logic ([94eeea1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/94eeea1dee0bf2dd7cb37d26b8ba37613835ef84))
128
-
129
-
130
- * Merge branch 'tm-5521-recommended-casino-logic' into 'master' ([6a9b3e1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6a9b3e1d822f4d481cc4668a9a021e1cf4b8e4f4))
131
-
132
- ## [44.2.11](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.10...v44.2.11) (2025-06-17)
133
-
134
-
135
- ### Bug Fixes
136
-
137
- * build issue with review links ([68d07f0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/68d07f0f5c17bb9b6f6070f02931485552a5c372))
138
-
139
- ## [44.2.10](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.9...v44.2.10) (2025-06-17)
140
-
141
-
142
- ### Bug Fixes
143
-
144
- * archive pages build fix ([04098d5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/04098d5545696ac5f2371e091f761e46f579cd2d))
145
-
146
- ## [44.2.9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.8...v44.2.9) (2025-06-16)
147
-
148
-
149
- ### Bug Fixes
150
-
151
- * sports theme build fail ([c8ec05b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c8ec05ba3b5dd4bafc6e2f198c965aa11fc7c29a))
152
-
153
- ## [44.2.8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.7...v44.2.8) (2025-06-16)
154
-
155
-
156
- ### Bug Fixes
157
-
158
- * add validation ([0953152](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/09531524240dcf834cec23fd0d1538fc9a3de4cf))
159
- * added bonus page type to sports data ([2ec5dac](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2ec5dac1c058d4d98aafa35a2012ff8f84a4910f))
160
-
161
- ## [44.2.7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.6...v44.2.7) (2025-06-16)
162
-
163
-
164
- ### Bug Fixes
10
+ ### chore
165
11
 
166
- * add license and map for pages that needs that path ([62ffa4b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/62ffa4babe54d969b7513fe06bbcda0368f82e9b))
167
- * enable reading time in rocket theme ([01b0e50](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/01b0e5049052196fa4154a8f762e580c3e5d294d))
12
+ * **release:** 44.0.37-beta.1 [skip ci] ([69335e5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/69335e500807bedebfe021b5fa0164c508e6a5ff))
168
13
 
169
14
 
170
- * Merge branch 'tm-5535-mapp-providers-license' into 'master' ([8ea899b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8ea899b2773c3a69c9f5d39cdec8acae1a6324ce))
15
+ * Merge branch 'tm-5125-gatsby-node-update' into 'beta' ([b29ef69](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b29ef6979f8e654ddb0e0c15cbd430b96cf10631))
171
16
 
172
17
  ## [44.2.6](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.5...v44.2.6) (2025-06-12)
173
18
 
package/gatsby-node.mjs CHANGED
@@ -49,7 +49,6 @@ let siteSettingsData = null;
49
49
  let siteGeneralData = null;
50
50
  let allMarketsData = null;
51
51
  let providersData = null;
52
- let licensesData = null;
53
52
  let gamesData = null;
54
53
  let sportsData = null;
55
54
  let ribbonsData = null;
@@ -97,7 +96,6 @@ export const createPages = async (
97
96
  crypto_exchanges: cryptoExchangesData,
98
97
  crypto_brokers: cryptoBrokersData,
99
98
  countries: countriesData,
100
- operators_license: licensesData,
101
99
  },
102
100
  },
103
101
  themeOptions,
@@ -376,7 +374,6 @@ export const onPreBootstrap = async () => {
376
374
  cryptoExchangesData,
377
375
  cryptoBrokersData,
378
376
  countriesData,
379
- licensesData,
380
377
  } = await fetchSiteSettings(process.env.GATSBY_SITE_NAME));
381
378
  };
382
379
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "44.3.1",
3
+ "version": "45.0.0-beta.1",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -12,9 +12,9 @@ const LayoutSection = ({ menus }) => {
12
12
  case "page":
13
13
  return `site-pages/${id}`;
14
14
  case "operator":
15
- return `operators/${id?.operator_id}/sites-data/edit/${id?.id}`;
15
+ return `operators/${id.operator_id}/sites-data/edit/${id.id}`;
16
16
  case "game":
17
- return `games/${id?.game_id}/sites?site_name=${process.env.GATSBY_SITE_NAME}`;
17
+ return `games/${id.game_id}/sites?site_name=${process.env.GATSBY_SITE_NAME}`;
18
18
  case "author":
19
19
  return `site-authors/${id}`;
20
20
  case "payment_method":
@@ -40,9 +40,9 @@ const LayoutSection = ({ menus }) => {
40
40
  <li key={keygen()}>
41
41
  <Redirect
42
42
  icon={link?.icon}
43
- path={paths(link?.type, link?.data)}
44
- linkText={link?.buttonText}
45
- description={link?.description}
43
+ path={paths(link?.type, link.data)}
44
+ linkText={link.buttonText}
45
+ description={link.description}
46
46
  />
47
47
  </li>
48
48
  ))}
@@ -95,7 +95,8 @@ const OperatorCtaButton = ({
95
95
  } `;
96
96
 
97
97
  return (
98
- trackerLinkActive(operator, tracker) && status === "active" ? (
98
+ trackerLinkActive(operator, tracker) &&
99
+ (status === "active" ? (
99
100
  <a
100
101
  href={prettyLink || "#"}
101
102
  title={`${typeof translateBtn === "string" ? translateBtn : ""} ${titleSuffix || ""
@@ -120,6 +121,7 @@ const OperatorCtaButton = ({
120
121
  {icon && icon}
121
122
  </div>
122
123
  ))
124
+ )
123
125
  }
124
126
 
125
127
  OperatorCtaButton.propTypes = {
@@ -1,5 +1,3 @@
1
-
2
- /* eslint-disable react/prop-types */
3
1
  import React from "react";
4
2
  import PropTypes from "prop-types";
5
3
  import LazyImage from "~hooks/lazy-image";
@@ -9,14 +7,38 @@ import { imagePrettyUrl, getExtraField } from "~helpers/getters";
9
7
  import { getAltText, getImageFilename } from "~helpers/image";
10
8
  import useTranslate from "~hooks/useTranslate/useTranslate";
11
9
  import CloseIcon from "~images/icons/close";
12
- import { getTimeAgo } from "~helpers/date-time";
13
10
  import styles from "./notification-items.module.scss";
14
11
 
15
12
  const CardsItems = ({ module, onClose, useBanner = false }) => {
16
13
  const { items } = module;
17
14
  const noNewUpdates = useTranslate("noNewUpdates", "No new items");
18
15
 
19
- const Content = ({ item }) => {
16
+ const getTimeAgo = (dateString) => {
17
+ const date = new Date(dateString.replace(" ", "T")); // Make it ISO-compliant
18
+ const now = new Date();
19
+
20
+ const diffMs = now.getTime() - date.getTime();
21
+ const diffMinutes = Math.floor(diffMs / (1000 * 60));
22
+ const diffHours = Math.floor(diffMinutes / 60);
23
+ const diffDays = Math.floor(diffHours / 24);
24
+ const diffMonths = Math.floor(diffDays / 30);
25
+
26
+ let timeAgo = "";
27
+
28
+ if (diffDays >= 32) {
29
+ timeAgo = `${diffMonths} month${diffMonths > 1 ? "s" : ""} ago`;
30
+ } else if (diffDays >= 1) {
31
+ timeAgo = `${diffDays} day${diffDays > 1 ? "s" : ""} ago`;
32
+ } else if (diffHours >= 1) {
33
+ timeAgo = `${diffHours} hour${diffHours > 1 ? "s" : ""} ago`;
34
+ } else {
35
+ timeAgo = `${diffMinutes} minute${diffMinutes !== 1 ? "s" : ""} ago`;
36
+ }
37
+
38
+ return timeAgo;
39
+ };
40
+
41
+ const content = (item) => {
20
42
  const priorityImage = useBanner
21
43
  ? item?.banner || item?.relation?.logo?.fileName
22
44
  : item?.relation?.logo?.fileName;
@@ -30,14 +52,6 @@ const CardsItems = ({ module, onClose, useBanner = false }) => {
30
52
  const TitleTag = item?.title_tag || "label";
31
53
  const ribbon = getExtraField(item?.extra_fields, "notification_ribbon");
32
54
 
33
- const { key, value } = getTimeAgo(
34
- item?.manual_updated_at ||
35
- item?.updated_at ||
36
- item?.manual_created_at ||
37
- item?.created_at
38
- );
39
- const timeAgo = `${value} ${useTranslate(key, key?.replace("_", " "))}`;
40
-
41
55
  return (
42
56
  <div className={styles.notificationContent}>
43
57
  {img && (
@@ -63,7 +77,12 @@ const CardsItems = ({ module, onClose, useBanner = false }) => {
63
77
  <div className={styles.ribbonAndTime}>
64
78
  {ribbon && <span className={styles.ribbon}>{ribbon}</span>}
65
79
  <span className={styles.extraContent}>
66
- {timeAgo}
80
+ {getTimeAgo(
81
+ item?.manual_updated_at ||
82
+ item?.updated_at ||
83
+ item?.manual_created_at ||
84
+ item?.created_at
85
+ )}
67
86
  </span>
68
87
  </div>
69
88
  )}
@@ -71,7 +90,6 @@ const CardsItems = ({ module, onClose, useBanner = false }) => {
71
90
  </div>
72
91
  );
73
92
  };
74
-
75
93
  return (
76
94
  <div className={styles.container || ""}>
77
95
  <div className={styles.notificationsContainer || ""}>
@@ -102,7 +120,7 @@ const CardsItems = ({ module, onClose, useBanner = false }) => {
102
120
  className={`${styles.notificationLink} cards-gtm`}
103
121
  aria-label={`${item?.title} Link`}
104
122
  >
105
- <Content item={item} />
123
+ {content(item)}
106
124
  </Link>
107
125
  </li>
108
126
  ))}
@@ -44,7 +44,6 @@ export default function BonusBox({
44
44
  {showVariablesComponent && (
45
45
  <VariableComponent
46
46
  item={item}
47
- tracker={tracker}
48
47
  moduleName={moduleName}
49
48
  modulePosition={modulePosition}
50
49
  itemPosition={itemPosition}
@@ -88,7 +88,6 @@ export default function BonusBox({
88
88
  {showVariablesComponent && variableInsideContainer && (
89
89
  <VariableComponent
90
90
  item={item}
91
- tracker={tracker}
92
91
  moduleName={moduleName}
93
92
  clickedElement={`${clickedElement}_cta`}
94
93
  modulePosition={modulePosition}
@@ -99,7 +98,7 @@ export default function BonusBox({
99
98
  )}
100
99
 
101
100
  {showVariablesComponent && !variableInsideContainer && (
102
- <VariableComponent item={item} tracker={tracker} moduleName={moduleName} modulePosition={modulePosition}
101
+ <VariableComponent item={item} moduleName={moduleName} modulePosition={modulePosition}
103
102
  itemPosition={itemPosition} clickedElement={clickedElement} />
104
103
  )}
105
104
  </div>
@@ -71,8 +71,7 @@ export default function FloatingArea({
71
71
 
72
72
  return (
73
73
  <div className={`${styles.floatingArea} ${showScroll ? styles.show : ""}`}>
74
- {(pageTypes?.[pageTemplate]?.showScrollToTop ||
75
- pageTypes.default?.showScrollToTop) && <ScrollToTop />}
74
+ <ScrollToTop />
76
75
  {OperatorBanner && (
77
76
  <Suspense fallback={<></>}>
78
77
  <OperatorBanner
@@ -88,26 +87,27 @@ export default function FloatingArea({
88
87
  </Suspense>
89
88
  )}
90
89
 
91
- {CookieConsent && showCookies && (
92
- <CookieConsent
93
- market={pageContext?.page?.market}
94
- type={pageType}
95
- template={template}
96
- settingsCookie
97
- isPageHomepage={isPageHomepage}
98
- >
99
- {customCookieContent || (
100
- <p>
101
- We use cookies in order to optimise our site and improve your
102
- experience with us. By using the site you consent to our
103
- <a href="/cookies" className="cookie-consent-gtm">
104
- Cookie Policy
105
- </a>
106
- .
107
- </p>
108
- )}
109
- </CookieConsent>
110
- )}
90
+ {CookieConsent &&
91
+ showCookies && (
92
+ <CookieConsent
93
+ market={pageContext?.page?.market}
94
+ type={pageType}
95
+ template={template}
96
+ settingsCookie
97
+ isPageHomepage={isPageHomepage}
98
+ >
99
+ {
100
+ customCookieContent || <p>
101
+ We use cookies in order to optimise our site and improve your
102
+ experience with us. By using the site you consent to our
103
+ <a href="/cookies" className="cookie-consent-gtm">
104
+ Cookie Policy
105
+ </a>
106
+ .
107
+ </p>
108
+ }
109
+ </CookieConsent>
110
+ )}
111
111
  {FooterNavigation && (
112
112
  <Suspense fallback={<></>}>
113
113
  <FooterNavigation section={footerNavigationData} />
@@ -44,9 +44,8 @@
44
44
  background-color: var(--primary-button-color, #6e33e5);
45
45
  }
46
46
  button {
47
- text-wrap: var(--cookie-consent-wrap-button, nowrap);
48
47
  height: var(--cookie-consent-button-height, 5.6rem);
49
- display: var(--cookie-consent-button-display, flex);
48
+ display: flex;
50
49
  border-radius: var(--cookie-consent-button-radius, 10rem);
51
50
  padding: var(--cookie-consent-button-padding, 1.6rem 2.4rem);
52
51
  font-size: var(--cookie-consent-button-size, 1.8rem);
@@ -52,7 +52,7 @@ const CookieConsent = ({
52
52
  };
53
53
 
54
54
  useEffect(() => {
55
- if (typeof window !== `undefined` && getCookie('showCookie') !== false) {
55
+ if (typeof window !== `undefined` && getCookie('showCookie') !== 'false') {
56
56
  setShowCookieConsent(true);
57
57
  }
58
58
  }, []);
@@ -81,8 +81,9 @@ const SearchForm = ({
81
81
  } else {
82
82
  const searchUrl =
83
83
  marketPrefix !== "/"
84
- ? `/${marketPrefix}/s${process.env.TRAILING_SLASH ? "/" : ""}?s=${e.target.value
85
- }`
84
+ ? `/${marketPrefix}/s${process.env.TRAILING_SLASH ? "/" : ""}?s=${
85
+ e.target.value
86
+ }`
86
87
  : `/s${process.env.TRAILING_SLASH ? "/" : ""}?s=${e.target.value}`;
87
88
  window.location = `${window.location.origin}${searchUrl}`;
88
89
  }
@@ -147,8 +148,9 @@ const SearchForm = ({
147
148
  type="button"
148
149
  aria-label={useTranslate("ariaLabel-search", "Search")}
149
150
  onClick={handleOnSearchIconClick}
150
- className={`${styles.searchButton || ""} ${localSearch && (styles.active || "")
151
- } search-gtm btn-cta`}
151
+ className={`${styles.searchButton || ""} ${
152
+ localSearch && (styles.active || "")
153
+ } search-gtm btn-cta`}
152
154
  disabled={isDisabled}
153
155
  >
154
156
  {searchIcon === null ? (
@@ -235,12 +237,13 @@ const SearchForm = ({
235
237
  const inputValue =
236
238
  searchInputRef.current?.value.trim();
237
239
  if (inputValue) {
238
- const url = `/s${process.env.TRAILING_SLASH
239
- ? "/"
240
- : ""
241
- }?s=${encodeURIComponent(
242
- inputValue
243
- )}`;
240
+ const url = `/s${
241
+ process.env.TRAILING_SLASH
242
+ ? "/"
243
+ : ""
244
+ }?s=${encodeURIComponent(
245
+ inputValue
246
+ )}`;
244
247
  window.location.href = url;
245
248
  }
246
249
  }}
@@ -269,7 +272,7 @@ const SearchForm = ({
269
272
  )}
270
273
  </div>
271
274
  )}
272
- {(showRecommendedCasinos || showTopSearches) && (!filteredData || filteredData.length === 0) && !autoCompleteLoading && (
275
+ {(showRecommendedCasinos || showTopSearches) && (
273
276
  <VariableComponent
274
277
  recommendedCasinos={recommendedCasinos}
275
278
  topSearches={topSearches}
@@ -28,7 +28,7 @@ const VariableComponent = ({
28
28
  >
29
29
  {showTopSearches && (
30
30
  <div className={styles.topSearches}>
31
- <p>{useTranslate("top_searches_bar", "Top Searches:")}</p>
31
+ <p>Top Searches:</p>
32
32
  {topSearches?.map((item) => (
33
33
  <Link key={item.id} to={item?.link?.value}>
34
34
  {item?.label}
@@ -29,6 +29,8 @@ describe("VariableComponent", () => {
29
29
  />
30
30
  );
31
31
 
32
+ expect(screen.getByText("Top Searches:")).toBeInTheDocument();
33
+
32
34
  topSearches.forEach((item) => {
33
35
  expect(screen.getByText(item.label)).toBeInTheDocument();
34
36
  });
@@ -15,7 +15,7 @@ export const mainSettings = {
15
15
  article: {
16
16
  reading_time: {
17
17
  "spielhallen.com": true,
18
- "demo-rocket-theme.gigmedia.com": true,
18
+ "demo-matrix-theme.gigmedia.com": true,
19
19
  default: false,
20
20
  },
21
21
  },
@@ -34,7 +34,6 @@ export const pageTypes = {
34
34
  showLogoWithLink: true,
35
35
  disableSearch: false,
36
36
  showNotification: true,
37
- showScrollToTop: true,
38
37
  customComponent: true,
39
38
  exclusiveOperator: true,
40
39
  navMenu: "main_menu",
@@ -1,20 +1,13 @@
1
1
  /* eslint-disable react/prop-types */
2
- import React, { createContext, useState } from "react";
2
+ import React, { createContext, useState } from 'react';
3
3
 
4
4
  export const Context = createContext();
5
5
 
6
6
  export default (props) => {
7
7
  const { value, children } = props;
8
8
 
9
- const [showTranslationKeys, setShowTranslationKeys] = useState(false);
10
- const [showFilter, setShowFilter] = useState(false);
11
- const [topListFilters, setTopListFilters] = useState();
12
- const topListContext = {
13
- showFilter,
14
- setShowFilter,
15
- topListFilters,
16
- setTopListFilters,
17
- };
9
+ const [ showTranslationKeys, setShowTranslationKeys ] = useState(false);
10
+
18
11
  return (
19
12
  <Context.Provider
20
13
  value={{
@@ -22,9 +15,8 @@ export default (props) => {
22
15
  preview: value.isPreview,
23
16
  language: value.language,
24
17
  admin: value.admin,
25
- setShowTranslationKeys,
26
18
  showTranslationKeys,
27
- topListContext,
19
+ setShowTranslationKeys
28
20
  }}
29
21
  >
30
22
  {children}
@@ -28,25 +28,3 @@ export function formatDate(date, format, separator = '/', market = 'en-GB') {
28
28
  }
29
29
  return formattedDate;
30
30
  }
31
-
32
- export const getTimeAgo = (dateString) => {
33
- const date = new Date(dateString.replace(" ", "T")); // Make it ISO-compliant
34
- const now = new Date();
35
-
36
- const diffMs = now.getTime() - date.getTime();
37
- const diffMinutes = Math.floor(diffMs / (1000 * 60));
38
- const diffHours = Math.floor(diffMinutes / 60);
39
- const diffDays = Math.floor(diffHours / 24);
40
- const diffMonths = Math.floor(diffDays / 30);
41
-
42
- if (diffDays >= 32) {
43
- return { value: diffMonths, key: diffMonths === 1 ? "month_ago" : "months_ago" };
44
- }
45
- if (diffDays >= 1) {
46
- return { value: diffDays, key: diffDays === 1 ? "day_ago" : "days_ago" };
47
- }
48
- if (diffHours >= 1) {
49
- return { value: diffHours, key: diffHours === 1 ? "hour_ago" : "hours_ago" };
50
- }
51
- return { value: diffMinutes, key: diffMinutes === 1 ? "minute_ago" : "minutes_ago" };
52
- };
@@ -1,4 +1,4 @@
1
- import { formatDate, getTimeAgo } from './date-time';
1
+ import { formatDate } from './date-time';
2
2
 
3
3
  describe('Date-Time Helper', () => {
4
4
  test('formatDate()', () => {
@@ -7,19 +7,4 @@ describe('Date-Time Helper', () => {
7
7
  expect(formatDate('2020-04-23 11:45:10', 'MMM YYYY', '/', 'en-US')).toEqual('April 2020');
8
8
  expect(formatDate('2020-04-23 11:45:10', 'DD/MM/YYYY', '@@', 'en-US')).toEqual('04@@23@@2020');
9
9
  });
10
-
11
-
12
- test('getTimeAgo()', () => {
13
- const now = new Date();
14
-
15
- const minutesAgo = new Date(now.getTime() - 5 * 60 * 1000).toISOString(); // 5 minutes ago
16
- const hoursAgo = new Date(now.getTime() - 2 * 60 * 60 * 1000).toISOString(); // 2 hours ago
17
- const daysAgo = new Date(now.getTime() - 10 * 24 * 60 * 60 * 1000).toISOString(); // 10 days ago
18
- const monthsAgo = new Date(now.getTime() - 65 * 24 * 60 * 60 * 1000).toISOString(); // ~2 months ago
19
-
20
- expect(getTimeAgo(minutesAgo)).toMatchObject({ key: 'minutes_ago', value: 5 });
21
- expect(getTimeAgo(hoursAgo)).toMatchObject({ key: 'hours_ago', value: 2 });
22
- expect(getTimeAgo(daysAgo)).toMatchObject({ key: 'days_ago', value: 10 });
23
- expect(getTimeAgo(monthsAgo)).toMatchObject({ key: 'months_ago', value: 2 });
24
- });
25
10
  });