gatsby-core-theme 30.0.75 → 30.0.77

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,23 @@
1
+ ## [30.0.77](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.76...v30.0.77) (2024-02-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added enable/disable spalshscreen option ([7317313](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/73173137956624b4fb42b6560f754a0b64841a22))
7
+
8
+
9
+ * Merge branch 'tm-4028-enable-disable-splashscreen' into 'master' ([9a1c239](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9a1c2393524abfa352406ca17abd86330cca4bd6))
10
+
11
+ ## [30.0.76](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.75...v30.0.76) (2024-02-09)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * filter cards by status ([bebd9f8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bebd9f8c2deb29e0c13ccfc298806ac1b8faa5b6))
17
+
18
+
19
+ * Merge branch 'cards-filter' into 'master' ([f986f1a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f986f1a34212aa6674b3296edf2e9493f1ae34d0))
20
+
1
21
  ## [30.0.75](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.74...v30.0.75) (2024-02-08)
2
22
 
3
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.75",
3
+ "version": "30.0.77",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -4,7 +4,7 @@ import React, { useEffect } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import Button from '~atoms/button/button';
6
6
  import LazyImage from '~hooks/lazy-image';
7
- import { imagePrettyUrl, getAltText, translate } from '~helpers/getters';
7
+ import { imagePrettyUrl, getAltText, translate, getExtraField } from '~helpers/getters';
8
8
  import styles from './tracker.module.scss';
9
9
  import { getAffiliateLink, getTrackerName } from '~helpers/tracker';
10
10
  import HeadData from '~organisms/head';
@@ -27,11 +27,10 @@ const Tracker = ({
27
27
  serverData,
28
28
  }) => {
29
29
  const { operator, page, translations } = pageContext;
30
-
30
+ const disableSplashScreen =
31
+ Boolean(getExtraField(operator.extra_fields, 'disable_splash_screen')) || false;
31
32
  const tracker = getTrackerName(operator, page, path);
32
33
 
33
- const showSplashScreen = typeof window !== 'undefined';
34
-
35
34
  function redirect() {
36
35
  if (typeof window !== 'undefined' && !isStory) {
37
36
  if (serverData.success && serverData.result.link) {
@@ -54,12 +53,14 @@ const Tracker = ({
54
53
  /* eslint consistent-return: 0 */
55
54
  useEffect(() => {
56
55
  window.loadGTM = false;
57
- if (!isStory) {
56
+ if (!isStory && !disableSplashScreen) {
58
57
  const timer = setTimeout(() => redirect(), redirectTimer);
59
58
 
60
59
  return () => {
61
60
  clearTimeout(timer);
62
61
  };
62
+ } else {
63
+ redirect();
63
64
  }
64
65
  });
65
66
 
@@ -78,7 +79,7 @@ const Tracker = ({
78
79
 
79
80
  return (
80
81
  <>
81
- {showSplashScreen && (
82
+ {!disableSplashScreen && (
82
83
  <>
83
84
  <div className={styles.container || ''}>
84
85
  {background}
@@ -4,7 +4,7 @@ import React, { useEffect } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import Button from '~atoms/button/button';
6
6
  import LazyImage from '~hooks/lazy-image';
7
- import { imagePrettyUrl, getAltText, translate } from '~helpers/getters';
7
+ import { imagePrettyUrl, getAltText, translate, getExtraField } from '~helpers/getters';
8
8
  import styles from './tracker.module.scss';
9
9
  import { getTrackerName } from '~helpers/tracker';
10
10
  import HeadData from '~organisms/head';
@@ -27,10 +27,10 @@ const Tracker = ({
27
27
  }) => {
28
28
  const { operator, page, translations } = pageContext;
29
29
 
30
+ const disableSplashScreen =
31
+ Boolean(getExtraField(operator.extra_fields, 'disable_splash_screen')) || false;
30
32
  const tracker = getTrackerName(operator, page, path);
31
33
 
32
- const showSplashScreen = typeof window !== 'undefined';
33
-
34
34
  function redirect() {
35
35
  if (typeof window !== 'undefined' && !isStory) {
36
36
  window.location.replace(tracker.value);
@@ -47,12 +47,14 @@ const Tracker = ({
47
47
  /* eslint consistent-return: 0 */
48
48
  useEffect(() => {
49
49
  window.loadGTM = false;
50
- if (!isStory) {
50
+ if (!isStory && !disableSplashScreen) {
51
51
  const timer = setTimeout(() => redirect(), redirectTimer);
52
52
 
53
53
  return () => {
54
54
  clearTimeout(timer);
55
55
  };
56
+ } else {
57
+ redirect();
56
58
  }
57
59
  });
58
60
 
@@ -71,7 +73,7 @@ const Tracker = ({
71
73
 
72
74
  return (
73
75
  <>
74
- {showSplashScreen && (
76
+ {!disableSplashScreen && (
75
77
  <>
76
78
  <div className={styles.container || ''}>
77
79
  {background}
@@ -93,15 +93,11 @@ export function filterGames(pages, selectedCategories, selectedProviders) {
93
93
  }
94
94
 
95
95
  export function filterInactiveOperators(items) {
96
- return items.filter((page) => {
97
- if (!settings.filter_cards_modules[process.env.GATSBY_SITE_NAME]) {
98
- return false;
99
- }
100
-
101
- return !settings.filter_cards_modules[process.env.GATSBY_SITE_NAME].includes(
96
+ const specificSite = settings?.filter_cards_modules[process.env.GATSBY_SITE_NAME];
97
+ const filter = specificSite || settings?.filter_cards_modules.default;
98
+ return items.filter((page) => !filter.includes(
102
99
  page.relation && page.relation.status
103
- );
104
- });
100
+ ));
105
101
  }
106
102
 
107
103
  export function filterEvents(pages) {