gatsby-matrix-theme 3.1.2 → 3.2.3

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/package.json +2 -2
  3. package/src/components/atoms/cards/comparison-table/comparison-table.module.scss +27 -0
  4. package/src/components/atoms/cards/comparison-table/comparison-table.stories.js +39 -0
  5. package/src/components/atoms/cards/comparison-table/index.js +57 -0
  6. package/src/components/atoms/cards/comparison-table/table/index.js +196 -0
  7. package/src/components/atoms/cards/comparison-table/table/table.module.scss +137 -0
  8. package/src/components/atoms/cards/comparison-table/table/table.test.js +22 -0
  9. package/src/components/atoms/cards/operators-table/index.js +5 -2
  10. package/src/components/organisms/toplist/index.js +2 -11
  11. package/src/gatsby-core-theme/components/molecules/module/index.js +4 -0
  12. package/src/gatsby-core-theme/styles/utils/variables/_main.scss +10 -1
  13. package/storybook/public/{0.1ef33c54.iframe.bundle.js → 0.4c2881f4.iframe.bundle.js} +1 -1
  14. package/storybook/public/{1.d02d8599.iframe.bundle.js → 1.318fc035.iframe.bundle.js} +1 -1
  15. package/storybook/public/{10.ae38b8e6.iframe.bundle.js → 10.ff8f20a0.iframe.bundle.js} +1 -1
  16. package/storybook/public/{11.86382beb.iframe.bundle.js → 11.a965ed36.iframe.bundle.js} +1 -1
  17. package/storybook/public/{12.b6909189.iframe.bundle.js → 12.f31f86bb.iframe.bundle.js} +1 -1
  18. package/storybook/public/{13.9e6703fb.iframe.bundle.js → 13.c72a573a.iframe.bundle.js} +1 -1
  19. package/storybook/public/{14.b0c67bdf.iframe.bundle.js → 14.454a253c.iframe.bundle.js} +1 -1
  20. package/storybook/public/{15.7bb7d301.iframe.bundle.js → 15.baadf857.iframe.bundle.js} +1 -1
  21. package/storybook/public/{16.d64c7fd7.iframe.bundle.js → 16.9d6c22db.iframe.bundle.js} +1 -1
  22. package/storybook/public/{5.91c30f08.iframe.bundle.js → 5.3751341c.iframe.bundle.js} +3 -3
  23. package/storybook/public/{5.91c30f08.iframe.bundle.js.LICENSE.txt → 5.3751341c.iframe.bundle.js.LICENSE.txt} +0 -0
  24. package/storybook/public/5.3751341c.iframe.bundle.js.map +1 -0
  25. package/storybook/public/{6.002e2a71.iframe.bundle.js → 6.78854fa8.iframe.bundle.js} +1 -1
  26. package/storybook/public/{7.d12dd5b3.iframe.bundle.js → 7.7dfb34cd.iframe.bundle.js} +1 -1
  27. package/storybook/public/{8.c5053ebc.iframe.bundle.js → 8.88be3011.iframe.bundle.js} +1 -1
  28. package/storybook/public/{9.05a986eb.iframe.bundle.js → 9.c2b37d15.iframe.bundle.js} +3 -3
  29. package/storybook/public/{9.05a986eb.iframe.bundle.js.LICENSE.txt → 9.c2b37d15.iframe.bundle.js.LICENSE.txt} +0 -0
  30. package/storybook/public/9.c2b37d15.iframe.bundle.js.map +1 -0
  31. package/storybook/public/iframe.html +1 -1
  32. package/storybook/public/main.30a5eba0.iframe.bundle.js +1 -0
  33. package/storybook/public/{runtime~main.5a919f90.iframe.bundle.js → runtime~main.0dbefcaa.iframe.bundle.js} +1 -1
  34. package/storybook/public/vendors~main.c173cb22.iframe.bundle.js +7 -0
  35. package/storybook/public/{vendors~main.145aeafa.iframe.bundle.js.LICENSE.txt → vendors~main.c173cb22.iframe.bundle.js.LICENSE.txt} +0 -0
  36. package/storybook/public/vendors~main.c173cb22.iframe.bundle.js.map +1 -0
  37. package/src/components/organisms/toplist/comparison-table/comparison-table.module.scss +0 -52
  38. package/src/components/organisms/toplist/comparison-table/index.js +0 -165
  39. package/storybook/public/5.91c30f08.iframe.bundle.js.map +0 -1
  40. package/storybook/public/9.05a986eb.iframe.bundle.js.map +0 -1
  41. package/storybook/public/main.c8da7880.iframe.bundle.js +0 -1
  42. package/storybook/public/vendors~main.145aeafa.iframe.bundle.js +0 -7
  43. package/storybook/public/vendors~main.145aeafa.iframe.bundle.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,54 @@
1
+ ## [3.2.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.2.2...v3.2.3) (2022-01-05)
2
+
3
+
4
+ ### Config
5
+
6
+ * updated core version ([5cebe61](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5cebe6189accfe433ff8a84503ec0bec3661754b))
7
+
8
+
9
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/matrix-theme ([ff21c73](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ff21c73f9778419cb5f60bf6e05b4660206ad001))
10
+
11
+ ## [3.2.2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.2.1...v3.2.2) (2022-01-04)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * comparison table styling ([8ced0c7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8ced0c7171c3afb95c66b4419ae050942c6c4dda))
17
+
18
+
19
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/matrix-theme ([1f875a4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1f875a475402a80d735f22fa27cbbfe2dcde681f))
20
+
21
+ ## [3.2.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.2.0...v3.2.1) (2022-01-04)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * comparison table configurations ([97d1bd6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/97d1bd6fb267ca43a251b9c748aee14244ee9f7e))
27
+
28
+ # [3.2.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.1.2...v3.2.0) (2022-01-03)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * add storybook and fix some style issue ([40db75b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/40db75b3d61109ab835053ff8ca9fa52a9625cbc))
34
+ * added scss vars for comparison table and minor fixes ([fe23268](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fe23268f258709c0f43742261fb152d506e7a48e))
35
+ * fixed name and style also added the deposit method ([b075d1e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b075d1ed2ffcfafc27860a6cdde653866ac24929))
36
+ * second line fix ([ede14f5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ede14f52526d6d09ae415c164d7fa0c0fc13e4f6))
37
+
38
+
39
+ ### Config
40
+
41
+ * updated core version ([bfbdce6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/bfbdce6a196a09cd5ee6befccb3fd36900306a41))
42
+
43
+
44
+ * Merge branch 'STK-2585-Casino-comparison-module' into 'master' ([9376eb2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9376eb220a8b99a175667ea4f1308c498ae0a2e6))
45
+ * Merge branch 'master' into STK-2585-Casino-comparison-module ([b3c2149](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b3c2149636ae1e46bb96b6843ea2ea7333b90d6c))
46
+
47
+
48
+ ### Features
49
+
50
+ * add the comparison table ([7decb55](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7decb557e543b7307dad0edc78677158bdfb7ced))
51
+
1
52
  ## [3.1.2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.1.1...v3.1.2) (2021-12-23)
2
53
 
3
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "3.1.2",
3
+ "version": "3.2.3",
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.7",
34
+ "gatsby-core-theme": "^2.0.13",
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 className={styles.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}>{firstLine}<br /></span>
18
- <span className={styles.secondLine}>{`+${secondLine}`}</span>
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
  };
@@ -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 ComparisonTable ? (
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()}>
@@ -27,6 +27,10 @@ const Modules = ({ module, page, pageContext }) => {
27
27
  if (moduleItem.style === 'stack_table' && moduleItem.cards_page_type === 'operator') {
28
28
  return loadable(() => import('../../../../components/atoms/cards/operators-table'));
29
29
  }
30
+ if (moduleItem.style === 'comparison_table' && moduleItem.cards_page_type === 'operator') {
31
+ return loadable(() => import('../../../../components/atoms/cards/comparison-table'));
32
+ }
33
+
30
34
  return loadable(() => import('../../organisms/cards'));
31
35
  case 'pros_and_cons':
32
36
  return loadable(() => import('gatsby-core-theme/src/components/molecules/pros-cons'));
@@ -73,5 +73,14 @@
73
73
  --page-number-color: #fff;
74
74
  --sitemap-background-color: #fff;
75
75
 
76
-
76
+ // Comparison Table
77
+ --comparison-header-border-color: #D0C0AD;
78
+ --comparison-header-text-color: #171F49;
79
+ --comparison-header-background-color: #F9F6F3;
80
+ --comparison-body-border-color: #F3F2F2;
81
+ --comparison-body-background-color: #ffffff;
82
+ --comparison-top-features-icon-color: #04D68B;
83
+ --comparison-currencies-text-color: #000;
84
+ --comparison-currencies-background-color: #fff;
85
+ --comparison-header-text-transform: uppercase;
77
86
  }