gatsby-core-theme 30.0.76 → 30.0.78
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,20 @@
|
|
|
1
|
+
## [30.0.78](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.77...v30.0.78) (2024-02-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* enabled/disable splash screen ([cd41f81](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cd41f8172001be81e8d218925b7039cb9a21f938))
|
|
7
|
+
|
|
8
|
+
## [30.0.77](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.76...v30.0.77) (2024-02-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* added enable/disable spalshscreen option ([7317313](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/73173137956624b4fb42b6560f754a0b64841a22))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
* Merge branch 'tm-4028-enable-disable-splashscreen' into 'master' ([9a1c239](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9a1c2393524abfa352406ca17abd86330cca4bd6))
|
|
17
|
+
|
|
1
18
|
## [30.0.76](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.75...v30.0.76) (2024-02-09)
|
|
2
19
|
|
|
3
20
|
|
package/package.json
CHANGED
|
@@ -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
|
-
{
|
|
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(Number(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
|
-
{
|
|
76
|
+
{!disableSplashScreen && (
|
|
75
77
|
<>
|
|
76
78
|
<div className={styles.container || ''}>
|
|
77
79
|
{background}
|