gatsby-core-theme 36.0.0 → 36.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [36.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v36.0.0...v36.0.1) (2024-08-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * cards v2 ([0632f74](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0632f7482bb4ecb16e9305b4f46921ae2761e015))
7
+
1
8
  # [36.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v35.1.9...v36.0.0) (2024-08-21)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "36.0.0",
3
+ "version": "36.0.1",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -1,38 +1,48 @@
1
1
  /* eslint-disable camelcase */
2
2
  /* eslint-disable no-useless-concat */
3
3
  /* eslint-disable no-restricted-globals */
4
- import React, { useEffect } from 'react';
5
- import PropTypes from 'prop-types';
4
+ import React, { useEffect } from "react";
5
+ import PropTypes from "prop-types";
6
6
  // eslint-disable-next-line import/no-extraneous-dependencies
7
- import { v4 as uuidv4 } from 'uuid';
8
- import { getSection } from '~helpers/getters';
9
- import Header from '~molecules/header';
10
- import Main from '~molecules/main';
11
- import Footer from '~molecules/footer';
12
- import Navigation from '~organisms/navigation';
13
- import FloatingArea from '../../molecules/floating-area';
14
- import styles from './body.module.scss';
15
- import { setCookie, getCookie } from '~helpers/cookies';
16
- import { pageTypes } from '../../../constants/site-settings/navigation';
7
+ import { v4 as uuidv4 } from "uuid";
8
+ import { getSection, getMarketSection } from "~helpers/getters";
9
+ import Header from "~molecules/header";
10
+ import Main from "~molecules/main";
11
+ import Footer from "~molecules/footer";
12
+ import Navigation from "~organisms/navigation";
13
+ import FloatingArea from "../../molecules/floating-area";
14
+ import styles from "./body.module.scss";
15
+ import { setCookie, getCookie } from "~helpers/cookies";
16
+ import { pageTypes } from "../../../constants/site-settings/navigation";
17
17
 
18
18
  function Body({ pageContext, children, serverData }) {
19
19
  const getBodySection = (name) => getSection(name, pageContext);
20
20
  const { template } = pageContext.page;
21
- const is404 = pageContext?.page?.path?.includes('404');
22
- const main = getBodySection('main');
23
- const navigation = getBodySection(pageTypes[template]?.section || pageTypes.default.section);
24
- const footer = getBodySection('footer');
21
+ const is404 = pageContext?.page?.path?.includes("404");
22
+ const main = getBodySection("main");
23
+
24
+ const navigation = getMarketSection(
25
+ pageTypes[template]?.section || pageTypes.default.section,
26
+ pageContext
27
+ );
28
+
29
+ const footer = pageTypes[template]?.disableFooter
30
+ ? null
31
+ : getMarketSection("footer", pageContext);
25
32
 
26
33
  useEffect(() => {
27
- if (!getCookie('affUUID')) {
28
- setCookie('affUUID', uuidv4());
34
+ if (!getCookie("affUUID")) {
35
+ setCookie("affUUID", uuidv4());
29
36
  }
30
37
  }, []);
31
38
 
32
- const customComponent = pageTypes[template]?.customComponent ?? pageTypes.default.customComponent;
33
- const marketDropdown = pageTypes[template]?.marketDropdown ?? pageTypes.default.marketDropdown;
39
+ const customComponent =
40
+ pageTypes[template]?.customComponent ?? pageTypes.default.customComponent;
41
+ const marketDropdown =
42
+ pageTypes[template]?.marketDropdown ?? pageTypes.default.marketDropdown;
34
43
  const menu = pageTypes[template]?.navMenu ?? pageTypes.default.navMenu;
35
- const disableSearch = pageTypes[template]?.disableSearch ?? pageTypes.default.disableSearch;
44
+ const disableSearch =
45
+ pageTypes[template]?.disableSearch ?? pageTypes.default.disableSearch;
36
46
 
37
47
  return (
38
48
  <>
@@ -53,11 +63,19 @@ function Body({ pageContext, children, serverData }) {
53
63
  )}
54
64
  {!is404 && <Header serverData={serverData} section={pageContext} />}
55
65
  {main && !children && (
56
- <Main serverData={serverData} section={main} pageContext={pageContext} />
66
+ <Main
67
+ serverData={serverData}
68
+ section={main}
69
+ pageContext={pageContext}
70
+ />
57
71
  )}
58
72
  {children && <main>{children}</main>}
59
73
  <Footer template={template} section={footer} />
60
- <FloatingArea pageContext={pageContext} template={template} customStyles={styles} />
74
+ <FloatingArea
75
+ pageContext={pageContext}
76
+ template={template}
77
+ customStyles={styles}
78
+ />
61
79
  </>
62
80
  );
63
81
  }
@@ -11,6 +11,7 @@ export const pageTypes = {
11
11
  disablePopup: true,
12
12
  },
13
13
  responsible_gambling_guide: {
14
+ disableFooter: true,
14
15
  section: "rg_navigation",
15
16
  showLogoWithLink: false,
16
17
  disableSearch: false,
@@ -25,8 +25,7 @@ export function getExtraField(extraFields, key, defaultValue) {
25
25
  return null;
26
26
  }
27
27
 
28
- export function getSection(shortCode, pageContext) {
29
- const page = pageContext && pageContext.page;
28
+ export function getMarketSection(shortCode, pageContext) {
30
29
  const marketSections = pageContext && pageContext.marketSections;
31
30
 
32
31
  // market has priority over page
@@ -34,6 +33,13 @@ export function getSection(shortCode, pageContext) {
34
33
  return marketSections[shortCode];
35
34
  }
36
35
 
36
+ return null;
37
+ }
38
+
39
+ export function getSection(shortCode, pageContext) {
40
+ const page = pageContext && pageContext.page;
41
+ const marketSections = pageContext && pageContext.marketSections;
42
+
37
43
  // eslint-disable-next-line
38
44
  if (
39
45
  !page ||
@@ -42,6 +48,11 @@ export function getSection(shortCode, pageContext) {
42
48
  ) {
43
49
  return null;
44
50
  }
51
+
52
+ // market has priority over page
53
+ if (marketSections[shortCode]) {
54
+ return marketSections[shortCode];
55
+ }
45
56
 
46
57
  return page.sections[shortCode] || {};
47
58
  }
@@ -79,11 +79,8 @@ export function clonePageForCards(item, style) {
79
79
  : item.relation;
80
80
 
81
81
  if(object.relation && object.relation.bonus) {
82
- delete object.relation.bonus.withdrawal_methods;
83
- delete object.relation.bonus.currencies;
84
- delete object.relation.bonus.license_objects;
85
-
86
- object.relation.bonus.deposit_methods = (object.relation.bonus.deposit_methods && object.relation.bonus.deposit_methods.length > 0) ? object.relation.bonus.deposit_methods.slice(0, 3) : [];
82
+ object.relation.bonus.withdrawal_methods = (object.relation.bonus.withdrawal_methods && object.relation.bonus.withdrawal_methods.length > 0) ? object.relation.bonus.withdrawal_methods.slice(0, 5) : [];
83
+ object.relation.bonus.deposit_methods = (object.relation.bonus.deposit_methods && object.relation.bonus.deposit_methods.length > 0) ? object.relation.bonus.deposit_methods.slice(0, 5) : [];
87
84
  }
88
85
 
89
86
  if (
@@ -134,12 +134,12 @@ export function processCardsV2(module, pagesCloned, pagesMappedById, pageId) {
134
134
  const selectedReviewer = module.cards_selector_filters.page_reviewer;
135
135
  const selectedCategories = module.cards_selector_filters.page_categories;
136
136
 
137
- const allFilters = [selectedAuthors, selectedReviewer, selectedCategories, moduleSelectedProviders, moduleSelectedCategories, moduleSelectedTypes];
137
+ const allFilters = [cardType, pageTemplateId, selectedAuthors, selectedReviewer, selectedCategories, moduleSelectedProviders, moduleSelectedCategories, moduleSelectedTypes];
138
138
  const u8 = new Uint8Array(allFilters);
139
139
  const b64 = Buffer.from(u8).toString('base64');
140
140
 
141
-
142
141
 
142
+
143
143
  if (cardType) {
144
144
  // Get all pages by the selected page type
145
145
  const pagesGroupedByType = pagesCloned[cardType];
@@ -51,7 +51,7 @@ function deparam(paramStr) {
51
51
  }
52
52
 
53
53
  function clean(obj) {
54
- for (var propName in obj) {
54
+ for (const propName in obj) {
55
55
  if (obj[propName] === null || obj[propName] === undefined) {
56
56
  delete obj[propName];
57
57
  }