gatsby-core-theme 42.0.9 → 42.0.10

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,17 @@
1
+ ## [42.0.10](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.9...v42.0.10) (2025-02-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add the trackerlink on operator banner function ([e532ee2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e532ee2f81d21102b4ba63a22ec67ebab37a9392))
7
+ * sports schedule data ([7ac242c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7ac242c7ab46e2ff0b2836a340bf95f7eb540dbd))
8
+ * update floating area to hide sticky cta when no tracker link present ([c6efe93](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c6efe936aa3bb3783cc7275983c036599e7d777e))
9
+ * update tracker link import ([6d89daa](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6d89daa6b787c066e39effd0e6a1bed5f1e5c8c5))
10
+ * update trackerLinkActive path ([e01b5b5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e01b5b5d305024d9f6fa39727f134c1cece54cc5))
11
+
12
+
13
+ * Merge branch 'tm-5218-hide-sticky-cta-conditionally' into 'master' ([5cdb94e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5cdb94e82455e56a49ee46865d5d5a9e25f1fcff))
14
+
1
15
  ## [42.0.9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.8...v42.0.9) (2025-02-13)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "42.0.9",
3
+ "version": "42.0.10",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -7,6 +7,7 @@ import { TrackingKeys } from '~constants/tracking-api'
7
7
  import { getAltText, imagePrettyUrl } from '~helpers/getters'
8
8
 
9
9
  import styles from './header-operator-bannner.module.scss'
10
+ import { trackerLinkActive } from "~helpers/tracker.mjs";
10
11
 
11
12
  const HeaderOperatorBaner = ({
12
13
  operator,
@@ -56,17 +57,9 @@ const HeaderOperatorBaner = ({
56
57
  </>
57
58
  )
58
59
  }
59
-
60
- const trackerLinkActive = () => {
61
- if (!operator || !operator?.links) {
62
- return false
63
- }
64
-
65
- return operator?.links[template] || operator?.links?.main
66
- }
67
-
60
+
68
61
  return (
69
- trackerLinkActive() && (
62
+ trackerLinkActive(operator) && (
70
63
  <div className={`${styles.operatorBanner}`}>
71
64
  {logo?.filename && (
72
65
  <LazyImage
@@ -10,9 +10,11 @@ import { TrackingKeys } from "~constants/tracking-api";
10
10
  import { mainSettings } from "../../../constants/site-settings/main";
11
11
  import styles from "./floating-area.module.scss";
12
12
  import { layout } from "../../../constants/site-settings/navigation";
13
+ import { trackerLinkActive } from "~helpers/tracker.mjs";
13
14
 
14
15
  const showOperatorBanner = (operator, pageTemplate) =>
15
16
  mainSettings[pageTemplate]?.operator_banner &&
17
+ trackerLinkActive(operator) &&
16
18
  !["not_recommended", "inactive", "blacklisted", "coming_soon"].includes(
17
19
  operator.status
18
20
  );
@@ -9,19 +9,24 @@ export function zeroPadding(num, places) {
9
9
  export function filterScheduleByDate(schedule) {
10
10
  const today = new Date().setHours(0, 0, 0, 0);
11
11
  let todayFound = false;
12
- Object.keys(schedule.soccer).forEach((key) => {
12
+ let todayNextIndex = null;
13
+ Object.keys(schedule.soccer).forEach((key, index) => {
13
14
  if (new Date(key).setHours(0, 0, 0, 0) === today) {
14
15
  schedule.soccer[key] = { ...schedule.soccer[key], active: true};
15
16
  todayFound = true;
17
+ todayNextIndex = index;
16
18
  }
17
19
  });
18
20
 
21
+
22
+
19
23
  let nextDay = false;
20
24
  if(!todayFound) {
21
- Object.keys(schedule.soccer).forEach((key) => {
25
+ Object.keys(schedule.soccer).forEach((key, index) => {
22
26
  if (!nextDay && new Date(key).setHours(0, 0, 0, 0) > today) {
23
27
  schedule.soccer[key] = { ...schedule.soccer[key], active: true};
24
28
  nextDay = true;
29
+ todayNextIndex = index;
25
30
  }
26
31
  });
27
32
  }
@@ -34,6 +39,13 @@ export function filterScheduleByDate(schedule) {
34
39
  }
35
40
  }
36
41
 
42
+ if(todayNextIndex !== null && todayNextIndex - 2 > 0) {
43
+ const indexSlice = todayNextIndex - 2;
44
+ const entries = Object.entries(schedule.soccer);
45
+ const remainingEntries = entries.slice(indexSlice);
46
+ schedule.soccer = Object.fromEntries(remainingEntries);
47
+ }
48
+
37
49
  return schedule;
38
50
  }
39
51