gatsby-core-theme 42.0.9 → 42.0.11

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,25 @@
1
+ ## [42.0.11](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.10...v42.0.11) (2025-02-18)
2
+
3
+
4
+ ### Code Refactoring
5
+
6
+ * author box translation key ([953f1ba](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/953f1ba7d1ac88e1f2291835b8a9c3c46876a02f))
7
+ * custom class for selling points ([8d21f43](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8d21f435f2ead08b5034ee7e5144ac8358261009))
8
+
9
+ ## [42.0.10](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.9...v42.0.10) (2025-02-14)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * add the trackerlink on operator banner function ([e532ee2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e532ee2f81d21102b4ba63a22ec67ebab37a9392))
15
+ * sports schedule data ([7ac242c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7ac242c7ab46e2ff0b2836a340bf95f7eb540dbd))
16
+ * 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))
17
+ * update tracker link import ([6d89daa](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6d89daa6b787c066e39effd0e6a1bed5f1e5c8c5))
18
+ * update trackerLinkActive path ([e01b5b5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e01b5b5d305024d9f6fa39727f134c1cece54cc5))
19
+
20
+
21
+ * Merge branch 'tm-5218-hide-sticky-cta-conditionally' into 'master' ([5cdb94e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5cdb94e82455e56a49ee46865d5d5a9e25f1fcff))
22
+
1
23
  ## [42.0.9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v42.0.8...v42.0.9) (2025-02-13)
2
24
 
3
25
 
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.11",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -2,14 +2,17 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Check from '~images/icons/check';
4
4
  import keygen from '~helpers/keygen';
5
+ import useTranslate from '~hooks/useTranslate/useTranslate';
5
6
  import styles from './expertion.module.scss';
6
7
 
7
8
  export default function Expertion({ expertise }) {
9
+ const expertOnText = useTranslate('expert_on', 'Expert on:');
10
+
8
11
  return (
9
12
  <>
10
13
  {expertise && (
11
14
  <div className={styles.expertion}>
12
- <p>Expert on:</p>
15
+ <p>{expertOnText}</p>
13
16
  {expertise?.map((res) => (
14
17
  <span key={keygen()}>
15
18
  <Check />
@@ -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
@@ -7,14 +7,14 @@ import { Context } from '~context/MainProvider.js';
7
7
  import keygen from '~helpers/keygen';
8
8
  import styles from './selling-points.module.scss';
9
9
 
10
- const SellingPoints = ({ sellingPoints, icon, limit = 3 }) => {
10
+ const SellingPoints = ({ sellingPoints, icon, limit = 3, customClass }) => {
11
11
  const { admin, showTranslationKeys, language } = useContext(Context) || {};
12
12
  if (!sellingPoints || sellingPoints.length === 0) {
13
13
  return <></>;
14
14
  }
15
15
 
16
16
  return (
17
- <ul className={styles.sellingPoint || ''}>
17
+ <ul className={`${styles.sellingPoint || ''} ${customClass ? customClass || '' : ''}`}>
18
18
  {sellingPoints.slice(0, limit).map((item) => (
19
19
  <li className={`${!icon && (styles.tick || '')}`} key={keygen()}>
20
20
  {icon !== null && icon}
@@ -30,6 +30,7 @@ SellingPoints.propTypes = {
30
30
  sellingPoints: PropTypes.arrayOf(PropTypes.string),
31
31
  icon: PropTypes.element,
32
32
  limit: PropTypes.number,
33
+ customClass: PropTypes.string,
33
34
  };
34
35
 
35
36
  export default SellingPoints;
@@ -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