gatsby-core-theme 42.0.8 → 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,24 @@
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
+
15
+ ## [42.0.9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.8...v42.0.9) (2025-02-13)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add button key as props ([68fdc3b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/68fdc3b483b5a07f95200fa71828393d74077a4c))
21
+
1
22
  ## [42.0.8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.7...v42.0.8) (2025-02-13)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "42.0.8",
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
  );
@@ -13,6 +13,7 @@ const NewsletterForm = ({
13
13
  handleApi,
14
14
  redirectUrl,
15
15
  submitText = "Submit",
16
+ buttonKey = "send_button",
16
17
  market,
17
18
  setErr,
18
19
  path,
@@ -33,6 +34,7 @@ const NewsletterForm = ({
33
34
  setIP(data.ip)
34
35
  })
35
36
  .catch((err) => {
37
+ // eslint-disable-next-line no-console
36
38
  console.log(`Error ${err}`);
37
39
  });
38
40
  };
@@ -95,6 +97,7 @@ const NewsletterForm = ({
95
97
  customeSubmit={handelSubmit}
96
98
  customError
97
99
  buttonLabel={submitText}
100
+ buttonKey={buttonKey}
98
101
  path={path}
99
102
  showLabels={showLabels}
100
103
  titleType={titleType}
@@ -113,6 +116,7 @@ NewsletterForm.propTypes = {
113
116
  showLabels: PropTypes.bool,
114
117
  titleType: PropTypes.string,
115
118
  buttonIcon: PropTypes.element,
119
+ buttonKey: PropTypes.string
116
120
  };
117
121
 
118
122
  export default NewsletterForm;
@@ -18,6 +18,7 @@ const FormComponent = ({
18
18
  hasButton = true,
19
19
  showButtonIcon = true,
20
20
  buttonLabel = 'Submit',
21
+ buttonKey = 'send_button',
21
22
  disabled = true,
22
23
  showLabels = true,
23
24
  customeSubmit = null,
@@ -193,7 +194,7 @@ const FormComponent = ({
193
194
  <button disabled={state.loading} className={styles.formButton || ''} type="submit">
194
195
  {state.loading
195
196
  ? useTranslate('loading_btn', 'sending...')
196
- : useTranslate('send_button', buttonLabel)}
197
+ : useTranslate(buttonKey, buttonLabel)}
197
198
  {showButtonIcon ? (
198
199
  buttonIcon
199
200
  ) : null}
@@ -230,5 +231,6 @@ FormComponent.propTypes = {
230
231
  path: PropTypes.string,
231
232
  titleType: PropTypes.string,
232
233
  buttonIcon: PropTypes.element,
234
+ buttonKey: PropTypes.string
233
235
  };
234
236
  export default FormComponent;
@@ -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