gatsby-core-theme 43.0.2 → 44.0.0
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 +36 -0
- package/package.json +1 -1
- package/src/components/atoms/admin/bar/layout-section/index.js +5 -4
- package/src/components/atoms/admin/bar/layout-section/link/index.js +1 -1
- package/src/components/atoms/button/button.js +1 -1
- package/src/components/atoms/ratings/index.js +5 -5
- package/src/components/molecules/bonus/template-one/index.js +2 -2
- package/src/components/molecules/bonus/template-two/index.js +2 -2
- package/src/components/molecules/footer/index.js +1 -1
- package/src/components/molecules/header/variants/operator/template-one-two/index.js +1 -1
- package/src/components/molecules/header/variants/slot/template-one/index.js +2 -2
- package/src/components/molecules/spotlights_v2/icon/template-one/index.js +2 -1
- package/src/components/molecules/spotlights_v2/image/template-one/index.js +3 -2
- package/src/components/molecules/spotlights_v2/image/template-two/index.js +3 -2
- package/src/components/molecules/spotlights_v2/image-text/template-one/index.js +3 -2
- package/src/components/molecules/spotlights_v2/image-text/template-three/index.js +4 -2
- package/src/components/molecules/spotlights_v2/image-text/template-two/index.js +3 -2
- package/src/components/molecules/toplist/default-row/index.js +1 -1
- package/src/components/organisms/carousel/template-one/index.js +0 -1
- package/src/components/organisms/toplist/list/index.js +2 -2
- package/src/constants/pick-keys.mjs +1 -0
- package/src/helpers/processor/sports-relations.mjs +4 -3
- package/src/helpers/schedule.mjs +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
# [44.0.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v43.0.3...v44.0.0) (2025-03-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* initial commit ([3f9b2ca](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3f9b2ca86f7defabdffaa8849ccfd6d8d51da6e8))
|
|
7
|
+
* key ([e1f416e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e1f416edd430f9d01f351c0b63b21d0a3e828e7d))
|
|
8
|
+
* replace ul to ol ([018cfaa](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/018cfaa80f6ae65009a46356b9d7b0efa003571f))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Code Refactoring
|
|
12
|
+
|
|
13
|
+
* more prop tyes fixes ([7d295aa](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7d295aa99ee72947fa345b1ad87d832d9bce395d))
|
|
14
|
+
* more proptype changes ([4558b10](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4558b101b04e9dc674bc99153a2c978ec8e4a749))
|
|
15
|
+
* prop type fixes ([ddf0f00](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ddf0f00513f3e064e6170eaacc8e81f0f02ef500))
|
|
16
|
+
* remove temp ([8fc0258](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8fc0258a323ce5e51a80880d7f40a7f2e60688c0))
|
|
17
|
+
* temp ([3793e8c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3793e8c3e9b5855c2b1b3a89dd78f1c71b0b3f69))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
* Merge branch 'tm-5274-update-toplist' into 'master' ([6603e74](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6603e742c754803384ecf05df29c563203188737))
|
|
21
|
+
* Merge branch 'proptype-fixes' into 'master' ([1246b93](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/1246b93b09b6e6b705f7343bbc319c709ca80503))
|
|
22
|
+
* Merge branch 'tm-5310-sorting-schedule' into 'master' ([7b9ae5e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7b9ae5e95b534cba63f6cd13e4b4daea06b6d42e))
|
|
23
|
+
* Merge branch 'master' into proptype-fixes ([277dccb](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/277dccbfc8e74ee1b1b7ce1e47cc669ed1bb6a4e))
|
|
24
|
+
* Merge branch 'master' into proptype-fixes ([bc9779c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/bc9779cf8e193b58172976f6554c4d73c78475f3))
|
|
25
|
+
* Merge branch 'master' into proptype-fixes ([054e596](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/054e596465677ef81a84ce68c6011177eea5e0a1))
|
|
26
|
+
|
|
27
|
+
## [43.0.3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v43.0.2...v43.0.3) (2025-03-11)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* add languages at pick keys ([fa57da7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/fa57da79256c24903ac4394808de60ff3579b85e))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
* Merge branch 'tm-5103-info-grid-add-more-data' into 'master' ([0001a0a](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/0001a0aaf7a3e5f2a46f560d6cbbb5299917fcc4))
|
|
36
|
+
|
|
1
37
|
## [43.0.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v43.0.1...v43.0.2) (2025-03-10)
|
|
2
38
|
|
|
3
39
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
+
import keygen from '~helpers/keygen';
|
|
3
4
|
import styles from "./layout-section.module.scss";
|
|
4
5
|
import Redirect from "./link";
|
|
5
6
|
|
|
@@ -24,19 +25,19 @@ const LayoutSection = ({ menus }) => {
|
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
return menus?.map((res) => (
|
|
27
|
-
<li>
|
|
28
|
+
<li key={keygen()}>
|
|
28
29
|
<span className={`${styles.menuItem} ${styles.link}`}>{res.label}</span>
|
|
29
30
|
<div className={styles.subMenuList}>
|
|
30
31
|
<div className={styles.subMenuContianer}>
|
|
31
32
|
{res?.sections?.map((section) => (
|
|
32
|
-
<ul className={styles.lists}>
|
|
33
|
+
<ul key={keygen()} className={styles.lists}>
|
|
33
34
|
{section.label && (
|
|
34
|
-
<li>
|
|
35
|
+
<li key={keygen()}>
|
|
35
36
|
<span className={styles.label}>{section.label}</span>
|
|
36
37
|
</li>
|
|
37
38
|
)}
|
|
38
39
|
{section?.links?.map((link) => (
|
|
39
|
-
<li>
|
|
40
|
+
<li key={keygen()}>
|
|
40
41
|
<Redirect
|
|
41
42
|
icon={link?.icon}
|
|
42
43
|
path={paths(link?.type, link.data)}
|
|
@@ -92,17 +92,17 @@ Ratings.propTypes = {
|
|
|
92
92
|
item: PropTypes.shape({
|
|
93
93
|
name: PropTypes.string,
|
|
94
94
|
bonus: PropTypes.shape({}),
|
|
95
|
-
rating: PropTypes.string,
|
|
95
|
+
rating: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
96
96
|
status: PropTypes.string,
|
|
97
97
|
rating_bonuses: PropTypes.string,
|
|
98
98
|
rating_casino: PropTypes.string,
|
|
99
99
|
rating_customer: PropTypes.string,
|
|
100
100
|
rating_games: PropTypes.string,
|
|
101
101
|
rating_payout: PropTypes.string,
|
|
102
|
-
first_rating: PropTypes.
|
|
103
|
-
second_rating: PropTypes.
|
|
104
|
-
third_rating: PropTypes.
|
|
105
|
-
fourth_rating: PropTypes.
|
|
102
|
+
first_rating: PropTypes.number,
|
|
103
|
+
second_rating: PropTypes.number,
|
|
104
|
+
third_rating: PropTypes.number,
|
|
105
|
+
fourth_rating: PropTypes.number,
|
|
106
106
|
type: PropTypes.string,
|
|
107
107
|
}),
|
|
108
108
|
type: PropTypes.string,
|
|
@@ -89,10 +89,10 @@ Bonus.propTypes = {
|
|
|
89
89
|
operator: PropTypes.shape({
|
|
90
90
|
logo: PropTypes.shape({}),
|
|
91
91
|
bonus: PropTypes.shape({
|
|
92
|
-
rating: PropTypes.string,
|
|
92
|
+
rating: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
93
93
|
}),
|
|
94
94
|
name: PropTypes.string,
|
|
95
|
-
rating: PropTypes.string,
|
|
95
|
+
rating: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
96
96
|
url: PropTypes.string,
|
|
97
97
|
extra_fields: PropTypes.shape({
|
|
98
98
|
terms_and_conditions_text_enabled: PropTypes.string,
|
|
@@ -122,10 +122,10 @@ TemplateOne.propTypes = {
|
|
|
122
122
|
operator: PropTypes.shape({
|
|
123
123
|
logo: PropTypes.shape({}),
|
|
124
124
|
bonus: PropTypes.shape({
|
|
125
|
-
rating: PropTypes.string,
|
|
125
|
+
rating: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
126
126
|
}),
|
|
127
127
|
name: PropTypes.string,
|
|
128
|
-
rating: PropTypes.string,
|
|
128
|
+
rating: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
129
129
|
url: PropTypes.string,
|
|
130
130
|
extra_fields: PropTypes.shape({
|
|
131
131
|
terms_and_conditions_text_enabled: PropTypes.string,
|
|
@@ -114,7 +114,7 @@ TemplateOneTwo.propTypes = {
|
|
|
114
114
|
type: PropTypes.string,
|
|
115
115
|
template: PropTypes.string,
|
|
116
116
|
name: PropTypes.string,
|
|
117
|
-
rating: PropTypes.string,
|
|
117
|
+
rating: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
118
118
|
status: PropTypes.string,
|
|
119
119
|
ribbons: PropTypes.arrayOf(PropTypes.string),
|
|
120
120
|
}),
|
|
@@ -81,7 +81,7 @@ SlotHeader.propTypes = {
|
|
|
81
81
|
relation: PropTypes.shape({
|
|
82
82
|
name: PropTypes.string,
|
|
83
83
|
volatility: PropTypes.number,
|
|
84
|
-
average_rating: PropTypes.
|
|
84
|
+
average_rating: PropTypes.number,
|
|
85
85
|
thumbnail_filename_object: PropTypes.string,
|
|
86
86
|
logo: PropTypes.shape({}),
|
|
87
87
|
slot: PropTypes.shape({
|
|
@@ -90,7 +90,7 @@ SlotHeader.propTypes = {
|
|
|
90
90
|
}),
|
|
91
91
|
markets: PropTypes.shape({
|
|
92
92
|
ie_en: PropTypes.shape({
|
|
93
|
-
first_rating: PropTypes.
|
|
93
|
+
first_rating: PropTypes.number,
|
|
94
94
|
}),
|
|
95
95
|
}),
|
|
96
96
|
affiliate_games: PropTypes.shape({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import keygen from '~helpers/keygen';
|
|
3
4
|
import LazyImage from '../../../../../hooks/lazy-image';
|
|
4
5
|
import Link from '../../../../../hooks/link';
|
|
5
6
|
import { getAltText, imagePrettyUrl } from '../../../../../helpers/getters.mjs';
|
|
@@ -33,7 +34,7 @@ export default function TemplateOne({ module, width = 106, height = 106, loading
|
|
|
33
34
|
items?.map((res) => {
|
|
34
35
|
if (res.link?.value) {
|
|
35
36
|
return (
|
|
36
|
-
<Link to={res?.link?.value} external={res?.link?.type === 'external'}>
|
|
37
|
+
<Link key={keygen()} to={res?.link?.value} external={res?.link?.type === 'external'}>
|
|
37
38
|
{content(res)}
|
|
38
39
|
</Link>
|
|
39
40
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import keygen from '~helpers/keygen';
|
|
3
4
|
import LazyImage from '../../../../../hooks/lazy-image';
|
|
4
5
|
import Link from '../../../../../hooks/link';
|
|
5
6
|
import { getAltText, imagePrettyUrl } from '../../../../../helpers/getters.mjs';
|
|
@@ -31,7 +32,7 @@ export default function TemplateOne({ module, width = 295, height = 260 }) {
|
|
|
31
32
|
{items?.map((res) => {
|
|
32
33
|
if (res.link?.value) {
|
|
33
34
|
return (
|
|
34
|
-
<Link to={res?.link?.value} external={res?.link?.type === 'external'}>
|
|
35
|
+
<Link key={keygen()} to={res?.link?.value} external={res?.link?.type === 'external'}>
|
|
35
36
|
{content(res)}
|
|
36
37
|
</Link>
|
|
37
38
|
);
|
|
@@ -44,7 +45,7 @@ export default function TemplateOne({ module, width = 295, height = 260 }) {
|
|
|
44
45
|
|
|
45
46
|
TemplateOne.propTypes = {
|
|
46
47
|
module: PropTypes.shape({
|
|
47
|
-
items: PropTypes.shape(
|
|
48
|
+
items: PropTypes.arrayOf(PropTypes.shape({})),
|
|
48
49
|
}).isRequired,
|
|
49
50
|
width: PropTypes.number,
|
|
50
51
|
height: PropTypes.number,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
|
|
4
|
+
import keygen from '~helpers/keygen';
|
|
4
5
|
import LazyImage from '../../../../../hooks/lazy-image';
|
|
5
6
|
import Link from '../../../../../hooks/link';
|
|
6
7
|
import { getAltText, imagePrettyUrl } from '../../../../../helpers/getters.mjs';
|
|
@@ -34,7 +35,7 @@ export default function TemplateOne({ module, width = 340, height = 268 }) {
|
|
|
34
35
|
items?.map((res) => {
|
|
35
36
|
if (res.link?.value) {
|
|
36
37
|
return (
|
|
37
|
-
<Link to={res?.link?.value} external={res?.link?.type === 'external'}>
|
|
38
|
+
<Link key={keygen()} to={res?.link?.value} external={res?.link?.type === 'external'}>
|
|
38
39
|
{content(res)}
|
|
39
40
|
</Link>
|
|
40
41
|
);
|
|
@@ -48,7 +49,7 @@ export default function TemplateOne({ module, width = 340, height = 268 }) {
|
|
|
48
49
|
|
|
49
50
|
TemplateOne.propTypes = {
|
|
50
51
|
module: PropTypes.shape({
|
|
51
|
-
items: PropTypes.shape({}),
|
|
52
|
+
items: PropTypes.arrayOf(PropTypes.shape({})),
|
|
52
53
|
}).isRequired,
|
|
53
54
|
width: PropTypes.number,
|
|
54
55
|
height: PropTypes.number,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
|
|
4
|
+
import keygen from '~helpers/keygen';
|
|
4
5
|
import LazyImage from '../../../../../hooks/lazy-image';
|
|
5
6
|
import Button from '../../../../atoms/button/button';
|
|
6
7
|
import { getAltText, imagePrettyUrl } from '../../../../../helpers/getters.mjs';
|
|
@@ -25,7 +26,7 @@ export default function TemplateOne({
|
|
|
25
26
|
items?.map((res) => {
|
|
26
27
|
const TitleTag = res?.title_tag || 'label';
|
|
27
28
|
return (
|
|
28
|
-
<div className={`${styles.item} ${scrollableContent && styles.scrollContent}`}>
|
|
29
|
+
<div key={keygen()} className={`${styles.item} ${scrollableContent && styles.scrollContent}`}>
|
|
29
30
|
<div className={styles.topSection}>
|
|
30
31
|
{res?.image && (
|
|
31
32
|
<LazyImage
|
|
@@ -68,7 +69,7 @@ export default function TemplateOne({
|
|
|
68
69
|
|
|
69
70
|
TemplateOne.propTypes = {
|
|
70
71
|
module: PropTypes.shape({
|
|
71
|
-
items: PropTypes.shape({}),
|
|
72
|
+
items: PropTypes.arrayOf(PropTypes.shape({})),
|
|
72
73
|
}).isRequired,
|
|
73
74
|
scrollableContent: PropTypes.bool,
|
|
74
75
|
buttonType: PropTypes.string,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import keygen from '~helpers/keygen';
|
|
3
4
|
import { cleanHTML } from '../../../../../helpers/strings';
|
|
4
5
|
import styles from './template-three.module.scss';
|
|
5
6
|
import Item from './item';
|
|
@@ -25,7 +26,8 @@ export default function TemplateOne({
|
|
|
25
26
|
|
|
26
27
|
const readMoreCheck = plainText.length > characterMaxReadMore;
|
|
27
28
|
return (
|
|
28
|
-
<Item
|
|
29
|
+
<Item
|
|
30
|
+
key={keygen()}
|
|
29
31
|
item={res}
|
|
30
32
|
readMore={readMoreCheck ? readMore : false}
|
|
31
33
|
scrollableContent={scrollableContent}
|
|
@@ -43,7 +45,7 @@ export default function TemplateOne({
|
|
|
43
45
|
|
|
44
46
|
TemplateOne.propTypes = {
|
|
45
47
|
module: PropTypes.shape({
|
|
46
|
-
items: PropTypes.shape({}),
|
|
48
|
+
items: PropTypes.arrayOf(PropTypes.shape({})),
|
|
47
49
|
}).isRequired,
|
|
48
50
|
readMore: PropTypes.bool,
|
|
49
51
|
scrollableContent: PropTypes.bool,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
|
|
4
|
+
import keygen from '~helpers/keygen';
|
|
4
5
|
import LazyImage from '../../../../../hooks/lazy-image';
|
|
5
6
|
import Button from '../../../../atoms/button/button';
|
|
6
7
|
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
@@ -26,7 +27,7 @@ export default function TemplateOne({
|
|
|
26
27
|
items?.map((res) => {
|
|
27
28
|
const TitleTag = res?.title_tag || titleType;
|
|
28
29
|
return (
|
|
29
|
-
<div className={`${styles.item} ${scrollableContent && styles.scrollContent}`}>
|
|
30
|
+
<div key={keygen()} className={`${styles.item} ${scrollableContent && styles.scrollContent}`}>
|
|
30
31
|
<div className={styles.topSection}>
|
|
31
32
|
{res?.image && (
|
|
32
33
|
<LazyImage
|
|
@@ -68,7 +69,7 @@ export default function TemplateOne({
|
|
|
68
69
|
|
|
69
70
|
TemplateOne.propTypes = {
|
|
70
71
|
module: PropTypes.shape({
|
|
71
|
-
items: PropTypes.shape({}),
|
|
72
|
+
items: PropTypes.arrayOf(PropTypes.shape({})),
|
|
72
73
|
}).isRequired,
|
|
73
74
|
scrollableContent: PropTypes.bool,
|
|
74
75
|
buttonType: PropTypes.string,
|
|
@@ -105,7 +105,7 @@ Row.propTypes = {
|
|
|
105
105
|
logo: PropTypes.shape({}),
|
|
106
106
|
selling_points: PropTypes.arrayOf(PropTypes.string),
|
|
107
107
|
review_link: PropTypes.string,
|
|
108
|
-
rating: PropTypes.string,
|
|
108
|
+
rating: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
109
109
|
bonuses: PropTypes.shape({
|
|
110
110
|
main: PropTypes.shape({
|
|
111
111
|
one_liner: PropTypes.string
|
|
@@ -50,7 +50,7 @@ export default function List({
|
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
52
|
<>
|
|
53
|
-
<
|
|
53
|
+
<ol className={styles.list || ''} key={keygen()}>
|
|
54
54
|
{toplist.items?.map((item, index) => (
|
|
55
55
|
<Row
|
|
56
56
|
pagePath={pagePath}
|
|
@@ -67,7 +67,7 @@ export default function List({
|
|
|
67
67
|
modulePosition={modulePosition}
|
|
68
68
|
/>
|
|
69
69
|
))}
|
|
70
|
-
</
|
|
70
|
+
</ol>
|
|
71
71
|
{showLoadMoreButton && (
|
|
72
72
|
<div ref={loadMoreBtn} className={styles.loadMore || ''}>
|
|
73
73
|
<Button
|
|
@@ -53,7 +53,8 @@ export const processSportsRelations = (
|
|
|
53
53
|
relation.events = events;
|
|
54
54
|
relation.tournaments = cloneDeep(sportsMarketData.tournaments);
|
|
55
55
|
relation.schedule = filterScheduleByDate(
|
|
56
|
-
cloneDeep(sportsMarketData.schedule)
|
|
56
|
+
cloneDeep(sportsMarketData.schedule),
|
|
57
|
+
sportsMarketData.tournaments
|
|
57
58
|
);
|
|
58
59
|
relation.featured_events = Object.keys(events).filter(
|
|
59
60
|
(id) => events[id].featured === 1
|
|
@@ -137,7 +138,7 @@ export const processSportsRelations = (
|
|
|
137
138
|
|
|
138
139
|
if (schedule && schedule.soccer) {
|
|
139
140
|
Object.entries(schedule.soccer).forEach(([date, value]) => {
|
|
140
|
-
Object.entries(value.tournaments).forEach(([tournamentId,
|
|
141
|
+
Object.entries(value.tournaments).forEach(([tournamentId, ]) => {
|
|
141
142
|
if (!tournamentIds.includes(parseInt(tournamentId))) {
|
|
142
143
|
delete schedule.soccer[date].tournaments[tournamentId];
|
|
143
144
|
}
|
|
@@ -151,7 +152,7 @@ export const processSportsRelations = (
|
|
|
151
152
|
|
|
152
153
|
relation.teams = cloneDeep(data.relations.sports_data.teams);
|
|
153
154
|
relation.events = events;
|
|
154
|
-
relation.schedule = schedule && schedule.soccer ? filterScheduleByDate(schedule) : {};
|
|
155
|
+
relation.schedule = schedule && schedule.soccer ? filterScheduleByDate(schedule, tournaments) : {};
|
|
155
156
|
relation.tournaments = tournaments;
|
|
156
157
|
|
|
157
158
|
const allFeaturedEvents = sportsMarketData ? Object.keys(sportsMarketData.events).filter(
|
package/src/helpers/schedule.mjs
CHANGED
|
@@ -6,20 +6,23 @@ export function zeroPadding(num, places) {
|
|
|
6
6
|
return String(num).padStart(places, '0');
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export function filterScheduleByDate(schedule) {
|
|
9
|
+
export function filterScheduleByDate(schedule, tournaments) {
|
|
10
10
|
const today = new Date().setHours(0, 0, 0, 0);
|
|
11
11
|
let todayFound = false;
|
|
12
12
|
let todayNextIndex = null;
|
|
13
|
+
|
|
13
14
|
Object.keys(schedule.soccer).forEach((key, index) => {
|
|
14
15
|
if (new Date(key).setHours(0, 0, 0, 0) === today) {
|
|
15
16
|
schedule.soccer[key] = { ...schedule.soccer[key], active: true};
|
|
16
17
|
todayFound = true;
|
|
17
18
|
todayNextIndex = index;
|
|
18
19
|
}
|
|
20
|
+
if(tournaments){
|
|
21
|
+
schedule.soccer[key].sorting = Object.keys(schedule.soccer[key].tournaments).sort(
|
|
22
|
+
(aKey, bKey) => tournaments?.[aKey]?.sort_order - tournaments?.[bKey]?.sort_order);
|
|
23
|
+
}
|
|
19
24
|
});
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
23
26
|
let nextDay = false;
|
|
24
27
|
if(!todayFound) {
|
|
25
28
|
Object.keys(schedule.soccer).forEach((key, index) => {
|
|
@@ -28,6 +31,10 @@ export function filterScheduleByDate(schedule) {
|
|
|
28
31
|
nextDay = true;
|
|
29
32
|
todayNextIndex = index;
|
|
30
33
|
}
|
|
34
|
+
if(tournaments){
|
|
35
|
+
schedule.soccer[key].tournaments_sorted = Object.keys(schedule.soccer[key].tournaments).sort(
|
|
36
|
+
(aKey, bKey) => tournaments?.[aKey]?.sort_order - tournaments?.[bKey]?.sort_order);
|
|
37
|
+
}
|
|
31
38
|
});
|
|
32
39
|
}
|
|
33
40
|
|