gatsby-core-theme 44.3.1 → 45.0.0-beta.2

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 (43) hide show
  1. package/CHANGELOG.md +15 -154
  2. package/gatsby-node.mjs +4 -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/contact-form/contact-form.test.js +3 -3
  7. package/src/components/atoms/notifications/notification-items/cards-v2/index.js +33 -15
  8. package/src/components/molecules/bonus-box/template-one/index.js +0 -1
  9. package/src/components/molecules/bonus-box/template-three/index.js +1 -2
  10. package/src/components/molecules/comment/comment.module.scss +100 -0
  11. package/src/components/molecules/comment/index.js +65 -0
  12. package/src/components/molecules/floating-area/index.js +22 -22
  13. package/src/components/molecules/leave-comment-form/index.js +81 -0
  14. package/src/components/molecules/leave-comment-form/leave-comment-form.module.scss +23 -0
  15. package/src/components/molecules/module/index.js +2 -0
  16. package/src/components/organisms/comments/comment-tree/index.js +29 -0
  17. package/src/components/organisms/comments/index.js +26 -0
  18. package/src/components/organisms/cookie-consent/cookie-consent.module.scss +1 -2
  19. package/src/components/organisms/cookie-consent/index.js +1 -1
  20. package/src/components/organisms/search/index.js +14 -11
  21. package/src/components/organisms/search/variable/index.js +1 -1
  22. package/src/components/organisms/search/variable/searchVariable.test.js +2 -0
  23. package/src/constants/forms.js +52 -0
  24. package/src/constants/site-settings/main.mjs +1 -1
  25. package/src/constants/site-settings/navigation.js +0 -1
  26. package/src/context/MainProvider.js +4 -12
  27. package/src/helpers/date-time.js +0 -22
  28. package/src/helpers/date-time.test.js +1 -16
  29. package/src/helpers/getters.mjs +0 -17
  30. package/src/helpers/getters.test.js +0 -52
  31. package/src/resolver/archive.mjs +0 -1
  32. package/src/resolver/comments.mjs +27 -0
  33. package/src/resolver/common.mjs +1 -1
  34. package/src/resolver/index.mjs +33 -40
  35. package/src/resolver/modules.mjs +85 -116
  36. package/src/resolver/page.mjs +71 -71
  37. package/src/resolver/relations.mjs +0 -21
  38. package/src/resolver/sports-relations.mjs +0 -1
  39. package/src/services/api.mjs +5 -5
  40. package/src/services/fetch.mjs +11 -5
  41. package/static/images/anon-user.svg +15 -0
  42. package/src/resolver/build-toplist-filter.mjs +0 -66
  43. package/src/resolver/build-toplist-filter.test.js +0 -104
package/CHANGELOG.md CHANGED
@@ -1,173 +1,34 @@
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.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v45.0.0-beta.1...v45.0.0-beta.2) (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 conflict bug ([2f72a23](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2f72a2341858cd254daccb61d79b33c5beadeafd))
7
+ * merge conflicts ([6467656](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6467656ec248e670f59b346fe9eb66f49025a609))
8
+ * phase one ([59040df](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/59040df4a9acabb7ab079123421eddddadb08e62))
9
+ * phase three - testing ([7f320d1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7f320d181c6b4f903d7867c62bf21662ac91c7ac))
10
+ * phase two ([b4562f3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b4562f36fc376a5bb6a1446a868e2de265a6b244))
8
11
 
9
12
 
10
- * Merge branch 'tm-5525-toplist-filters' into 'master' ([30427fb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/30427fbdaa89b0abf48243ad80ed81e1af23047f))
13
+ * Merge branch 'tm-5493-user-comments' into 'beta' ([bd6381e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/bd6381e86bba4ea84439e01a01e702ba8bfdee7e))
14
+ * Merge branch 'master' into tm-5493-user-comments ([88c32c5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/88c32c57c503e4bb8dd1fb155b8a572e5a89fc2e))
15
+ * Merge branch 'master' into tm-5493-user-comments ([a4fb3af](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/a4fb3af3e7e1ba0b9bda2764b024bc4d1ca72565))
11
16
 
12
- # [44.3.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.20...v44.3.0) (2025-06-25)
17
+ # [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)
13
18
 
14
19
 
15
20
  ### Bug Fixes
16
21
 
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))
22
+ * merge conflicts + alignments to master ([c6815ca](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c6815cad23928ec02d7b8db27d7ee34ba467b3e6))
23
+ * reset version ([b07bcd3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b07bcd34878e57aec199c7df1614b9ffeadece02))
23
24
 
24
25
 
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
26
+ ### chore
165
27
 
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))
28
+ * **release:** 44.0.37-beta.1 [skip ci] ([69335e5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/69335e500807bedebfe021b5fa0164c508e6a5ff))
168
29
 
169
30
 
170
- * Merge branch 'tm-5535-mapp-providers-license' into 'master' ([8ea899b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8ea899b2773c3a69c9f5d39cdec8acae1a6324ce))
31
+ * Merge branch 'tm-5125-gatsby-node-update' into 'beta' ([b29ef69](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/b29ef6979f8e654ddb0e0c15cbd430b96cf10631))
171
32
 
172
33
  ## [44.2.6](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.2.5...v44.2.6) (2025-06-12)
173
34
 
package/gatsby-node.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-nested-ternary */
1
2
  /* eslint-disable no-underscore-dangle */
2
3
  /* eslint-disable import/no-extraneous-dependencies */
3
4
  /* eslint-disable prefer-destructuring */
@@ -49,7 +50,6 @@ let siteSettingsData = null;
49
50
  let siteGeneralData = null;
50
51
  let allMarketsData = null;
51
52
  let providersData = null;
52
- let licensesData = null;
53
53
  let gamesData = null;
54
54
  let sportsData = null;
55
55
  let ribbonsData = null;
@@ -64,6 +64,7 @@ let schemaData = null;
64
64
  let templatesData = null;
65
65
  let defaultLanguage = null;
66
66
  const pagesToCreate = [];
67
+ let commentsData = null;
67
68
  const relations = {};
68
69
 
69
70
  // eslint-disable-next-line import/prefer-default-export
@@ -97,7 +98,6 @@ export const createPages = async (
97
98
  crypto_exchanges: cryptoExchangesData,
98
99
  crypto_brokers: cryptoBrokersData,
99
100
  countries: countriesData,
100
- operators_license: licensesData,
101
101
  },
102
102
  },
103
103
  themeOptions,
@@ -176,6 +176,7 @@ export const createPages = async (
176
176
  autogenerated,
177
177
  siteSchema,
178
178
  authors,
179
+ comments: commentsData?.[page?.id],
179
180
  lang: page.language,
180
181
  ...themeOptions,
181
182
  });
@@ -376,7 +377,7 @@ export const onPreBootstrap = async () => {
376
377
  cryptoExchangesData,
377
378
  cryptoBrokersData,
378
379
  countriesData,
379
- licensesData,
380
+ commentsData
380
381
  } = await fetchSiteSettings(process.env.GATSBY_SITE_NAME));
381
382
  };
382
383
 
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.2",
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 = {
@@ -29,7 +29,7 @@ describe('Contact Us form Component', () => {
29
29
  );
30
30
 
31
31
  await waitFor(() => {
32
- expect(container).toBeTruthy();
32
+ expect(container).toBeInTheDocument();
33
33
  expect(container.querySelector('H1').innerHTML).toBe('Contact Us');
34
34
  });
35
35
  });
@@ -51,7 +51,7 @@ describe('Contact Us form Component', () => {
51
51
  );
52
52
 
53
53
  await waitFor(() => {
54
- expect(container.querySelector('.contactForm')).toBeTruthy();
54
+ expect(container.querySelector('.contactForm')).toBeInTheDocument();
55
55
  expect(container.querySelector('.contactForm').querySelectorAll('input')).toHaveLength(4);
56
56
  expect(
57
57
  container.querySelector('.contactForm').querySelectorAll('input[type="text"]')
@@ -72,7 +72,7 @@ describe('Contact Us form Component', () => {
72
72
  );
73
73
 
74
74
  expect(container.querySelectorAll('input[type="text"]').length).toEqual(2);
75
- expect(container.querySelector('textarea')).toBeTruthy();
75
+ expect(container.querySelector('textarea')).toBeInTheDocument();
76
76
  expect(container.querySelector('.formGroup').querySelector('label')).toBeFalsy();
77
77
  expect(container.querySelectorAll('label').length).toEqual(1);
78
78
  });
@@ -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>
@@ -0,0 +1,100 @@
1
+ .commentContainer{
2
+ @include flex-direction(column);
3
+
4
+ gap: 1.6rem;
5
+ }
6
+
7
+ .commentTopArea{
8
+ @include flex-align(center, start);
9
+
10
+ gap: .8rem;
11
+ }
12
+
13
+ .commentName{
14
+ font-size: 18px;
15
+ font-weight: 600;
16
+ line-height: 28px;
17
+ }
18
+
19
+ .commentJobTitle{
20
+ height: 24px;
21
+ padding: .8rem;
22
+ font-size: 1.2rem;
23
+ font-weight: 400;
24
+ line-height: 1.8rem;
25
+
26
+ @include flex-align(center, center);
27
+
28
+ border-radius: 5rem;
29
+ background: #CFC7C0;
30
+ }
31
+
32
+ .commentDate{
33
+ color: #64748B;
34
+ font-size: 1.6rem;
35
+ font-weight: 400;
36
+ line-height: 2.6rem;
37
+ }
38
+
39
+ .commentContent{
40
+ border-radius: .8rem;
41
+ border: .1rem solid #F4F4F4;
42
+ background: #FFF;
43
+ position: relative;
44
+ padding: 2.4rem;
45
+ }
46
+
47
+ .isReplyThread::before{
48
+ content: "";
49
+ position: absolute;
50
+ right: 100%;
51
+ border-left: .1rem solid #CFC7C0;
52
+ border-bottom: .1rem solid #CFC7C0;
53
+ border-bottom-left-radius: 2rem;
54
+ height: 30rem;
55
+ width: 3rem;
56
+ bottom: 50%;
57
+ z-index: -1;
58
+ }
59
+
60
+ .commentActions{
61
+ margin-left: auto;
62
+
63
+ @include flex-direction(row);
64
+ }
65
+
66
+ .buttonGroup{
67
+ background: #CFC7C0;
68
+ font-size: 1.2rem;
69
+ padding: .8rem;
70
+ gap: .4rem;
71
+
72
+ @include flex-align(center, center);
73
+
74
+ &.left{
75
+ border-bottom-left-radius: 5rem;
76
+ border-top-left-radius: 5rem;
77
+ padding-right: 0;
78
+ }
79
+
80
+ &.right{
81
+ border-bottom-right-radius: 5rem;
82
+ border-top-right-radius: 5rem;
83
+ }
84
+ }
85
+
86
+ .buttonGroupIcon{
87
+ width: 1.6rem;
88
+ height: 1.6rem;
89
+ }
90
+
91
+ .replyButton{
92
+ border-radius: 10rem;
93
+ border: 1.5px solid #161128;
94
+ font-size: 1.2rem;
95
+ font-weight: 700;
96
+ line-height: 1.8rem;
97
+ text-transform: capitalize;
98
+ margin-left: .8rem;
99
+ padding: 0 1.6rem;
100
+ }
@@ -0,0 +1,65 @@
1
+ /* eslint-disable react-hooks/exhaustive-deps */
2
+ /* eslint-disable jsx-a11y/click-events-have-key-events */
3
+ /* eslint-disable import/no-extraneous-dependencies */
4
+ import React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import LazyImage from '~hooks/lazy-image';
7
+
8
+ import useTranslate from '~hooks/useTranslate/useTranslate';
9
+ import styles from './comment.module.scss';
10
+
11
+ const Comment = ({ comment, authors, isReply }) => {
12
+ const commentName = comment?.author_id ? authors?.[comment?.author_id]?.name : comment.name;
13
+ const commentJobTitle = comment?.author_id ? authors?.[comment?.author_id]?.author_title : undefined;
14
+
15
+ const date = new Date(comment.updated_at);
16
+ const day = String(date.getUTCDate()).padStart(2, '0');
17
+ const month = String(date.getUTCMonth() + 1).padStart(2, '0');
18
+ const year = date.getUTCFullYear();
19
+
20
+ const hours = String(date.getUTCHours()).padStart(2, '0');
21
+ const minutes = String(date.getUTCMinutes()).padStart(2, '0');
22
+ const commentDate = `${day}/${month}/${year} | ${hours}:${minutes}`;
23
+
24
+
25
+ return <div className={`${styles.commentContainer} ${isReply ? styles.isReply : ''}`}>
26
+ <div className={styles.commentTopArea}>
27
+ <LazyImage src='/images/anon-user.svg' alt={`${commentName} user image`} />
28
+ <span className={styles.commentName}>{commentName}</span>
29
+ {comment?.author_id && <span className={styles.commentJobTitle}>{commentJobTitle}</span>}
30
+ <span className={styles.commentDate}>{commentDate}</span>
31
+ </div>
32
+ <div className={`${styles.commentContent} ${isReply ? styles.isReplyThread : ''}`}>
33
+ <p>{comment.comment}</p>
34
+ </div>
35
+ <div className={styles.commentActions}>
36
+ <button aria-label='Like Button' type='button' className={`${styles.buttonGroup} ${styles.left}`}>
37
+ <LazyImage className={styles.buttonGroupIcon} src='/images/like.svg' />
38
+ {comment.votes_up}
39
+ </button>
40
+ <button aria-label='Dislike Button' type='button' className={`${styles.buttonGroup} ${styles.right}`}>
41
+ <LazyImage className={styles.buttonGroupIcon} src='/images/dislike.svg' />
42
+ {comment.votes_down}
43
+ </button>
44
+ <button aria-label='Reply Button' type='button' className={styles.replyButton}>
45
+ {useTranslate('reply_button', 'Reply')}
46
+ </button>
47
+ </div>
48
+ </div>
49
+ };
50
+
51
+ Comment.propTypes = {
52
+ comment: PropTypes.shape({
53
+ author_id: PropTypes.number,
54
+ name: PropTypes.string,
55
+ email: PropTypes.string,
56
+ comment: PropTypes.string,
57
+ updated_at: PropTypes.string,
58
+ votes_up: PropTypes.number,
59
+ votes_down: PropTypes.number,
60
+ }),
61
+ authors: PropTypes.shape({}),
62
+ isReply: PropTypes.bool
63
+ };
64
+
65
+ export default Comment;
@@ -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} />