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
@@ -19,7 +19,6 @@ import {
19
19
  getCryptoBrokers,
20
20
  getCryptoExchanges,
21
21
  getCryptoWallets,
22
- getLicenses,
23
22
  } from "./api.mjs";
24
23
  import { groupBy } from "../helpers/getters.mjs";
25
24
  import { transformOperators } from "../resolver/operators.mjs";
@@ -36,7 +35,7 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
36
35
  const countriesPromise = getCountries();
37
36
  const providersPromise = getProviders();
38
37
  const gamblingCompaniesPromise = getGamblingCompanies();
39
- const licensesPromise = getLicenses();
38
+
40
39
  // NOTE Crypto data
41
40
  const cryptoBrokersPromise = getCryptoBrokers();
42
41
  const cryptoExchangesPromise = getCryptoExchanges();
@@ -86,8 +85,7 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
86
85
  sportsData,
87
86
  cryptoBrokers,
88
87
  cryptoExchanges,
89
- cryptoWallets,
90
- licensesData
88
+ cryptoWallets
91
89
  ] = await Promise.all([
92
90
  ribbonsPromise,
93
91
  responsableGamingPromise,
@@ -105,8 +103,7 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
105
103
  sportsPromise,
106
104
  cryptoBrokersPromise,
107
105
  cryptoExchangesPromise,
108
- cryptoWalletsPromise,
109
- licensesPromise
106
+ cryptoWalletsPromise
110
107
  ]);
111
108
 
112
109
  const allMarketPrefixes = Object.keys(allMarketsData)
@@ -182,7 +179,6 @@ export const fetchSiteSettings = async (siteName, previewPath = null) => {
182
179
  gamesData,
183
180
  sportsData,
184
181
  cryptoExchangesData,
185
- cryptoBrokersData,
186
- licensesData
182
+ cryptoBrokersData
187
183
  };
188
184
  };
@@ -1,66 +0,0 @@
1
- function buildToplistFilter(pageFilters, operator) {
2
- const addToFilter = (category, key, operatorId) => {
3
- if (!category[key]) category[key] = { items: [] };
4
- category[key].items.push(operatorId);
5
- };
6
- const operatorId = operator.id;
7
- const rating = Math.floor(operator.rating);
8
-
9
- // Rating filters
10
- if (rating >= 1 && rating <= 5) {
11
- pageFilters.rating[rating].items.push(operatorId);
12
-
13
- // Best online casinos (5-star ratings)
14
- if (rating === 5) {
15
- pageFilters.popular_filters.best_online.items.push(operatorId);
16
- }
17
- }
18
-
19
- // Deposit methods
20
- operator.deposit_methods?.forEach((method) => {
21
- addToFilter(pageFilters.deposit_methods, method.name, operatorId);
22
-
23
- // Crypto filter
24
- if (method.name.toLowerCase() === "cryptocurrency") {
25
- pageFilters.popular_filters.crypto.items.push(operatorId);
26
- }
27
- });
28
-
29
- // Withdrawal methods
30
- operator.withdrawal_method?.forEach((method) => {
31
- addToFilter(pageFilters.withdrawal_method, method.name, operatorId);
32
- });
33
-
34
- // Game categories
35
- operator.game_categories?.forEach((category) => {
36
- addToFilter(pageFilters.game_categories, category, operatorId);
37
- });
38
-
39
- // Licenses
40
- operator.license_objects?.forEach((license) => {
41
- addToFilter(pageFilters.licenses, license.name, operatorId);
42
- });
43
-
44
- // Payout time
45
- if (operator.payout_time) {
46
- addToFilter(pageFilters.payout_time, operator.payout_time, operatorId);
47
- }
48
-
49
- // Payout rate
50
- const payoutRatio = operator.extra_fields?.payoutRatio;
51
- if (payoutRatio) {
52
- addToFilter(pageFilters.payout_rate, payoutRatio, operatorId);
53
- }
54
-
55
- // Mobile optimized
56
- if (operator.extra_fields?.mobile_optimized) {
57
- pageFilters.popular_filters.mobile_optimized.items.push(operatorId);
58
- }
59
-
60
- // Best live casino
61
- if (operator.extra_fields?.best_live_casino) {
62
- pageFilters.popular_filters.best_live.items.push(operatorId);
63
- }
64
- }
65
-
66
- export default buildToplistFilter;
@@ -1,104 +0,0 @@
1
- import buildToplistFilter from "./build-toplist-filter.mjs";
2
-
3
- describe("buildToplistFilter", () => {
4
- let pageFilters;
5
- let operator;
6
-
7
- beforeEach(() => {
8
- pageFilters = {
9
- rating: {
10
- 1: { items: [] },
11
- 2: { items: [] },
12
- 3: { items: [] },
13
- 4: { items: [] },
14
- 5: { items: [] },
15
- },
16
- popular_filters: {
17
- best_online: { items: [] },
18
- crypto: { items: [] },
19
- mobile_optimized: { items: [] },
20
- best_live: { items: [] },
21
- },
22
- deposit_methods: {},
23
- withdrawal_method: {},
24
- game_categories: {},
25
- licenses: {},
26
- payout_time: {},
27
- payout_rate: {},
28
- };
29
-
30
- operator = {
31
- id: "operator1",
32
- rating: 5,
33
- deposit_methods: [{ name: "Cryptocurrency" }, { name: "Credit Card" }],
34
- withdrawal_method: [{ name: "Bank Transfer" }],
35
- game_categories: ["Slots", "Poker"],
36
- license_objects: [{ name: "License A" }],
37
- payout_time: "24 hours",
38
- extra_fields: {
39
- payoutRatio: "95%",
40
- mobile_optimized: true,
41
- best_live_casino: true,
42
- },
43
- };
44
- });
45
-
46
- it("should add operator to the correct rating filter", () => {
47
- buildToplistFilter(pageFilters, operator);
48
- expect(pageFilters.rating[5].items).toContain("operator1");
49
- expect(pageFilters.popular_filters.best_online.items).toContain(
50
- "operator1"
51
- );
52
- });
53
-
54
- it("should add operator to the deposit methods and crypto filter", () => {
55
- buildToplistFilter(pageFilters, operator);
56
- expect(pageFilters.deposit_methods.Cryptocurrency.items).toContain(
57
- "operator1"
58
- );
59
- expect(pageFilters.deposit_methods["Credit Card"].items).toContain(
60
- "operator1"
61
- );
62
- expect(pageFilters.popular_filters.crypto.items).toContain("operator1");
63
- });
64
-
65
- it("should add operator to the withdrawal methods", () => {
66
- buildToplistFilter(pageFilters, operator);
67
- expect(pageFilters.withdrawal_method["Bank Transfer"].items).toContain(
68
- "operator1"
69
- );
70
- });
71
-
72
- it("should add operator to the game categories", () => {
73
- buildToplistFilter(pageFilters, operator);
74
- expect(pageFilters.game_categories.Slots.items).toContain("operator1");
75
- expect(pageFilters.game_categories.Poker.items).toContain("operator1");
76
- });
77
-
78
- it("should add operator to the licenses", () => {
79
- buildToplistFilter(pageFilters, operator);
80
- expect(pageFilters.licenses["License A"].items).toContain("operator1");
81
- });
82
-
83
- it("should add operator to the payout time filter", () => {
84
- buildToplistFilter(pageFilters, operator);
85
- expect(pageFilters.payout_time["24 hours"].items).toContain("operator1");
86
- });
87
-
88
- it("should add operator to the payout rate filter", () => {
89
- buildToplistFilter(pageFilters, operator);
90
- expect(pageFilters.payout_rate["95%"].items).toContain("operator1");
91
- });
92
-
93
- it("should add operator to the mobile optimized filter", () => {
94
- buildToplistFilter(pageFilters, operator);
95
- expect(pageFilters.popular_filters.mobile_optimized.items).toContain(
96
- "operator1"
97
- );
98
- });
99
-
100
- it("should add operator to the best live casino filter", () => {
101
- buildToplistFilter(pageFilters, operator);
102
- expect(pageFilters.popular_filters.best_live.items).toContain("operator1");
103
- });
104
- });