gatsby-core-theme 41.1.8 → 41.1.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 +18 -0
- package/package.json +1 -1
- package/src/components/molecules/bonus/template-one/index.js +9 -3
- package/src/components/molecules/bonus/template-two/index.js +11 -4
- package/src/components/molecules/star-rating/one-star.js +10 -3
- package/src/components/molecules/star-rating/one-star.module.scss +25 -7
- package/src/constants/pick-keys.mjs +2 -1
- package/src/helpers/processor/games.mjs +20 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [41.1.10](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.1.9...v41.1.10) (2024-12-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* game relation logo bug ([3f345ad](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3f345ad01a9ef5113e441492bc55c7b854374e12))
|
|
7
|
+
|
|
8
|
+
## [41.1.9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.1.8...v41.1.9) (2024-12-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bonus rating props ([a6452f3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/a6452f345221e28d0488e6d0d63d6143ad117c26))
|
|
14
|
+
* game relation ([58b82af](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/58b82af23c208efc8aee6abc5e006fdaacada840))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
* Merge branch 'tm-5039-bonus-props' into 'master' ([194ef9b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/194ef9b5a71d789ba1a245566866bd40126090e5))
|
|
18
|
+
|
|
1
19
|
## [41.1.8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.1.7...v41.1.8) (2024-12-12)
|
|
2
20
|
|
|
3
21
|
|
package/package.json
CHANGED
|
@@ -20,6 +20,9 @@ export default function Bonus({
|
|
|
20
20
|
width = "120",
|
|
21
21
|
height = "120",
|
|
22
22
|
showRoundedRating = false,
|
|
23
|
+
showRatingLabel = false,
|
|
24
|
+
showLabelMiddle = false,
|
|
25
|
+
ctaIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />,
|
|
23
26
|
modulePosition
|
|
24
27
|
}) {
|
|
25
28
|
const { logo, bonus, name } = operator || {};
|
|
@@ -50,6 +53,8 @@ export default function Bonus({
|
|
|
50
53
|
<Rating
|
|
51
54
|
rating={operator.rating || bonus?.rating}
|
|
52
55
|
showDecimal
|
|
56
|
+
showLabel={showRatingLabel}
|
|
57
|
+
showLabelMiddle={showLabelMiddle}
|
|
53
58
|
showRoundedRating={showRoundedRating}
|
|
54
59
|
/>
|
|
55
60
|
)}
|
|
@@ -70,9 +75,7 @@ export default function Bonus({
|
|
|
70
75
|
pageTemplate={pageTemplate}
|
|
71
76
|
tracker={module?.tracking_link_name || "main"}
|
|
72
77
|
moduleName={moduleName}
|
|
73
|
-
icon={
|
|
74
|
-
<FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />
|
|
75
|
-
}
|
|
78
|
+
icon={ctaIcon}
|
|
76
79
|
modulePosition={modulePosition}
|
|
77
80
|
/>
|
|
78
81
|
</div>
|
|
@@ -107,5 +110,8 @@ Bonus.propTypes = {
|
|
|
107
110
|
width: PropTypes.string,
|
|
108
111
|
height: PropTypes.string,
|
|
109
112
|
showRoundedRating: PropTypes.bool,
|
|
113
|
+
showRatingLabel: PropTypes.bool,
|
|
114
|
+
showLabelMiddle: PropTypes.bool,
|
|
115
|
+
ctaIcon: PropTypes.elementType,
|
|
110
116
|
modulePosition: PropTypes.number,
|
|
111
117
|
};
|
|
@@ -27,6 +27,10 @@ export default function TemplateOne({
|
|
|
27
27
|
showRoundedRating = false,
|
|
28
28
|
width = "120",
|
|
29
29
|
height = "120",
|
|
30
|
+
showRatingLabel = false,
|
|
31
|
+
showLabelMiddle = false,
|
|
32
|
+
ctaIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />
|
|
33
|
+
|
|
30
34
|
}) {
|
|
31
35
|
const { logo, bonus, name } = operator || {};
|
|
32
36
|
const welcomeBonusText = useTranslate("welcome_bonus", "Welcome Bonus");
|
|
@@ -73,6 +77,8 @@ export default function TemplateOne({
|
|
|
73
77
|
<Rating
|
|
74
78
|
rating={operator?.rating || bonus?.rating}
|
|
75
79
|
showDecimal
|
|
80
|
+
showLabel={showRatingLabel}
|
|
81
|
+
showLabelMiddle={showLabelMiddle}
|
|
76
82
|
showRoundedRating={showRoundedRating}
|
|
77
83
|
/>
|
|
78
84
|
)}
|
|
@@ -93,9 +99,7 @@ export default function TemplateOne({
|
|
|
93
99
|
moduleName={moduleName}
|
|
94
100
|
pageTemplate={pageTemplate}
|
|
95
101
|
tracker={module?.tracking_link_name || "main"}
|
|
96
|
-
icon={
|
|
97
|
-
<FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />
|
|
98
|
-
}
|
|
102
|
+
icon={ctaIcon}
|
|
99
103
|
translationsObj={translationsObj}
|
|
100
104
|
/>
|
|
101
105
|
{tncFixed && <Tnc isFixed={tncFixed} operator={operator} />}
|
|
@@ -138,6 +142,9 @@ TemplateOne.propTypes = {
|
|
|
138
142
|
}),
|
|
139
143
|
moduleName: PropTypes.string,
|
|
140
144
|
width: PropTypes.string,
|
|
141
|
-
height: PropTypes.string,
|
|
145
|
+
height: PropTypes.string,
|
|
146
|
+
showRatingLabel: PropTypes.bool,
|
|
147
|
+
showLabelMiddle: PropTypes.bool,
|
|
148
|
+
ctaIcon: PropTypes.elementType,
|
|
142
149
|
showRoundedRating: PropTypes.bool,
|
|
143
150
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
4
4
|
import { getRating } from '~helpers/rating';
|
|
@@ -10,13 +10,19 @@ const OneStar = ({
|
|
|
10
10
|
numOfStars = 5,
|
|
11
11
|
active = true,
|
|
12
12
|
showLabel = false,
|
|
13
|
+
showLabelMiddle = false,
|
|
13
14
|
icon = null,
|
|
14
15
|
showDecimal = false,
|
|
15
16
|
showRoundedRating = false,
|
|
16
17
|
}) => {
|
|
18
|
+
|
|
19
|
+
const ratingText = useTranslate('rating', 'Rating:');
|
|
20
|
+
|
|
17
21
|
return (
|
|
18
|
-
<div className={`${styles.starRatingContainer || ''} ${!active && (styles.inactive || '')}
|
|
19
|
-
|
|
22
|
+
<div className={`${styles.starRatingContainer || ''} ${!active && (styles.inactive || '')}
|
|
23
|
+
${showLabelMiddle && (styles.labelMiddle || '')}`}
|
|
24
|
+
>
|
|
25
|
+
{showLabel && <span>{ratingText}</span>}
|
|
20
26
|
{!icon ? <span className={styles.fullStar || ''} /> : icon}
|
|
21
27
|
{showDecimal
|
|
22
28
|
? getRating(rating, showRoundedRating).toFixed(1)
|
|
@@ -35,6 +41,7 @@ OneStar.propTypes = {
|
|
|
35
41
|
icon: PropTypes.element,
|
|
36
42
|
showDecimal: PropTypes.bool,
|
|
37
43
|
showRoundedRating: PropTypes.bool,
|
|
44
|
+
showLabelMiddle: PropTypes.bool,
|
|
38
45
|
};
|
|
39
46
|
|
|
40
47
|
export default OneStar;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
/* stylelint-disable no-descending-specificity */
|
|
2
|
+
|
|
1
3
|
.starRatingContainer {
|
|
2
4
|
@include flex-direction(row);
|
|
5
|
+
|
|
3
6
|
justify-content: center;
|
|
4
|
-
background-color: #
|
|
7
|
+
background-color: #fff;
|
|
5
8
|
min-width: 6.5rem;
|
|
6
9
|
min-height: 2.1rem;
|
|
7
|
-
line-height: 2.1rem;
|
|
8
10
|
border-radius: 0.4rem;
|
|
9
11
|
border: 1px solid var(--main-star-wrapper-color);
|
|
10
12
|
color: #17182f;
|
|
@@ -13,8 +15,8 @@
|
|
|
13
15
|
margin: 0 0.33rem;
|
|
14
16
|
line-height: 2.1rem;
|
|
15
17
|
|
|
16
|
-
>svg {
|
|
17
|
-
color: var(--icons-rating-color, #
|
|
18
|
+
> svg {
|
|
19
|
+
color: var(--icons-rating-color, #ffdb20);
|
|
18
20
|
width: 23.35px;
|
|
19
21
|
height: 22.26px;
|
|
20
22
|
flex: none;
|
|
@@ -23,13 +25,23 @@
|
|
|
23
25
|
|
|
24
26
|
&.inactive {
|
|
25
27
|
.fullStar {
|
|
26
|
-
@include star(
|
|
28
|
+
@include star(
|
|
29
|
+
var(--empty-star-border-color),
|
|
30
|
+
var(--empty-star-border-color),
|
|
31
|
+
unset,
|
|
32
|
+
2.1rem
|
|
33
|
+
);
|
|
27
34
|
}
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
.fullStar {
|
|
32
|
-
@include star(
|
|
39
|
+
@include star(
|
|
40
|
+
var(--full-star-fill-color),
|
|
41
|
+
var(--full-star-border-color),
|
|
42
|
+
unset,
|
|
43
|
+
2.1rem
|
|
44
|
+
);
|
|
33
45
|
}
|
|
34
46
|
|
|
35
47
|
.text {
|
|
@@ -38,4 +50,10 @@
|
|
|
38
50
|
font-size: 1.3rem;
|
|
39
51
|
margin: 0 0.33rem;
|
|
40
52
|
line-height: 2.1rem;
|
|
41
|
-
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.labelMiddle {
|
|
56
|
+
.fullStar {
|
|
57
|
+
order: -1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -10,16 +10,26 @@ export function sanitizegameData(game, pages = null) {
|
|
|
10
10
|
const gameClone = cloneDeep(game);
|
|
11
11
|
|
|
12
12
|
const providerPage = pages
|
|
13
|
-
? pages.filter(
|
|
13
|
+
? pages.filter(
|
|
14
|
+
(provider) => game.game_provider?.id === provider.relation_id
|
|
15
|
+
)
|
|
14
16
|
: null;
|
|
15
17
|
|
|
16
|
-
if(providerPage && providerPage.length > 0 && gameClone.game_provider) {
|
|
17
|
-
gameClone.game_provider.path =
|
|
18
|
+
if (providerPage && providerPage.length > 0 && gameClone.game_provider) {
|
|
19
|
+
gameClone.game_provider.path = providerPage[0].path;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
return pick(gameClone, pickRelationKeys.game);
|
|
21
23
|
}
|
|
22
24
|
|
|
25
|
+
function removeDomain(url) {
|
|
26
|
+
if (url) {
|
|
27
|
+
const domainRegex = /^https?:\/\/[^/]+/;
|
|
28
|
+
return url.replace(domainRegex, "");
|
|
29
|
+
}
|
|
30
|
+
return null; // Return null if the URL is invalid
|
|
31
|
+
}
|
|
32
|
+
|
|
23
33
|
export function transformGames(jsonData, relationsData) {
|
|
24
34
|
const games = {};
|
|
25
35
|
|
|
@@ -45,7 +55,13 @@ export function transformGames(jsonData, relationsData) {
|
|
|
45
55
|
...filteredSitesData, // Filtered affiliate data
|
|
46
56
|
};
|
|
47
57
|
|
|
48
|
-
|
|
58
|
+
const logoObject = newGamesData.game_thumbnail || newGamesData.standardised_logo;
|
|
59
|
+
newGamesData.logo = {
|
|
60
|
+
...logoObject,
|
|
61
|
+
filename: logoObject && logoObject.url
|
|
62
|
+
? removeDomain(logoObject.url)
|
|
63
|
+
: null,
|
|
64
|
+
};
|
|
49
65
|
|
|
50
66
|
// Provider
|
|
51
67
|
newGamesData.game_provider = relationsData.providers[
|