gatsby-matrix-theme 3.1.0 → 3.2.1
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 +62 -0
- package/package.json +2 -2
- package/src/components/atoms/cards/comparison-table/comparison-table.module.scss +27 -0
- package/src/components/atoms/cards/comparison-table/comparison-table.stories.js +39 -0
- package/src/components/atoms/cards/comparison-table/index.js +57 -0
- package/src/components/atoms/cards/comparison-table/table/index.js +196 -0
- package/src/components/atoms/cards/comparison-table/table/table.module.scss +137 -0
- package/src/components/atoms/cards/comparison-table/table/table.test.js +22 -0
- package/src/components/atoms/cards/operators-table/index.js +5 -2
- package/src/components/atoms/cards/popup-card/index.js +1 -1
- package/src/components/molecules/toplist/row/variant-one.test.js +2 -2
- package/src/components/organisms/popup/index.js +4 -3
- package/src/components/organisms/toplist/index.js +2 -11
- package/src/gatsby-core-theme/components/atoms/bonus/bonus.test.js +0 -1
- package/src/gatsby-core-theme/components/atoms/bonus/index.js +1 -1
- package/src/gatsby-core-theme/components/atoms/spotlights/spotlights.module.scss +78 -109
- package/src/gatsby-core-theme/components/molecules/content/index.js +6 -0
- package/src/gatsby-core-theme/components/molecules/module/index.js +5 -1
- package/src/gatsby-core-theme/components/organisms/head/index.js +7 -4
- package/src/gatsby-core-theme/styles/utils/variables/_main.scss +10 -1
- package/storybook/public/{0.741e5022.iframe.bundle.js → 0.1be55b0d.iframe.bundle.js} +1 -1
- package/storybook/public/{1.d02d8599.iframe.bundle.js → 1.318fc035.iframe.bundle.js} +1 -1
- package/storybook/public/{10.ddb198cb.iframe.bundle.js → 10.ff8f20a0.iframe.bundle.js} +1 -1
- package/storybook/public/{11.86382beb.iframe.bundle.js → 11.a965ed36.iframe.bundle.js} +1 -1
- package/storybook/public/{12.b6909189.iframe.bundle.js → 12.f31f86bb.iframe.bundle.js} +1 -1
- package/storybook/public/{13.9e6703fb.iframe.bundle.js → 13.c72a573a.iframe.bundle.js} +1 -1
- package/storybook/public/{14.b0c67bdf.iframe.bundle.js → 14.454a253c.iframe.bundle.js} +1 -1
- package/storybook/public/{15.7bb7d301.iframe.bundle.js → 15.baadf857.iframe.bundle.js} +1 -1
- package/storybook/public/{16.d64c7fd7.iframe.bundle.js → 16.9d6c22db.iframe.bundle.js} +1 -1
- package/storybook/public/{5.80aa479a.iframe.bundle.js → 5.3751341c.iframe.bundle.js} +3 -3
- package/storybook/public/{5.80aa479a.iframe.bundle.js.LICENSE.txt → 5.3751341c.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook/public/5.3751341c.iframe.bundle.js.map +1 -0
- package/storybook/public/{6.ed0e7e34.iframe.bundle.js → 6.78854fa8.iframe.bundle.js} +1 -1
- package/storybook/public/{7.906eebeb.iframe.bundle.js → 7.7dfb34cd.iframe.bundle.js} +1 -1
- package/storybook/public/{8.c5053ebc.iframe.bundle.js → 8.88be3011.iframe.bundle.js} +1 -1
- package/storybook/public/{9.05a986eb.iframe.bundle.js → 9.c2b37d15.iframe.bundle.js} +3 -3
- package/storybook/public/{9.05a986eb.iframe.bundle.js.LICENSE.txt → 9.c2b37d15.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook/public/9.c2b37d15.iframe.bundle.js.map +1 -0
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.c5dc17b4.iframe.bundle.js +1 -0
- package/storybook/public/{runtime~main.d48e48c3.iframe.bundle.js → runtime~main.d240eb23.iframe.bundle.js} +1 -1
- package/storybook/public/vendors~main.5a60748d.iframe.bundle.js +7 -0
- package/storybook/public/{vendors~main.fcfe1398.iframe.bundle.js.LICENSE.txt → vendors~main.5a60748d.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook/public/vendors~main.5a60748d.iframe.bundle.js.map +1 -0
- package/src/components/organisms/toplist/comparison-table/comparison-table.module.scss +0 -52
- package/src/components/organisms/toplist/comparison-table/index.js +0 -165
- package/src/gatsby-core-theme/components/atoms/spotlights/index.js +0 -185
- package/storybook/public/5.80aa479a.iframe.bundle.js.map +0 -1
- package/storybook/public/9.05a986eb.iframe.bundle.js.map +0 -1
- package/storybook/public/main.074d0b0b.iframe.bundle.js +0 -1
- package/storybook/public/vendors~main.fcfe1398.iframe.bundle.js +0 -7
- package/storybook/public/vendors~main.fcfe1398.iframe.bundle.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,65 @@
|
|
|
1
|
+
## [3.2.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.2.0...v3.2.1) (2022-01-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* comparison table configurations ([97d1bd6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/97d1bd6fb267ca43a251b9c748aee14244ee9f7e))
|
|
7
|
+
|
|
8
|
+
# [3.2.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.1.2...v3.2.0) (2022-01-03)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* add storybook and fix some style issue ([40db75b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/40db75b3d61109ab835053ff8ca9fa52a9625cbc))
|
|
14
|
+
* added scss vars for comparison table and minor fixes ([fe23268](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fe23268f258709c0f43742261fb152d506e7a48e))
|
|
15
|
+
* fixed name and style also added the deposit method ([b075d1e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b075d1ed2ffcfafc27860a6cdde653866ac24929))
|
|
16
|
+
* second line fix ([ede14f5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ede14f52526d6d09ae415c164d7fa0c0fc13e4f6))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Config
|
|
20
|
+
|
|
21
|
+
* updated core version ([bfbdce6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/bfbdce6a196a09cd5ee6befccb3fd36900306a41))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
* Merge branch 'STK-2585-Casino-comparison-module' into 'master' ([9376eb2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9376eb220a8b99a175667ea4f1308c498ae0a2e6))
|
|
25
|
+
* Merge branch 'master' into STK-2585-Casino-comparison-module ([b3c2149](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b3c2149636ae1e46bb96b6843ea2ea7333b90d6c))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* add the comparison table ([7decb55](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7decb557e543b7307dad0edc78677158bdfb7ced))
|
|
31
|
+
|
|
32
|
+
## [3.1.2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.1.1...v3.1.2) (2021-12-23)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
* operator bonus added dividor ([98538a9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/98538a94160ef27a2a4d33334f8534aa6baff32e))
|
|
38
|
+
* fixed parsing metadescription ([f3f7568](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/f3f75682e88341ebc90f3f532594e4a816605fc9))
|
|
39
|
+
* new testimonials styling ([7f16177](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7f1617700a339d7e0edd183769b040fb9a419255))
|
|
40
|
+
* removed an useless line ([6320358](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/63203585e3ee6362f1250033b0b41a1180f61ad2))
|
|
41
|
+
* tests ([0d2794f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0d2794feb4f5a93eb08f40c1776330a25aed0850))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Config
|
|
45
|
+
|
|
46
|
+
* updated core theme version ([8ead1a7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8ead1a7c4fec1a4f30acced891b9eaa262d2c104))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
* Merge branch 'tm-2629-spotlight-testimonials' into 'master' ([52f20ab](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/52f20abf60df594d49e7eac3c4a5a099e7c2842a))
|
|
50
|
+
* Merge branch 'tm-2610-operator-bonus' into 'master' ([8c80938](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8c80938101df09f25d6458c423f4eaf09e8da5ca))
|
|
51
|
+
* Merge branch 'fix-parse-metadescription' into 'master' ([fbed07c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fbed07cb84ba1d34a296ebc5cbf059eadfecdd72))
|
|
52
|
+
|
|
53
|
+
## [3.1.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.1.0...v3.1.1) (2021-12-17)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Config
|
|
57
|
+
|
|
58
|
+
* updated theme version ([d35a8d2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d35a8d258252b7376968683cd5fc65af089923eb))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
* Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/matrix-theme ([ec89a34](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ec89a340a0c73ed3261f0b5d9eff2b33254dc35c))
|
|
62
|
+
|
|
1
63
|
# [3.1.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.0.10...v3.1.0) (2021-12-17)
|
|
2
64
|
|
|
3
65
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-matrix-theme",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Matrix Theme NPM Package",
|
|
6
6
|
"author": "",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"cross-env": "^7.0.2",
|
|
32
32
|
"dotenv": "8.2.0",
|
|
33
33
|
"gatsby": "^3.3.1",
|
|
34
|
-
"gatsby-core-theme": "^2.0.
|
|
34
|
+
"gatsby-core-theme": "^2.0.10",
|
|
35
35
|
"gatsby-image": "^3.3.0",
|
|
36
36
|
"gatsby-plugin-image": "^1.3.1",
|
|
37
37
|
"gatsby-plugin-postcss": "^4.3.0",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.comparisonTable {
|
|
2
|
+
|
|
3
|
+
.contentTable {
|
|
4
|
+
border-right: 1px solid var(--body-border-color);
|
|
5
|
+
overflow-x: scroll;
|
|
6
|
+
cursor: grabbing;
|
|
7
|
+
&::-webkit-scrollbar {
|
|
8
|
+
height: 5px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Track */
|
|
12
|
+
&::-webkit-scrollbar-track {
|
|
13
|
+
background: #f1f1f1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Handle */
|
|
17
|
+
&::-webkit-scrollbar-thumb {
|
|
18
|
+
background: rgb(216, 216, 216);
|
|
19
|
+
border-radius: 10px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Handle on hover */
|
|
23
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
24
|
+
background: rgb(187, 187, 187);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
3
|
+
import {
|
|
4
|
+
Title,
|
|
5
|
+
Description,
|
|
6
|
+
Primary,
|
|
7
|
+
PRIMARY_STORY,
|
|
8
|
+
ArgsTable,
|
|
9
|
+
} from '@storybook/addon-docs/blocks';
|
|
10
|
+
import { getSampleOperatorCards } from 'gatsby-core-theme/tests/factories/modules/card.factory';
|
|
11
|
+
|
|
12
|
+
import ComparisonTable from '.';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Matrix-Theme/Atoms/Comparison Table',
|
|
16
|
+
component: ComparisonTable,
|
|
17
|
+
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component: 'A component that displays a single Popup Card',
|
|
22
|
+
},
|
|
23
|
+
page: () => (
|
|
24
|
+
<>
|
|
25
|
+
<Title />
|
|
26
|
+
<Description />
|
|
27
|
+
<Primary />
|
|
28
|
+
<ArgsTable story={PRIMARY_STORY} />
|
|
29
|
+
</>
|
|
30
|
+
),
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const Template = (args) => <ComparisonTable {...args} />;
|
|
36
|
+
export const Default = Template.bind({});
|
|
37
|
+
Default.args = {
|
|
38
|
+
module: getSampleOperatorCards(),
|
|
39
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
import styles from './comparison-table.module.scss';
|
|
5
|
+
import Table from './table';
|
|
6
|
+
|
|
7
|
+
export default function ComparisonTable({ module }) {
|
|
8
|
+
const ele = useRef('');
|
|
9
|
+
|
|
10
|
+
let pos = { top: 0, left: 0, x: 0, y: 0 };
|
|
11
|
+
|
|
12
|
+
const mouseMoveHandler = (e) => {
|
|
13
|
+
const dx = e.clientX - pos.x;
|
|
14
|
+
ele.current.scrollLeft = pos.left - dx;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const mouseLeftHandler = () => {
|
|
18
|
+
ele.current.style.cursor = 'grab';
|
|
19
|
+
ele.current.style.removeProperty('user-select');
|
|
20
|
+
|
|
21
|
+
document.removeEventListener('mousemove', mouseMoveHandler);
|
|
22
|
+
document.removeEventListener('mouseup', mouseLeftHandler);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const mouseRightHandler = (e) => {
|
|
26
|
+
ele.current.style.cursor = 'grabbing';
|
|
27
|
+
ele.current.style.userSelect = 'none';
|
|
28
|
+
|
|
29
|
+
pos = {
|
|
30
|
+
left: ele.current.scrollLeft,
|
|
31
|
+
x: e.clientX,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
document.addEventListener('mousemove', mouseMoveHandler);
|
|
35
|
+
document.addEventListener('mouseup', mouseLeftHandler);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
ele.current.style.cursor = 'grab';
|
|
40
|
+
ele.current.addEventListener('mousedown', mouseRightHandler);
|
|
41
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className={styles.comparisonTable}>
|
|
46
|
+
<div ref={ele} className={styles.contentTable}>
|
|
47
|
+
<Table items={module?.items} />
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
ComparisonTable.propTypes = {
|
|
54
|
+
module: PropTypes.shape({
|
|
55
|
+
items: PropTypes.shape({}),
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { AiOutlineCheckCircle } from 'react-icons/ai';
|
|
4
|
+
import { imagePrettyUrl, translate } from 'gatsby-core-theme/src/helpers/getters';
|
|
5
|
+
import LazyImg from 'gatsby-core-theme/src/hooks/lazy-image';
|
|
6
|
+
import OperatorCta from 'gatsby-core-theme/src/components/atoms/operator-cta';
|
|
7
|
+
import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating';
|
|
8
|
+
import Link from 'gatsby-core-theme/src/hooks/link';
|
|
9
|
+
import Bonus from 'gatsby-core-theme/src/components/atoms/bonus';
|
|
10
|
+
import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
|
|
11
|
+
|
|
12
|
+
import styles from './table.module.scss';
|
|
13
|
+
|
|
14
|
+
export default function ComparisonTable({ items }) {
|
|
15
|
+
const { translations } = useContext(Context) || {};
|
|
16
|
+
|
|
17
|
+
const tabelInfo = [
|
|
18
|
+
{
|
|
19
|
+
defaultValue: 'Casino name',
|
|
20
|
+
key: 'casino_name',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
defaultValue: 'Rating',
|
|
24
|
+
key: 'rating',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
defaultValue: 'Bonus',
|
|
28
|
+
key: 'bonus',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
defaultValue: 'Top Features',
|
|
32
|
+
key: 'top_features',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
defaultValue: 'Payment Methods',
|
|
36
|
+
key: 'payment_methods',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
defaultValue: 'Banking',
|
|
40
|
+
key: 'banking',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
defaultValue: 'Currencies',
|
|
44
|
+
key: 'currencies',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
defaultValue: 'Licenses',
|
|
48
|
+
key: 'licenses',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const cell = (heading, item, index) => {
|
|
53
|
+
switch (heading) {
|
|
54
|
+
case 'casino_name':
|
|
55
|
+
return (
|
|
56
|
+
<td key={index} className={styles.casinoName}>
|
|
57
|
+
<LazyImg
|
|
58
|
+
src={imagePrettyUrl(item?.relation?.logo_url)}
|
|
59
|
+
height={89}
|
|
60
|
+
width={89}
|
|
61
|
+
alt={item.title}
|
|
62
|
+
/>
|
|
63
|
+
<div>
|
|
64
|
+
<span>{item.title}</span>
|
|
65
|
+
<OperatorCta
|
|
66
|
+
tracker="main"
|
|
67
|
+
operator={item?.relation}
|
|
68
|
+
playText={translate(translations, 'play_now', 'Play Now')}
|
|
69
|
+
gtmClass="operator-card-gtm btn-cta"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</td>
|
|
73
|
+
);
|
|
74
|
+
case 'rating':
|
|
75
|
+
return (
|
|
76
|
+
<td key={index} className={styles.raiting}>
|
|
77
|
+
<StarRating numOfStars={5} rating={item?.relation?.rating} />
|
|
78
|
+
<Link to={item.path}> {translate(translations, 'review', 'Read Review')} </Link>
|
|
79
|
+
</td>
|
|
80
|
+
);
|
|
81
|
+
case 'bonus':
|
|
82
|
+
return (
|
|
83
|
+
<td key={index} className={styles.bonus}>
|
|
84
|
+
<Bonus tracker="main" item={item?.relation} />
|
|
85
|
+
</td>
|
|
86
|
+
);
|
|
87
|
+
case 'top_features':
|
|
88
|
+
return (
|
|
89
|
+
<td key={index} className={styles.topFeatures}>
|
|
90
|
+
{item?.relation?.selling_points &&
|
|
91
|
+
item?.relation?.selling_points.map((sellingPoint) => (
|
|
92
|
+
<span key={sellingPoint}>
|
|
93
|
+
<AiOutlineCheckCircle size={27} /> {sellingPoint}
|
|
94
|
+
</span>
|
|
95
|
+
))}
|
|
96
|
+
</td>
|
|
97
|
+
);
|
|
98
|
+
case 'payment_methods':
|
|
99
|
+
return (
|
|
100
|
+
<td key={index} className={styles.paymentMethods}>
|
|
101
|
+
{item?.relation?.bonus?.deposit_methods &&
|
|
102
|
+
item?.relation?.bonus?.deposit_methods.slice(0, 5).map((deposit) => (
|
|
103
|
+
<span key={deposit.name}>
|
|
104
|
+
<LazyImg
|
|
105
|
+
src={imagePrettyUrl(deposit?.logo_filename)}
|
|
106
|
+
width={72}
|
|
107
|
+
height={72}
|
|
108
|
+
alt={deposit.name}
|
|
109
|
+
/>
|
|
110
|
+
</span>
|
|
111
|
+
))}
|
|
112
|
+
{item?.relation?.bonus?.deposit_methods?.length > 5 && (
|
|
113
|
+
<span>+{item?.relation?.bonus?.deposit_methods.length - 5}</span>
|
|
114
|
+
)}
|
|
115
|
+
</td>
|
|
116
|
+
);
|
|
117
|
+
case 'banking':
|
|
118
|
+
return (
|
|
119
|
+
<td key={index} className={styles.banking}>
|
|
120
|
+
<p>
|
|
121
|
+
{translate(translations, 'min_deposit', 'Min Deposit')}
|
|
122
|
+
<span>{item?.relation?.bonus?.min_deposit}</span>
|
|
123
|
+
</p>
|
|
124
|
+
<p>
|
|
125
|
+
{translate(translations, 'max_withdrawal', 'Max Withdrawal')}
|
|
126
|
+
<span>{item?.relation?.bonus?.max_withdrawal}</span>
|
|
127
|
+
</p>
|
|
128
|
+
<p>
|
|
129
|
+
{translate(translations, 'currency_support', 'Currency Support')}
|
|
130
|
+
<span>
|
|
131
|
+
{item?.relation?.bonus?.currencies &&
|
|
132
|
+
item?.relation?.bonus?.currencies
|
|
133
|
+
.slice(0, 3)
|
|
134
|
+
.map((currencies) => currencies.iso_code)}
|
|
135
|
+
</span>
|
|
136
|
+
</p>
|
|
137
|
+
</td>
|
|
138
|
+
);
|
|
139
|
+
case 'currencies':
|
|
140
|
+
return (
|
|
141
|
+
<td key={index} className={styles.currencies}>
|
|
142
|
+
{item?.relation?.bonus?.currencies &&
|
|
143
|
+
item?.relation?.bonus?.currencies.map((currencies) => (
|
|
144
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
145
|
+
<span key={currencies.iso_code}>{currencies.iso_code} </span>
|
|
146
|
+
))}
|
|
147
|
+
</td>
|
|
148
|
+
);
|
|
149
|
+
case 'licenses':
|
|
150
|
+
return (
|
|
151
|
+
<td key={index} className={styles.licenses}>
|
|
152
|
+
{item?.relation?.bonus?.license_objects &&
|
|
153
|
+
item?.relation?.bonus?.license_objects.map((license) => (
|
|
154
|
+
<LazyImg
|
|
155
|
+
src={imagePrettyUrl(license?.logo_filename)}
|
|
156
|
+
height={32}
|
|
157
|
+
alt={license.name}
|
|
158
|
+
/>
|
|
159
|
+
))}
|
|
160
|
+
</td>
|
|
161
|
+
);
|
|
162
|
+
default:
|
|
163
|
+
return '';
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const table = () => {
|
|
168
|
+
const row = [];
|
|
169
|
+
tabelInfo.forEach((heading) => {
|
|
170
|
+
const cells = [];
|
|
171
|
+
|
|
172
|
+
items.forEach((item, index) => {
|
|
173
|
+
cells.push(cell(heading.key, item, `${heading}-${index}`));
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
row.push(
|
|
177
|
+
<tr>
|
|
178
|
+
<th>{translate(translations, heading.key, heading.defaultValue)}</th>
|
|
179
|
+
{cells}
|
|
180
|
+
</tr>
|
|
181
|
+
);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<table>
|
|
186
|
+
<tbody>{row}</tbody>
|
|
187
|
+
</table>
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
return table();
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
ComparisonTable.propTypes = {
|
|
195
|
+
items: PropTypes.arrayOf(PropTypes.object),
|
|
196
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
table {
|
|
2
|
+
cursor: grabbing;
|
|
3
|
+
tr {
|
|
4
|
+
grid-template-columns: 15.2rem 27rem;
|
|
5
|
+
grid-auto-columns: 27rem;
|
|
6
|
+
grid-auto-flow: column;
|
|
7
|
+
display: grid;
|
|
8
|
+
|
|
9
|
+
&:first-child {
|
|
10
|
+
th {
|
|
11
|
+
border-top-left-radius: 0.8rem;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&:last-child {
|
|
16
|
+
th {
|
|
17
|
+
border-bottom-left-radius: 0.8rem;
|
|
18
|
+
border-bottom: 1px solid var(--comparison-header-border-color);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
th {
|
|
23
|
+
@include flex-align(center, center);
|
|
24
|
+
background-color: var(--comparison-header-background-color);
|
|
25
|
+
border: 1px solid var(--comparison-header-border-color);
|
|
26
|
+
border-bottom: none;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
color: var(--comparison-header-text-color);
|
|
29
|
+
text-transform: var(--comparison-header-text-transform);
|
|
30
|
+
font-size: 1.4rem;
|
|
31
|
+
|
|
32
|
+
@include min(laptop) {
|
|
33
|
+
position: sticky;
|
|
34
|
+
z-index: 1;
|
|
35
|
+
left: 0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
td {
|
|
39
|
+
border: 1px solid var(--comparison-body-border-color);
|
|
40
|
+
background-color: var(--comparison-body-background-color);
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
padding: 1.6rem;
|
|
43
|
+
}
|
|
44
|
+
.casinoName {
|
|
45
|
+
@include flex-direction(row);
|
|
46
|
+
@include flex-align(center, space-between);
|
|
47
|
+
padding: 1.6rem;
|
|
48
|
+
img {
|
|
49
|
+
border: 1px solid var(--color-9);
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
margin-right: 1.6rem;
|
|
52
|
+
}
|
|
53
|
+
span {
|
|
54
|
+
font-weight: bold;
|
|
55
|
+
font-size: 18px;
|
|
56
|
+
line-height: 25px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.bonus {
|
|
61
|
+
div:first-child {
|
|
62
|
+
font-size: 1.6rem;
|
|
63
|
+
font-weight: bold;
|
|
64
|
+
}
|
|
65
|
+
div:nth-child(2) {
|
|
66
|
+
font-size: 1.4rem;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.raiting {
|
|
72
|
+
@include flex-align(center, space-between);
|
|
73
|
+
|
|
74
|
+
a {
|
|
75
|
+
font-weight: bold;
|
|
76
|
+
font-size: 1.6rem;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.topFeatures {
|
|
80
|
+
@include flex-direction(column);
|
|
81
|
+
@include flex-align(flex-start, center);
|
|
82
|
+
span {
|
|
83
|
+
@include flex-direction(row);
|
|
84
|
+
@include flex-align(center, center);
|
|
85
|
+
margin-bottom: 0.8rem;
|
|
86
|
+
svg {
|
|
87
|
+
color: var(--comparison-top-features-icon-color);
|
|
88
|
+
margin-right: 0.93rem;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
.banking {
|
|
93
|
+
@include flex-direction(column);
|
|
94
|
+
@include flex-align(center, center);
|
|
95
|
+
p {
|
|
96
|
+
width: 100%;
|
|
97
|
+
@include flex-align(center, space-between);
|
|
98
|
+
font-weight: 500;
|
|
99
|
+
font-size: 1.4rem;
|
|
100
|
+
line-height: 2.4rem;
|
|
101
|
+
margin-bottom: 1rem;
|
|
102
|
+
span {
|
|
103
|
+
font-weight: bold;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.currencies {
|
|
108
|
+
span {
|
|
109
|
+
margin-left: 0.4rem;
|
|
110
|
+
background: var(--comparison-currencies-background-color);
|
|
111
|
+
color: var(--comparison-currencies-text-color);
|
|
112
|
+
border-radius: 2px;
|
|
113
|
+
padding: 0.3rem 0.79rem;
|
|
114
|
+
font-weight: bold;
|
|
115
|
+
font-size: 12px;
|
|
116
|
+
line-height: 18px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
.paymentMethods {
|
|
120
|
+
display: grid;
|
|
121
|
+
grid-template-columns: repeat(3, 1fr);
|
|
122
|
+
span {
|
|
123
|
+
@include flex-direction(row);
|
|
124
|
+
@include flex-align(center, center);
|
|
125
|
+
font-weight: bold;
|
|
126
|
+
font-size: 14px;
|
|
127
|
+
line-height: 18px;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.licenses {
|
|
132
|
+
img {
|
|
133
|
+
max-height: 3.2rem;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint-disable array-callback-return */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { render, cleanup } from '@testing-library/react';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import { getSampleOperatorCards } from 'gatsby-core-theme/tests/factories/modules/card.factory';
|
|
6
|
+
|
|
7
|
+
import ComparisonTable from '.';
|
|
8
|
+
|
|
9
|
+
const module = getSampleOperatorCards();
|
|
10
|
+
|
|
11
|
+
describe('Comparison table test component', () => {
|
|
12
|
+
test('render', () => {
|
|
13
|
+
const { getByText } = render(<ComparisonTable items={module.items} />);
|
|
14
|
+
|
|
15
|
+
module.items.map((item) => {
|
|
16
|
+
expect(getByText(item.title));
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
cleanup();
|
|
22
|
+
});
|
|
@@ -14,8 +14,11 @@ const CasinosTable = ({ module }) => {
|
|
|
14
14
|
const [firstLine, secondLine] = one_liner.split('+');
|
|
15
15
|
return (
|
|
16
16
|
<>
|
|
17
|
-
<span className={styles.firstLine}>
|
|
18
|
-
|
|
17
|
+
<span className={styles.firstLine}>
|
|
18
|
+
{firstLine}
|
|
19
|
+
<br />
|
|
20
|
+
</span>
|
|
21
|
+
{secondLine && <span className={styles.secondLine}>{`+${secondLine}`}</span>}
|
|
19
22
|
</>
|
|
20
23
|
);
|
|
21
24
|
};
|
|
@@ -23,7 +23,7 @@ const PopupCard = ({ item, tracker }) => {
|
|
|
23
23
|
</div>
|
|
24
24
|
<div className={styles.textContainer}>
|
|
25
25
|
<p className={styles.primaryText}>{one}</p>
|
|
26
|
-
<p className={styles.secondaryText}>{second}</p>
|
|
26
|
+
<p className={styles.secondaryText}>{`+${second}`}</p>
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
<div className={styles.buttonContainer}>
|
|
@@ -17,7 +17,7 @@ describe('toplist row component', () => {
|
|
|
17
17
|
|
|
18
18
|
// Bonus
|
|
19
19
|
expect(getByText('€100 welcome bonus')).toBeTruthy();
|
|
20
|
-
expect(getByText('150 free spins')).toBeTruthy();
|
|
20
|
+
expect(getByText('+150 free spins')).toBeTruthy();
|
|
21
21
|
|
|
22
22
|
// Rating & Logo
|
|
23
23
|
// expect(container.querySelector('img')).toBeFalsy();
|
|
@@ -47,7 +47,7 @@ describe('toplist row component', () => {
|
|
|
47
47
|
|
|
48
48
|
// Bonus
|
|
49
49
|
expect(getByText('€100 welcome bonus')).toBeTruthy();
|
|
50
|
-
expect(getByText('150 free spins')).toBeTruthy();
|
|
50
|
+
expect(getByText('+150 free spins')).toBeTruthy();
|
|
51
51
|
|
|
52
52
|
// Rating & Logo
|
|
53
53
|
// expect(container.querySelector('img')).toBeFalsy();
|
|
@@ -99,8 +99,9 @@ const Popup = ({ module, isStorybook = false }) => {
|
|
|
99
99
|
<MdClose />
|
|
100
100
|
</button>
|
|
101
101
|
</div>
|
|
102
|
-
{shownItems?.map((item) => (
|
|
103
|
-
|
|
102
|
+
{shownItems?.map((item, index) => (
|
|
103
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
104
|
+
<PopupCard key={index} item={item} tracker={tracker} />
|
|
104
105
|
))}
|
|
105
106
|
</div>
|
|
106
107
|
</div>
|
|
@@ -111,7 +112,7 @@ const Popup = ({ module, isStorybook = false }) => {
|
|
|
111
112
|
|
|
112
113
|
Popup.propTypes = {
|
|
113
114
|
module: PropTypes.shape({
|
|
114
|
-
items: PropTypes.arrayOf(
|
|
115
|
+
items: PropTypes.arrayOf(PropTypes.object),
|
|
115
116
|
style: PropTypes.string,
|
|
116
117
|
}).isRequired,
|
|
117
118
|
isStorybook: PropTypes.bool,
|
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
|
-
import loadable from '@loadable/component';
|
|
5
4
|
import keygen from '~helpers/keygen';
|
|
6
5
|
import List from './list';
|
|
7
6
|
import Tabs from '~hooks/tabs';
|
|
8
7
|
import Row from '../../molecules/toplist/row/variant-one';
|
|
9
8
|
|
|
9
|
+
// eslint-disable-next-line no-unused-vars
|
|
10
10
|
const TopList = ({ module, toplistHeading, CustomRow, page }) => {
|
|
11
11
|
const template = page?.template;
|
|
12
|
-
const ComparisonTable =
|
|
13
|
-
module?.style === 'comparison_table' ? loadable(() => import('./comparison-table')) : null;
|
|
14
12
|
|
|
15
|
-
return
|
|
16
|
-
<ComparisonTable
|
|
17
|
-
module={module}
|
|
18
|
-
toplistHeading={toplistHeading}
|
|
19
|
-
CustomRow={CustomRow}
|
|
20
|
-
page={page}
|
|
21
|
-
/>
|
|
22
|
-
) : (
|
|
13
|
+
return (
|
|
23
14
|
<Tabs title={module.title} module={module} tabsAlign="right" gtmClass="toplist-tabs-menu-gtm">
|
|
24
15
|
{module.items.map((toplist) => (
|
|
25
16
|
<div label={toplist.title} key={keygen()}>
|
|
@@ -10,7 +10,6 @@ describe('Bonus Component', () => {
|
|
|
10
10
|
const item = getToplistItem();
|
|
11
11
|
const { getByText } = render(<Bonus item={item} tracker="main" />);
|
|
12
12
|
expect(getByText('€100 welcome bonus')).toBeTruthy();
|
|
13
|
-
expect(getByText('150 free spins')).toBeTruthy();
|
|
14
13
|
});
|
|
15
14
|
test('without oneLiner', () => {
|
|
16
15
|
const { container } = render(
|
|
@@ -22,7 +22,7 @@ export default function Bonus({ item, tracker }) {
|
|
|
22
22
|
return (
|
|
23
23
|
<div className={styles.bonus}>
|
|
24
24
|
{!isInoperative && <div className={styles.title}>{mainLine && mainLine}</div>}
|
|
25
|
-
{!isInoperative && <div className={styles.desc}>{secondLine && secondLine}</div>}
|
|
25
|
+
{!isInoperative && <div className={styles.desc}>{secondLine && `+${secondLine}`}</div>}
|
|
26
26
|
</div>
|
|
27
27
|
);
|
|
28
28
|
}
|