gatsby-core-theme 44.3.0 → 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.
- package/CHANGELOG.md +6 -150
- package/gatsby-node.mjs +0 -3
- package/package.json +1 -1
- package/src/components/atoms/admin/bar/layout-section/index.js +5 -5
- package/src/components/atoms/button/operator-cta.js +3 -1
- package/src/components/atoms/notifications/notification-items/cards-v2/index.js +33 -15
- package/src/components/molecules/bonus-box/template-one/index.js +0 -1
- package/src/components/molecules/bonus-box/template-three/index.js +1 -2
- package/src/components/molecules/floating-area/index.js +22 -22
- package/src/components/organisms/cookie-consent/cookie-consent.module.scss +1 -2
- package/src/components/organisms/cookie-consent/index.js +1 -1
- package/src/components/organisms/search/index.js +14 -11
- package/src/components/organisms/search/variable/index.js +1 -1
- package/src/components/organisms/search/variable/searchVariable.test.js +2 -0
- package/src/constants/site-settings/main.mjs +1 -1
- package/src/constants/site-settings/navigation.js +0 -1
- package/src/helpers/date-time.js +0 -22
- package/src/helpers/date-time.test.js +1 -16
- package/src/helpers/getters.mjs +0 -17
- package/src/helpers/getters.test.js +0 -52
- package/src/resolver/archive.mjs +0 -1
- package/src/resolver/common.mjs +1 -1
- package/src/resolver/index.mjs +30 -33
- package/src/resolver/modules.mjs +85 -116
- package/src/resolver/relations.mjs +0 -21
- package/src/resolver/sports-relations.mjs +0 -1
- package/src/services/api.mjs +0 -4
- package/src/services/fetch.mjs +4 -8
- package/src/resolver/build-toplist-filter.mjs +0 -66
- package/src/resolver/build-toplist-filter.test.js +0 -104
package/CHANGELOG.md
CHANGED
|
@@ -1,162 +1,18 @@
|
|
|
1
|
-
# [
|
|
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
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* rm consoel logs ([9d02b9d](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/9d02b9d9808b904d53f4fb63ee72bb7c76bc52d6))
|
|
9
|
-
* rm old tests ([41d19a8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/41d19a859a1d9a76e16aa19c374ab5e27f7f8557))
|
|
10
|
-
* sync with main ([dfcc323](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/dfcc323274e8578b9de12a04345ec77692c6ca6a))
|
|
11
|
-
* use filterOperators in processFilters ([c6745f1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c6745f1c331746565a769bb3a77f77811f4febce))
|
|
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))
|
|
12
8
|
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
* Merge branch 'tm-5536-notifications-time' into 'master' ([48889f9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/48889f94b175238fffac8fa91e88e5bf15f504f2))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Features
|
|
19
|
-
|
|
20
|
-
* build filters for enabled templates ([3d201c2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3d201c20fa5e1794b00a7522953d2ab195168bfb))
|
|
21
|
-
* build filters on top list ([908a65f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/908a65fbb2b6fcf6869fadce2e83d96267e2c29e))
|
|
22
|
-
* slice toplists on filters ([6074186](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/60741862f3bc6f9d30a107921a9c1866f9b1d7ac))
|
|
23
|
-
* split filter operators, remove promises ([55483bb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/55483bbe76ed03673ce6feae7ed62bce6e8dda58))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
### Tests
|
|
27
|
-
|
|
28
|
-
* buildTopListFilter ([ab811e7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ab811e791e631c6fffb1cd76c05cdce36ec07987))
|
|
29
|
-
* process filters ([d396159](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/d396159e6789b86b63d14cd743f7838e9d6dd7e3))
|
|
30
|
-
|
|
31
|
-
## [44.2.20](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.19...v44.2.20) (2025-06-24)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### Bug Fixes
|
|
35
|
-
|
|
36
|
-
* typo ([68823f3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/68823f353806c946ff9602e61f9046c77d6fcd1c))
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
* Merge branch 'fix-typo' into 'master' ([1cbb641](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/1cbb641c00625d0d84668bc74e6c8249cd06d5c3))
|
|
40
|
-
|
|
41
|
-
## [44.2.19](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.18...v44.2.19) (2025-06-24)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
### Bug Fixes
|
|
45
|
-
|
|
46
|
-
* remove unecessary eslint disable ([976eea0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/976eea0ca4c72e1e3b7f60f66a388849889d0ed9))
|
|
47
|
-
* replace coupon code extra field with promo code in sites data ([2c2fbd9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2c2fbd9dd48594c54fce741e28ca54c094276fc0))
|
|
48
|
-
* replace coupon code extra field with promo code in sites data ([96166c2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/96166c2e3acb43f0806fbca588d672570166e5cb))
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* Merge branch 'tm-5539-replace-coupon-code' into 'master' ([ad894e3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ad894e372eea6dab322cf04790cd91c528cef647))
|
|
52
|
-
|
|
53
|
-
## [44.2.18](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.17...v44.2.18) (2025-06-23)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
### Bug Fixes
|
|
57
|
-
|
|
58
|
-
* add time translations for notifications ([8635372](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8635372cb96cd6afb817bd25b1f6d094b16c077f))
|
|
59
|
-
* add translation ([3646134](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/36461348749e99752e08ff4fc16ff8c11b9861bf))
|
|
60
|
-
* conflicts ([b4a714f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b4a714f50b5da363067570f425be34be3b49cbd8))
|
|
61
|
-
* operator cta ([2498397](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/24983978555b5d72b19e4e55e9c981266e4dcd4c))
|
|
62
|
-
* resolve mentioned issues ([efc2af3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/efc2af3c70a2d000246d7b626ff7b681e5dd10b7))
|
|
63
|
-
* test ([4e99e0b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4e99e0ba5fe28f0997d33379fd4b22e62de43334))
|
|
64
|
-
* test ([5b776de](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5b776def206fd0472a53a3e44ded5505ffeda13c))
|
|
65
|
-
* test ([3c20ccb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3c20ccb5e3d6d7a0ca2ed4d227da330de016deb2))
|
|
66
|
-
* validate data ([d76d52b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/d76d52b3b58cb5412b6436fd8845482f61d2960c))
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* Merge branch 'tm-5453-cta-button' into 'master' ([5fd74f4](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5fd74f4a828e8520e516760c0f462292866f7f19))
|
|
70
|
-
* Merge branch 'tm-5536-time-translations' into 'master' ([d7f6855](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/d7f68553a167bddbdf44a4c5e091d491f4d735c4))
|
|
71
|
-
|
|
72
|
-
## [44.2.17](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.16...v44.2.17) (2025-06-20)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
### Bug Fixes
|
|
76
|
-
|
|
77
|
-
* autosuggest logic ([75fb409](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/75fb409a4b6f72d93adbb4b98525ba655599e51b))
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
* Merge branch 'tm-5552-autosuggest-logic' into 'master' ([6520798](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6520798d46a2be6beaf5ff24f8bb37aad90de7dc))
|
|
81
|
-
|
|
82
|
-
## [44.2.16](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.15...v44.2.16) (2025-06-19)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
### Bug Fixes
|
|
86
|
-
|
|
87
|
-
* added var to cookie consets ([e569b0e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e569b0e6af31ade16b8223665cc6fc0f655fee22))
|
|
88
|
-
|
|
89
|
-
## [44.2.15](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.14...v44.2.15) (2025-06-19)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
### Bug Fixes
|
|
93
|
-
|
|
94
|
-
* added no wrap to buttons on cookies ([62e0adc](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/62e0adc846d11ad1e66cf5a2d9b1c4452b2a5e2c))
|
|
95
|
-
* fix the software label name ([65654fb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/65654fb209f5083031d35ab10ae9696bb77dc209))
|
|
96
|
-
|
|
97
|
-
## [44.2.14](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.13...v44.2.14) (2025-06-19)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
### Bug Fixes
|
|
101
|
-
|
|
102
|
-
* added props to floating area ([6868daa](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6868daab638a33bc7b73f0889901286dc20021c9))
|
|
103
|
-
|
|
104
|
-
## [44.2.13](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.12...v44.2.13) (2025-06-18)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
### Bug Fixes
|
|
108
|
-
|
|
109
|
-
* cookie consent not showing ([b081522](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b081522c26040bc00328ac5db67e45f19ccb38f1))
|
|
110
|
-
|
|
111
|
-
## [44.2.12](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.11...v44.2.12) (2025-06-18)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
### Bug Fixes
|
|
115
|
-
|
|
116
|
-
* recommended casino logic ([94eeea1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/94eeea1dee0bf2dd7cb37d26b8ba37613835ef84))
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
* Merge branch 'tm-5521-recommended-casino-logic' into 'master' ([6a9b3e1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6a9b3e1d822f4d481cc4668a9a021e1cf4b8e4f4))
|
|
120
|
-
|
|
121
|
-
## [44.2.11](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.10...v44.2.11) (2025-06-17)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
### Bug Fixes
|
|
125
|
-
|
|
126
|
-
* build issue with review links ([68d07f0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/68d07f0f5c17bb9b6f6070f02931485552a5c372))
|
|
127
|
-
|
|
128
|
-
## [44.2.10](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.9...v44.2.10) (2025-06-17)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
### Bug Fixes
|
|
132
|
-
|
|
133
|
-
* archive pages build fix ([04098d5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/04098d5545696ac5f2371e091f761e46f579cd2d))
|
|
134
|
-
|
|
135
|
-
## [44.2.9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.8...v44.2.9) (2025-06-16)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
### Bug Fixes
|
|
139
|
-
|
|
140
|
-
* sports theme build fail ([c8ec05b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c8ec05ba3b5dd4bafc6e2f198c965aa11fc7c29a))
|
|
141
|
-
|
|
142
|
-
## [44.2.8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.7...v44.2.8) (2025-06-16)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
### Bug Fixes
|
|
146
|
-
|
|
147
|
-
* add validation ([0953152](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/09531524240dcf834cec23fd0d1538fc9a3de4cf))
|
|
148
|
-
* added bonus page type to sports data ([2ec5dac](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2ec5dac1c058d4d98aafa35a2012ff8f84a4910f))
|
|
149
|
-
|
|
150
|
-
## [44.2.7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.6...v44.2.7) (2025-06-16)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
### Bug Fixes
|
|
10
|
+
### chore
|
|
154
11
|
|
|
155
|
-
*
|
|
156
|
-
* 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))
|
|
157
13
|
|
|
158
14
|
|
|
159
|
-
* Merge branch 'tm-
|
|
15
|
+
* Merge branch 'tm-5125-gatsby-node-update' into 'beta' ([b29ef69](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b29ef6979f8e654ddb0e0c15cbd430b96cf10631))
|
|
160
16
|
|
|
161
17
|
## [44.2.6](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.5...v44.2.6) (2025-06-12)
|
|
162
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
|
@@ -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
|
|
15
|
+
return `operators/${id.operator_id}/sites-data/edit/${id.id}`;
|
|
16
16
|
case "game":
|
|
17
|
-
return `games/${id
|
|
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
|
|
44
|
-
linkText={link
|
|
45
|
-
description={link
|
|
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) &&
|
|
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
|
|
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
|
-
{
|
|
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
|
-
|
|
123
|
+
{content(item)}
|
|
106
124
|
</Link>
|
|
107
125
|
</li>
|
|
108
126
|
))}
|
|
@@ -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}
|
|
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
|
-
|
|
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 &&
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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:
|
|
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);
|
|
@@ -81,8 +81,9 @@ const SearchForm = ({
|
|
|
81
81
|
} else {
|
|
82
82
|
const searchUrl =
|
|
83
83
|
marketPrefix !== "/"
|
|
84
|
-
? `/${marketPrefix}/s${process.env.TRAILING_SLASH ? "/" : ""}?s=${
|
|
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 || ""} ${
|
|
151
|
-
|
|
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${
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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) && (
|
|
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>
|
|
31
|
+
<p>Top Searches:</p>
|
|
32
32
|
{topSearches?.map((item) => (
|
|
33
33
|
<Link key={item.id} to={item?.link?.value}>
|
|
34
34
|
{item?.label}
|
package/src/helpers/date-time.js
CHANGED
|
@@ -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
|
|
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
|
});
|
package/src/helpers/getters.mjs
CHANGED
|
@@ -241,23 +241,6 @@ export function getBonus(name, operator) {
|
|
|
241
241
|
return null;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
export function getPromoCode(item, tracker) {
|
|
245
|
-
|
|
246
|
-
if (!item) {
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
if (
|
|
250
|
-
item.bonuses &&
|
|
251
|
-
item.bonuses.hasOwnProperty(tracker) &&
|
|
252
|
-
item.bonuses[tracker].promo_code !== ""
|
|
253
|
-
) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
return item.bonuses[tracker].promo_code;
|
|
257
|
-
}
|
|
258
|
-
return null;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
244
|
export function getGameExtraField(relation, key) {
|
|
262
245
|
if (
|
|
263
246
|
relation &&
|