gatsby-core-theme 34.0.0 → 34.0.2
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 +25 -0
- package/package.json +1 -1
- package/src/components/atoms/header-operator-bannner/header-operator-banner.test.js +64 -0
- package/src/components/atoms/header-operator-bannner/header-operator-bannner.module.scss +156 -0
- package/src/components/atoms/header-operator-bannner/index.js +81 -0
- package/src/components/atoms/ratings/index.js +91 -0
- package/src/components/atoms/ratings/rating.test.js +55 -0
- package/src/components/atoms/ratings/ratings.module.scss +116 -0
- package/src/components/molecules/bonus/template-two/bonus.stories.js +2 -7
- package/src/components/molecules/bonus-box/template-three/bonus.stories.js +1 -9
- package/src/components/molecules/footer/variables/index.js +11 -0
- package/src/components/molecules/footer/variants/template-three/template-three.stories.js +1 -13
- package/src/components/molecules/footer/variants/template-two/index.js +4 -0
- package/src/components/molecules/footer/variants/template-two/template-two.stories.js +1 -13
- package/src/components/molecules/header/header.module.scss +33 -36
- package/src/components/molecules/header/header.test.js +47 -13
- package/src/components/molecules/header/index.js +132 -62
- package/src/components/molecules/header/variables/index.js +11 -0
- package/src/components/molecules/header/variants/default/template-one/index.js +75 -0
- package/src/components/molecules/header/variants/default/template-one/template-one.module.scss +90 -0
- package/src/components/molecules/header/variants/default/template-one/template-one.stories.js +72 -0
- package/src/components/molecules/header/variants/default/template-one/template-one.test.js +80 -0
- package/src/components/molecules/header/variants/default/variables/index.js +10 -0
- package/src/components/molecules/header/variants/operator/template-one-two/index.js +142 -0
- package/src/components/molecules/header/variants/operator/template-one-two/template-one-two.module.scss +296 -0
- package/src/components/molecules/header/variants/operator/template-one-two/template-one-two.stories.js +57 -0
- package/src/components/molecules/header/variants/operator/template-one-two/template-one-two.test.js +38 -0
- package/src/components/molecules/header/variants/operator/variables/index.js +10 -0
- package/src/components/molecules/menu/menu.module.scss +3 -4
- package/src/components/organisms/navigation/navigation.stories.js +2 -2
- package/src/constants/ratings-constant.js +244 -0
- package/src/helpers/processor/index.mjs +5 -4
- package/src/helpers/processor/modules.mjs +15 -8
- package/src/helpers/processor/modules.test.js +14 -10
- package/src/styles/layouts/_grid.scss +9 -7
- package/tests/factories/pages/default.factory.js +30 -0
- package/tests/factories/relations/operator.factory.js +161 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
## [34.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v34.0.1...v34.0.2) (2024-07-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* placeholders fix ([6808074](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/68080746b4e378ada45bb8139de2ecbc3db9aa29))
|
|
7
|
+
|
|
8
|
+
## [34.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v34.0.0...v34.0.1) (2024-07-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* cards v2 filtering for multi market ([6953c0e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6953c0e45d45a2000f2ec7c92af727b22a3bdbd4))
|
|
14
|
+
* fixed conflict ([497972a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/497972ac3322d67f914103e8c6e96a1fda288572))
|
|
15
|
+
* general stuff ([0aa6c96](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0aa6c9646188760b8c64db3b33161ed9e95cbe83))
|
|
16
|
+
* more general fixes ([72c71d9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/72c71d9ea448875e25e73999084218fda1bf59af))
|
|
17
|
+
* storybook ([330df09](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/330df09528ea592bdd74962e721936ececf4c88f))
|
|
18
|
+
* storybook ([d796b26](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d796b26ccdaadee0211295919f3e6dc905583b9e))
|
|
19
|
+
* tests ([0dc8812](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0dc88127cfdf4f05ff5da117be271621aca42741))
|
|
20
|
+
* translations ([171ebb6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/171ebb61f74ab2d81ebe13c123a7a8749fca17ae))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
* Merge branch 'tm-4319-general-stuff' into 'master' ([d09c215](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d09c215d595953fce515363e4d7fc8533f6df869))
|
|
24
|
+
* Merge branch 'tm-4490-cards-v2-filtering-multi-market' into 'master' ([3946714](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/394671407b8543c0ed4297fc40b1329b75b8fd4b))
|
|
25
|
+
|
|
1
26
|
# [34.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v33.1.13...v34.0.0) (2024-07-09)
|
|
2
27
|
|
|
3
28
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* eslint-disable no-multi-assign */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { render, cleanup } from '@testing-library/react';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import getOperatorData from '../../../../tests/factories/relations/operator.factory';
|
|
6
|
+
import OperatorBannerHeader from '.';
|
|
7
|
+
|
|
8
|
+
describe('Operator Header Banner ', () => {
|
|
9
|
+
test('Status Active', () => {
|
|
10
|
+
const { container, getByText } = render(
|
|
11
|
+
<OperatorBannerHeader operator={getOperatorData().relation} />
|
|
12
|
+
);
|
|
13
|
+
expect(getByText('Welcome Bonus')).toBeTruthy();
|
|
14
|
+
expect(getByText('100% Bonus')).toBeTruthy();
|
|
15
|
+
expect(getByText('+ Big Promotions')).toBeTruthy();
|
|
16
|
+
expect(container.querySelectorAll('span')).toHaveLength(2);
|
|
17
|
+
expect(container.querySelectorAll('a')).toHaveLength(2);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('Status coming_soon', () => {
|
|
21
|
+
const { getByText } = render(
|
|
22
|
+
<OperatorBannerHeader operator={getOperatorData('coming_soon').relation} />
|
|
23
|
+
);
|
|
24
|
+
expect(getByText('coming soon')).toBeTruthy();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('Status inactive', () => {
|
|
28
|
+
const { getByText } = render(
|
|
29
|
+
<OperatorBannerHeader operator={getOperatorData('inactive').relation} />
|
|
30
|
+
);
|
|
31
|
+
expect(getByText('inactive')).toBeTruthy();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('Status not_recommended', () => {
|
|
35
|
+
const { getByText } = render(
|
|
36
|
+
<OperatorBannerHeader operator={getOperatorData('not_recommended').relation} />
|
|
37
|
+
);
|
|
38
|
+
expect(getByText('Welcome Bonus')).toBeTruthy();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('Not having affiliate link', () => {
|
|
42
|
+
const { container } = render(
|
|
43
|
+
<OperatorBannerHeader
|
|
44
|
+
operator={{
|
|
45
|
+
name: '',
|
|
46
|
+
status: 'active',
|
|
47
|
+
links: {
|
|
48
|
+
main: '',
|
|
49
|
+
},
|
|
50
|
+
one_liners: {
|
|
51
|
+
main: {
|
|
52
|
+
one_liner: '100% Bonus + Big Promotions',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
expect(container.querySelectorAll('div')).toHaveLength(0);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
afterEach(() => {
|
|
63
|
+
cleanup();
|
|
64
|
+
});
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
.operatorBanner {
|
|
2
|
+
display: grid;
|
|
3
|
+
gap: 0.8rem;
|
|
4
|
+
align-items: center;
|
|
5
|
+
grid-template-columns: 0.1fr 1fr;
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
background: #1c1a28;
|
|
8
|
+
border: 1px solid #e9e9e9;
|
|
9
|
+
padding: 0.8rem;
|
|
10
|
+
|
|
11
|
+
> a {
|
|
12
|
+
justify-self: end;
|
|
13
|
+
align-self: center;
|
|
14
|
+
|
|
15
|
+
@include max(mobile) {
|
|
16
|
+
padding: 0.8rem 2.1rem;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
line-height: 18px;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
> img {
|
|
24
|
+
width: 4rem;
|
|
25
|
+
height: 4rem;
|
|
26
|
+
min-width: 4rem;
|
|
27
|
+
border-radius: 8px;
|
|
28
|
+
background-color: white;
|
|
29
|
+
border: 1px solid #6b6a72;
|
|
30
|
+
flex: none;
|
|
31
|
+
|
|
32
|
+
@include min(tablet) {
|
|
33
|
+
min-width: 6.4rem;
|
|
34
|
+
width: 6.4rem;
|
|
35
|
+
height: 6.4rem;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@include min(tablet) {
|
|
40
|
+
gap: 1.6rem;
|
|
41
|
+
border-radius: 16px;
|
|
42
|
+
padding: 1.6rem 2.4rem;
|
|
43
|
+
grid-template-columns: 0.1fr 2fr;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
> div {
|
|
47
|
+
max-width: 100%;
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
border: none;
|
|
50
|
+
padding: 0;
|
|
51
|
+
|
|
52
|
+
> div {
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
gap: 1.6rem;
|
|
55
|
+
|
|
56
|
+
> a:first-child {
|
|
57
|
+
display: block;
|
|
58
|
+
|
|
59
|
+
> p {
|
|
60
|
+
display: none;
|
|
61
|
+
text-align: left;
|
|
62
|
+
@include min(tablet) {
|
|
63
|
+
display: block;
|
|
64
|
+
font-weight: 700;
|
|
65
|
+
font-size: 16px;
|
|
66
|
+
line-height: 24px;
|
|
67
|
+
margin-bottom: 0.4rem;
|
|
68
|
+
text-transform: capitalize;
|
|
69
|
+
color: #5ce482;
|
|
70
|
+
text-transform: uppercase;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
> span {
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
line-height: 20px;
|
|
78
|
+
color: white;
|
|
79
|
+
padding-right: 0rem;
|
|
80
|
+
text-align: left;
|
|
81
|
+
|
|
82
|
+
@include min(tablet) {
|
|
83
|
+
font-size: 16px;
|
|
84
|
+
line-height: 27px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
> a:last-child {
|
|
90
|
+
margin-top: 0;
|
|
91
|
+
width: 30%;
|
|
92
|
+
|
|
93
|
+
> svg {
|
|
94
|
+
display: none;
|
|
95
|
+
|
|
96
|
+
@include min(tablet) {
|
|
97
|
+
display: block;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.bonus {
|
|
106
|
+
display: flex;
|
|
107
|
+
|
|
108
|
+
> div {
|
|
109
|
+
> span {
|
|
110
|
+
font-weight: 700;
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
line-height: 20px;
|
|
113
|
+
color: white;
|
|
114
|
+
padding-right: 0rem;
|
|
115
|
+
|
|
116
|
+
@include min(tablet) {
|
|
117
|
+
font-size: 16px;
|
|
118
|
+
line-height: 27px;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@include min(tablet) {
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.bonusTitle {
|
|
129
|
+
display: none;
|
|
130
|
+
|
|
131
|
+
@include min(tablet) {
|
|
132
|
+
display: block;
|
|
133
|
+
font-weight: 700;
|
|
134
|
+
font-size: 16px;
|
|
135
|
+
line-height: 24px;
|
|
136
|
+
margin-bottom: 0.4rem;
|
|
137
|
+
text-transform: capitalize;
|
|
138
|
+
color: #5ce482;
|
|
139
|
+
text-transform: uppercase;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.coming_soon,
|
|
144
|
+
.inactive,
|
|
145
|
+
.not_recommended {
|
|
146
|
+
font-size: 16px;
|
|
147
|
+
line-height: 22px;
|
|
148
|
+
font-weight: 700;
|
|
149
|
+
color: #ffffff;
|
|
150
|
+
text-transform: capitalize;
|
|
151
|
+
|
|
152
|
+
@include min(tablet) {
|
|
153
|
+
font-size: 20px;
|
|
154
|
+
line-height: 30px;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import LazyImage from '~hooks/lazy-image';
|
|
4
|
+
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
5
|
+
import Bonus from '~molecules/bonus-box/template-three';
|
|
6
|
+
import { getAltText, imagePrettyUrl } from '~helpers/getters';
|
|
7
|
+
|
|
8
|
+
import styles from './header-operator-bannner.module.scss';
|
|
9
|
+
|
|
10
|
+
const HeaderOperatorBaner = ({
|
|
11
|
+
operator,
|
|
12
|
+
logo,
|
|
13
|
+
buttonType = 'primary',
|
|
14
|
+
template,
|
|
15
|
+
module = 'header_operator',
|
|
16
|
+
width = '64',
|
|
17
|
+
height = '64',
|
|
18
|
+
}) => {
|
|
19
|
+
let main;
|
|
20
|
+
|
|
21
|
+
if (['coming_soon', 'inactive'].includes(operator?.status)) {
|
|
22
|
+
main = (
|
|
23
|
+
<p className={styles[operator?.status] || ''}>
|
|
24
|
+
{useTranslate(operator?.status, operator?.status.replace('_', ' '))}
|
|
25
|
+
</p>
|
|
26
|
+
);
|
|
27
|
+
} else if (operator?.status === 'active' || operator?.status === 'not_recommended') {
|
|
28
|
+
main = (
|
|
29
|
+
<>
|
|
30
|
+
<Bonus module={module} ctaBtn item={operator} tracker="main" buttonType={buttonType} />
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const trackerLinkActive = () => {
|
|
36
|
+
if (!operator || !operator?.links) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return operator?.links[template] || operator?.links?.main;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
trackerLinkActive() && (
|
|
45
|
+
<div className={`${styles.operatorBanner}`}>
|
|
46
|
+
{logo?.filename && (
|
|
47
|
+
<LazyImage
|
|
48
|
+
loading="eager"
|
|
49
|
+
src={imagePrettyUrl(logo?.filename, width, height)}
|
|
50
|
+
width={width}
|
|
51
|
+
height={height}
|
|
52
|
+
alt={getAltText(logo, operator?.name)}
|
|
53
|
+
/>
|
|
54
|
+
)}
|
|
55
|
+
{main}
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
HeaderOperatorBaner.propTypes = {
|
|
62
|
+
operator: PropTypes.shape({
|
|
63
|
+
name: PropTypes.string,
|
|
64
|
+
type: PropTypes.string,
|
|
65
|
+
template: PropTypes.string,
|
|
66
|
+
links: PropTypes.shape({
|
|
67
|
+
main: PropTypes.string,
|
|
68
|
+
}),
|
|
69
|
+
status: PropTypes.string,
|
|
70
|
+
}),
|
|
71
|
+
logo: PropTypes.shape({
|
|
72
|
+
filename: PropTypes.string,
|
|
73
|
+
}),
|
|
74
|
+
template: PropTypes.string,
|
|
75
|
+
buttonType: PropTypes.string,
|
|
76
|
+
module: PropTypes.string,
|
|
77
|
+
width: PropTypes.string,
|
|
78
|
+
height: PropTypes.string,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export default HeaderOperatorBaner;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
/* eslint-disable no-nested-ternary */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
6
|
+
import { getObjectValue } from 'gatsby-core-theme/src/helpers/getters';
|
|
7
|
+
import keygen from 'gatsby-core-theme/src/helpers/keygen';
|
|
8
|
+
import { operatorRatings } from '../../../constants/ratings-constant';
|
|
9
|
+
|
|
10
|
+
import styles from './ratings.module.scss';
|
|
11
|
+
|
|
12
|
+
export default function Ratings({ item, type, numOfStars = 5, currency = '€' }) {
|
|
13
|
+
const ratings = operatorRatings[type] || [];
|
|
14
|
+
const rangeText = { 0: 'Low', 1: 'Medium', 2: 'High' };
|
|
15
|
+
|
|
16
|
+
// (item?.bonus || item) for the games we don't have ratings in market
|
|
17
|
+
const ratingsData = operatorRatings.ratingProperties.some((prop) => item[prop])
|
|
18
|
+
? item
|
|
19
|
+
: item?.bonus || item;
|
|
20
|
+
|
|
21
|
+
if (!ratings.length) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
27
|
+
<ul className={`${styles?.ratingList || ''}`} tabIndex={0}>
|
|
28
|
+
{ratings?.map((rating) => {
|
|
29
|
+
const { fieldValue, translationKey, fieldLabel, componentToUse } = rating || {};
|
|
30
|
+
let valueDiplayed;
|
|
31
|
+
const value = getObjectValue(ratingsData, fieldValue);
|
|
32
|
+
const component = componentToUse ? componentToUse(numOfStars, value, currency) : false;
|
|
33
|
+
|
|
34
|
+
if (component && value) {
|
|
35
|
+
valueDiplayed = component || '-';
|
|
36
|
+
} else if (fieldValue.includes('volatility')) {
|
|
37
|
+
valueDiplayed = rangeText[getObjectValue(ratingsData, fieldValue)] || '-';
|
|
38
|
+
} else {
|
|
39
|
+
valueDiplayed = value || '-';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (['coming_soon', 'inactive'].includes(item?.status)) {
|
|
43
|
+
valueDiplayed = 'TBA';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<li
|
|
48
|
+
key={keygen()}
|
|
49
|
+
className={`${styles?.item || ''} ${
|
|
50
|
+
rating?.showOnlyMobile ? styles?.showOnlyMobile || '' : ''
|
|
51
|
+
}`}
|
|
52
|
+
>
|
|
53
|
+
<p className={styles?.label || ''}>{useTranslate(translationKey, fieldLabel)}</p>
|
|
54
|
+
|
|
55
|
+
{valueDiplayed === 'TBA' ? (
|
|
56
|
+
<p className={`${styles?.value || ''} ${styles?.tbaValue}`}>
|
|
57
|
+
{useTranslate('tba', 'TBA')}
|
|
58
|
+
</p>
|
|
59
|
+
) : (
|
|
60
|
+
<>
|
|
61
|
+
{valueDiplayed}
|
|
62
|
+
{fieldValue === 'rtp' && '%'}
|
|
63
|
+
</>
|
|
64
|
+
)}
|
|
65
|
+
</li>
|
|
66
|
+
);
|
|
67
|
+
})}
|
|
68
|
+
</ul>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
Ratings.propTypes = {
|
|
73
|
+
item: PropTypes.shape({
|
|
74
|
+
name: PropTypes.string,
|
|
75
|
+
bonus: PropTypes.shape({}),
|
|
76
|
+
rating: PropTypes.string,
|
|
77
|
+
status: PropTypes.string,
|
|
78
|
+
rating_bonuses: PropTypes.string,
|
|
79
|
+
rating_casino: PropTypes.string,
|
|
80
|
+
rating_customer: PropTypes.string,
|
|
81
|
+
rating_games: PropTypes.string,
|
|
82
|
+
rating_payout: PropTypes.string,
|
|
83
|
+
first_rating: PropTypes.string,
|
|
84
|
+
second_rating: PropTypes.string,
|
|
85
|
+
third_rating: PropTypes.string,
|
|
86
|
+
fourth_rating: PropTypes.string,
|
|
87
|
+
}),
|
|
88
|
+
type: PropTypes.string,
|
|
89
|
+
numOfStars: PropTypes.string,
|
|
90
|
+
currency: PropTypes.string,
|
|
91
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* eslint-disable no-multi-assign */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { render, cleanup } from '@testing-library/react';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import Ratings from '.';
|
|
6
|
+
|
|
7
|
+
describe('Rating component', () => {
|
|
8
|
+
const page = () => ({
|
|
9
|
+
name: 'Rizk Casino',
|
|
10
|
+
logo_url_object: {
|
|
11
|
+
filename: 'rizk',
|
|
12
|
+
alt: 'rizk-logo',
|
|
13
|
+
},
|
|
14
|
+
rating: '4.5',
|
|
15
|
+
status: 'active',
|
|
16
|
+
first_rating: '3',
|
|
17
|
+
second_rating: '',
|
|
18
|
+
third_rating: '3',
|
|
19
|
+
fourth_rating: true,
|
|
20
|
+
volatility: 1,
|
|
21
|
+
bonus: {
|
|
22
|
+
rating: '4',
|
|
23
|
+
rating_bonuses: '',
|
|
24
|
+
rating_casino: '3.5',
|
|
25
|
+
rating_customer: '3.5',
|
|
26
|
+
rating_games: '',
|
|
27
|
+
rating_payout: '4.5',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('Rating', () => {
|
|
32
|
+
const { container } = render(<Ratings item={page()} type="operator" />);
|
|
33
|
+
expect(container.querySelectorAll('ul')).toHaveLength(1);
|
|
34
|
+
expect(container.querySelectorAll('li')).toHaveLength(6);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('Rating with diferent data text', () => {
|
|
38
|
+
const { container, getByText, getAllByText } = render(<Ratings item={page()} type="game" />);
|
|
39
|
+
expect(container.querySelectorAll('ul')).toHaveLength(1);
|
|
40
|
+
expect(container.querySelectorAll('li')).toHaveLength(5);
|
|
41
|
+
|
|
42
|
+
expect(getAllByText(3)).toHaveLength(2);
|
|
43
|
+
expect(getByText('Medium')).toBeTruthy();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('Rating no type', () => {
|
|
47
|
+
const { container } = render(<Ratings item={page()} type="" />);
|
|
48
|
+
expect(container.querySelectorAll('ul')).toHaveLength(0);
|
|
49
|
+
expect(container.querySelectorAll('li')).toHaveLength(0);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
afterEach(() => {
|
|
54
|
+
cleanup();
|
|
55
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
.ratingList {
|
|
2
|
+
@include flex-direction(row);
|
|
3
|
+
overflow-x: scroll;
|
|
4
|
+
gap: 0.8rem;
|
|
5
|
+
|
|
6
|
+
&::-webkit-scrollbar {
|
|
7
|
+
width: 3px;
|
|
8
|
+
height: 3px;
|
|
9
|
+
background-color: transparent;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&::-webkit-scrollbar-thumb {
|
|
13
|
+
border-radius: 100px;
|
|
14
|
+
background: #929292;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@include min(tablet) {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: nowrap;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.item {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
font-size: 1.4rem;
|
|
31
|
+
background-color: #fbfbfb;
|
|
32
|
+
border: 1px solid #e9e9e9;
|
|
33
|
+
border-radius: 8px;
|
|
34
|
+
padding: 16px 8px;
|
|
35
|
+
min-height: 9.6rem;
|
|
36
|
+
min-width: 10.4rem;
|
|
37
|
+
|
|
38
|
+
@include min(tablet) {
|
|
39
|
+
margin-bottom: inherit;
|
|
40
|
+
width: -webkit-fill-available;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Star rating
|
|
44
|
+
>div {
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
font-weight: 800;
|
|
48
|
+
font-size: 18px;
|
|
49
|
+
line-height: 28px;
|
|
50
|
+
border: none;
|
|
51
|
+
background-color: #fbfbfb;
|
|
52
|
+
|
|
53
|
+
>svg {
|
|
54
|
+
width: 18.35px;
|
|
55
|
+
height: 17.49px;
|
|
56
|
+
color: var(--rating-star-color, #ffdb20);
|
|
57
|
+
margin-right: 5.82px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
>span:last-child {
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
line-height: 27px;
|
|
63
|
+
font-weight: 700;
|
|
64
|
+
|
|
65
|
+
@include min(tablet) {
|
|
66
|
+
font-weight: 800;
|
|
67
|
+
font-size: 18px;
|
|
68
|
+
line-height: 28px;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.label {
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
line-height: 20px;
|
|
78
|
+
color: #1c1a28;
|
|
79
|
+
padding-bottom: 0.8rem;
|
|
80
|
+
text-align: center;
|
|
81
|
+
|
|
82
|
+
@include min(tablet) {
|
|
83
|
+
font-size: 14px;
|
|
84
|
+
line-height: 22px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.value {
|
|
89
|
+
font-weight: 700;
|
|
90
|
+
font-size: 18px;
|
|
91
|
+
line-height: 28px;
|
|
92
|
+
color: #1c1a28;
|
|
93
|
+
display: flex;
|
|
94
|
+
|
|
95
|
+
>svg {
|
|
96
|
+
width: 2rem;
|
|
97
|
+
height: 2rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@include min(tablet) {
|
|
101
|
+
font-weight: 800;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.tbaValue {
|
|
106
|
+
color: #33313d;
|
|
107
|
+
font-weight: 700;
|
|
108
|
+
font-size: 14px;
|
|
109
|
+
line-height: 22px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.showOnlyMobile {
|
|
113
|
+
@include min(tablet) {
|
|
114
|
+
display: none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -66,12 +66,7 @@ export default {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
const Template = (args) => (
|
|
69
|
-
<
|
|
70
|
-
value={{
|
|
71
|
-
bannerIsActive: true,
|
|
72
|
-
cookieAccepted: false,
|
|
73
|
-
}}
|
|
74
|
-
>
|
|
69
|
+
<div>
|
|
75
70
|
<main>
|
|
76
71
|
<div>
|
|
77
72
|
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
|
|
@@ -154,7 +149,7 @@ const Template = (args) => (
|
|
|
154
149
|
</div>
|
|
155
150
|
</main>
|
|
156
151
|
<Bonus {...args} />
|
|
157
|
-
</
|
|
152
|
+
</div>
|
|
158
153
|
);
|
|
159
154
|
|
|
160
155
|
export const Default = Template.bind({});
|
|
@@ -46,15 +46,7 @@ export default {
|
|
|
46
46
|
},
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
const Template = (args) =>
|
|
50
|
-
<MainProvider
|
|
51
|
-
value={{
|
|
52
|
-
translations: args?.translations,
|
|
53
|
-
}}
|
|
54
|
-
>
|
|
55
|
-
<BonusBox {...args} />
|
|
56
|
-
</MainProvider>
|
|
57
|
-
);
|
|
49
|
+
const Template = (args) => <BonusBox {...args} />;
|
|
58
50
|
|
|
59
51
|
export const Default = Template.bind({});
|
|
60
52
|
Default.args = {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Image from '~hooks/gatsby-img';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
const VariableComponent = ({ className }) => <div className={className || ''}></div>;
|
|
6
|
+
|
|
7
|
+
export default VariableComponent;
|
|
8
|
+
|
|
9
|
+
VariableComponent.propTypes = {
|
|
10
|
+
className: PropTypes.string,
|
|
11
|
+
};
|
|
@@ -158,18 +158,6 @@ export default {
|
|
|
158
158
|
},
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
-
const Template = (args) =>
|
|
162
|
-
<MainProvider
|
|
163
|
-
value={{
|
|
164
|
-
bannerIsActive: false,
|
|
165
|
-
cookieAccepted: true,
|
|
166
|
-
translations: {
|
|
167
|
-
online_casino: 'Online Casino',
|
|
168
|
-
},
|
|
169
|
-
}}
|
|
170
|
-
>
|
|
171
|
-
<TemplateThree {...args} />
|
|
172
|
-
</MainProvider>
|
|
173
|
-
);
|
|
161
|
+
const Template = (args) => <TemplateThree {...args} />;
|
|
174
162
|
export const Default = Template.bind({});
|
|
175
163
|
Default.args = {};
|
|
@@ -6,6 +6,7 @@ import { copyrightText } from '../../../../../helpers/getters';
|
|
|
6
6
|
import Disclaimer from '../../../../atoms/disclaimer';
|
|
7
7
|
import FooterHotline from '../../../../atoms/footer/hotline';
|
|
8
8
|
import FooterLicense from '../../../../atoms/footer/license';
|
|
9
|
+
import VariableComponent from '../../variables';
|
|
9
10
|
import styles from './template-two.module.scss';
|
|
10
11
|
|
|
11
12
|
const TemplateTwo = ({
|
|
@@ -28,6 +29,7 @@ const TemplateTwo = ({
|
|
|
28
29
|
dmcaHeight,
|
|
29
30
|
securityIcon,
|
|
30
31
|
copyrightCustomText,
|
|
32
|
+
hasVariableComponent,
|
|
31
33
|
}) => {
|
|
32
34
|
if (footerMenu !== null && footerMenu.children.length) {
|
|
33
35
|
footerMenu.children.splice(footerMenuLimit);
|
|
@@ -103,6 +105,8 @@ const TemplateTwo = ({
|
|
|
103
105
|
</div>
|
|
104
106
|
)}
|
|
105
107
|
</div>
|
|
108
|
+
|
|
109
|
+
{hasVariableComponent && <VariableComponent />}
|
|
106
110
|
</div>
|
|
107
111
|
</footer>
|
|
108
112
|
);
|