gatsby-matrix-theme 3.0.10 → 3.2.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +91 -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 +114 -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 +61 -0
  10. package/src/components/atoms/cards/operators-table/table.module.scss +87 -0
  11. package/src/components/atoms/cards/popup-card/index.js +1 -1
  12. package/src/components/molecules/toplist/row/variant-one.test.js +2 -2
  13. package/src/components/organisms/popup/index.js +4 -3
  14. package/src/components/organisms/toplist/index.js +2 -11
  15. package/src/gatsby-core-theme/components/atoms/bonus/bonus.test.js +0 -1
  16. package/src/gatsby-core-theme/components/atoms/bonus/index.js +1 -1
  17. package/src/gatsby-core-theme/components/atoms/spotlights/spotlights.module.scss +78 -108
  18. package/src/gatsby-core-theme/components/molecules/content/index.js +6 -0
  19. package/src/gatsby-core-theme/components/molecules/footer/index.js +5 -7
  20. package/src/gatsby-core-theme/components/molecules/module/index.js +9 -1
  21. package/src/gatsby-core-theme/components/organisms/carousel/carousel.module.scss +26 -2
  22. package/src/gatsby-core-theme/components/organisms/head/index.js +52 -34
  23. package/src/gatsby-core-theme/styles/utils/variables/_main.scss +16 -0
  24. package/src/helpers/strings.js +40 -29
  25. package/storybook/public/{0.3d8cbeeb.iframe.bundle.js → 0.1be55b0d.iframe.bundle.js} +1 -1
  26. package/storybook/public/{1.d529c1ee.iframe.bundle.js → 1.318fc035.iframe.bundle.js} +1 -1
  27. package/storybook/public/{10.cea4ee5b.iframe.bundle.js → 10.ff8f20a0.iframe.bundle.js} +1 -1
  28. package/storybook/public/{11.754b00b3.iframe.bundle.js → 11.a965ed36.iframe.bundle.js} +1 -1
  29. package/storybook/public/{12.8a1881b8.iframe.bundle.js → 12.f31f86bb.iframe.bundle.js} +1 -1
  30. package/storybook/public/{13.38f19c6d.iframe.bundle.js → 13.c72a573a.iframe.bundle.js} +1 -1
  31. package/storybook/public/{14.40f89dec.iframe.bundle.js → 14.454a253c.iframe.bundle.js} +1 -1
  32. package/storybook/public/{15.ff9ffc19.iframe.bundle.js → 15.baadf857.iframe.bundle.js} +1 -1
  33. package/storybook/public/{16.dc8af8aa.iframe.bundle.js → 16.9d6c22db.iframe.bundle.js} +1 -1
  34. package/storybook/public/{5.2ab0bd17.iframe.bundle.js → 5.3751341c.iframe.bundle.js} +3 -3
  35. package/storybook/public/{5.2ab0bd17.iframe.bundle.js.LICENSE.txt → 5.3751341c.iframe.bundle.js.LICENSE.txt} +0 -0
  36. package/storybook/public/5.3751341c.iframe.bundle.js.map +1 -0
  37. package/storybook/public/{6.c5ba0afd.iframe.bundle.js → 6.9025e607.iframe.bundle.js} +1 -1
  38. package/storybook/public/7.d2ff48a2.iframe.bundle.js +1 -0
  39. package/storybook/public/{8.e3bb3545.iframe.bundle.js → 8.88be3011.iframe.bundle.js} +1 -1
  40. package/storybook/public/{9.a7474f26.iframe.bundle.js → 9.a1a96ae4.iframe.bundle.js} +3 -3
  41. package/storybook/public/{9.a7474f26.iframe.bundle.js.LICENSE.txt → 9.a1a96ae4.iframe.bundle.js.LICENSE.txt} +0 -0
  42. package/storybook/public/9.a1a96ae4.iframe.bundle.js.map +1 -0
  43. package/storybook/public/iframe.html +1 -1
  44. package/storybook/public/main.e39e4b91.iframe.bundle.js +1 -0
  45. package/storybook/public/{runtime~main.e42f049a.iframe.bundle.js → runtime~main.44164ddf.iframe.bundle.js} +1 -1
  46. package/storybook/public/vendors~main.dc143446.iframe.bundle.js +7 -0
  47. package/storybook/public/{vendors~main.fce7a779.iframe.bundle.js.LICENSE.txt → vendors~main.dc143446.iframe.bundle.js.LICENSE.txt} +0 -0
  48. package/storybook/public/vendors~main.dc143446.iframe.bundle.js.map +1 -0
  49. package/src/components/organisms/toplist/comparison-table/comparison-table.module.scss +0 -52
  50. package/src/components/organisms/toplist/comparison-table/index.js +0 -165
  51. package/src/gatsby-core-theme/components/atoms/spotlights/index.js +0 -185
  52. package/storybook/public/5.2ab0bd17.iframe.bundle.js.map +0 -1
  53. package/storybook/public/7.3af39400.iframe.bundle.js +0 -1
  54. package/storybook/public/9.a7474f26.iframe.bundle.js.map +0 -1
  55. package/storybook/public/main.94d6f05d.iframe.bundle.js +0 -1
  56. package/storybook/public/vendors~main.fce7a779.iframe.bundle.js +0 -7
  57. package/storybook/public/vendors~main.fce7a779.iframe.bundle.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,94 @@
1
+ # [3.2.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.1.2...v3.2.0) (2022-01-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add storybook and fix some style issue ([40db75b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/40db75b3d61109ab835053ff8ca9fa52a9625cbc))
7
+ * added scss vars for comparison table and minor fixes ([fe23268](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fe23268f258709c0f43742261fb152d506e7a48e))
8
+ * fixed name and style also added the deposit method ([b075d1e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b075d1ed2ffcfafc27860a6cdde653866ac24929))
9
+ * second line fix ([ede14f5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ede14f52526d6d09ae415c164d7fa0c0fc13e4f6))
10
+
11
+
12
+ ### Config
13
+
14
+ * updated core version ([bfbdce6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/bfbdce6a196a09cd5ee6befccb3fd36900306a41))
15
+
16
+
17
+ * Merge branch 'STK-2585-Casino-comparison-module' into 'master' ([9376eb2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9376eb220a8b99a175667ea4f1308c498ae0a2e6))
18
+ * Merge branch 'master' into STK-2585-Casino-comparison-module ([b3c2149](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b3c2149636ae1e46bb96b6843ea2ea7333b90d6c))
19
+
20
+
21
+ ### Features
22
+
23
+ * add the comparison table ([7decb55](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7decb557e543b7307dad0edc78677158bdfb7ced))
24
+
25
+ ## [3.1.2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.1.1...v3.1.2) (2021-12-23)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * operator bonus added dividor ([98538a9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/98538a94160ef27a2a4d33334f8534aa6baff32e))
31
+ * fixed parsing metadescription ([f3f7568](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/f3f75682e88341ebc90f3f532594e4a816605fc9))
32
+ * new testimonials styling ([7f16177](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7f1617700a339d7e0edd183769b040fb9a419255))
33
+ * removed an useless line ([6320358](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/63203585e3ee6362f1250033b0b41a1180f61ad2))
34
+ * tests ([0d2794f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0d2794feb4f5a93eb08f40c1776330a25aed0850))
35
+
36
+
37
+ ### Config
38
+
39
+ * updated core theme version ([8ead1a7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8ead1a7c4fec1a4f30acced891b9eaa262d2c104))
40
+
41
+
42
+ * Merge branch 'tm-2629-spotlight-testimonials' into 'master' ([52f20ab](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/52f20abf60df594d49e7eac3c4a5a099e7c2842a))
43
+ * Merge branch 'tm-2610-operator-bonus' into 'master' ([8c80938](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8c80938101df09f25d6458c423f4eaf09e8da5ca))
44
+ * Merge branch 'fix-parse-metadescription' into 'master' ([fbed07c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fbed07cb84ba1d34a296ebc5cbf059eadfecdd72))
45
+
46
+ ## [3.1.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.1.0...v3.1.1) (2021-12-17)
47
+
48
+
49
+ ### Config
50
+
51
+ * updated theme version ([d35a8d2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d35a8d258252b7376968683cd5fc65af089923eb))
52
+
53
+
54
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/matrix-theme ([ec89a34](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ec89a340a0c73ed3261f0b5d9eff2b33254dc35c))
55
+
56
+ # [3.1.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.0.10...v3.1.0) (2021-12-17)
57
+
58
+
59
+ ### Bug Fixes
60
+
61
+ * add default copyright_disclaimer ([f0c330f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/f0c330fc779e79be0e6a7bab17cd54989e3e93de))
62
+ * carousel slides ([ae7dea9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ae7dea9a0025daca522572efbd6ce27b5c7d3a0a))
63
+ * casino table ([2d0b8ec](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2d0b8ec4cd2e18fc9a21d1b17dcf1c529ac03aab))
64
+ * fixed bonus issue and loadable condition ([7f1f1a7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7f1f1a7d6e467da005b60a8806056280fad671e7))
65
+ * fixed copyrightDisclaimer ([1a606d2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1a606d2990c3883e2a3f0541d369e52dd93457f4))
66
+ * merge ([14a32ab](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/14a32ab72c7c430e3619755433d5a92a79fe742c))
67
+ * merged master ([5a983ab](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5a983ab64013fe9029d99eea3223ecb2c4145a1b))
68
+ * progress made ([55c3175](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/55c3175b5e827a2d1c3d1b33cb44ff3ca3b23379))
69
+ * remove re-declared copyrightDisclaimer ([598ac18](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/598ac182d54e7a62e638ccfe42cda809f899ffc7))
70
+ * small fix ([9d8c24d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9d8c24dc18245c6b07c658afce398ddf55802cec))
71
+ * small fix ([a9341ad](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a9341ad547865d2a154c98d55d12c78bd09f5982))
72
+ * spotlight images ([8daaf46](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8daaf460f49bafdda908899ae37fe8ff992befe2))
73
+ * spotlight images ([fa886b6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fa886b6cbe2aa31992a415828f21f2927d5d8c97))
74
+ * style issues ([2881939](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/28819392bbfec1ffa64739b42cb9dfc367ef7f82))
75
+ * updated core theme version and fixed disclaimer text bug ([3ce75e2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3ce75e2c58812fef1ee3177c200a5268a5763f78))
76
+
77
+
78
+ ### Code Refactoring
79
+
80
+ * check the data ([dd25ece](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/dd25ece863cd5956663ab47a34dde6eca5ded85a))
81
+
82
+
83
+ * Merge branch 'tm-2613-carousel-fix' into 'master' ([bdf02e8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/bdf02e8b330e9923437ae8a1c68568ce19c2c181))
84
+ * Merge branch 'tm-2597-casino-table' into 'master' ([6861c37](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6861c37c160aab7426288b8b4f40b3b8eabad3cf))
85
+ * Update index.js ([056c9bd](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/056c9bddb0d7e63d0fbe8538968933c4d69d99b8))
86
+
87
+
88
+ ### Features
89
+
90
+ * twitter graph ([dfdf8bf](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/dfdf8bfe5e9ff07a20b25f2c5f659126767dcffb))
91
+
1
92
  ## [3.0.10](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.0.9...v3.0.10) (2021-12-10)
2
93
 
3
94
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "3.0.10",
3
+ "version": "3.2.0",
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": "^1.6.22",
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}>
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} color="#FF893F" /> {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,114 @@
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
+ }
19
+ }
20
+
21
+ th {
22
+ @include flex-align(center, center);
23
+ background-color: var(--header-background-color);
24
+ border: 1px solid var(--header-border-color);
25
+ box-sizing: border-box;
26
+ color: var(--header-text-color);
27
+
28
+ @include min(laptop) {
29
+ position: sticky;
30
+ z-index: 1;
31
+ left: 0;
32
+ }
33
+ }
34
+ td {
35
+ border: 1px solid var(--body-border-color);
36
+ background-color: var(--body-background-color);
37
+ box-sizing: border-box;
38
+ padding: 1.6rem;
39
+ }
40
+ .casinoName {
41
+ @include flex-direction(row);
42
+ @include flex-align(center, center);
43
+ padding: 1.6rem;
44
+ img {
45
+ border: 1px solid var(--color-9);
46
+ box-sizing: border-box;
47
+ margin-right: 1.6rem;
48
+ }
49
+ span {
50
+ font-weight: bold;
51
+ font-size: 18px;
52
+ line-height: 25px;
53
+ }
54
+ }
55
+ .raiting {
56
+ @include flex-align(center, space-between);
57
+ }
58
+ .topFeatures {
59
+ @include flex-direction(column);
60
+ @include flex-align(flex-start, center);
61
+ span {
62
+ @include flex-direction(row);
63
+ @include flex-align(center, center);
64
+ margin-bottom: 0.8rem;
65
+ svg {
66
+ margin-right: 0.93rem;
67
+ }
68
+ }
69
+ }
70
+ .banking {
71
+ @include flex-direction(column);
72
+ @include flex-align(center, center);
73
+ p {
74
+ width: 100%;
75
+ @include flex-align(center, space-between);
76
+ font-weight: 500;
77
+ font-size: 16px;
78
+ line-height: 24px;
79
+ margin-bottom: 1rem;
80
+ span {
81
+ font-weight: bold;
82
+ }
83
+ }
84
+ }
85
+ .currencies {
86
+ span {
87
+ margin-left: 0.4rem;
88
+ background: var(--color-9);
89
+ border-radius: 2px;
90
+ padding: 0.3rem 0.79rem;
91
+ font-weight: bold;
92
+ font-size: 12px;
93
+ line-height: 18px;
94
+ }
95
+ }
96
+ .paymentMethods {
97
+ display: grid;
98
+ grid-template-columns: repeat(3, 1fr);
99
+ span {
100
+ @include flex-direction(row);
101
+ @include flex-align(center, center);
102
+ font-weight: bold;
103
+ font-size: 14px;
104
+ line-height: 18px;
105
+ }
106
+ }
107
+
108
+ .licenses {
109
+ img {
110
+ max-height: 3.2rem;
111
+ }
112
+ }
113
+ }
114
+ }
@@ -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
+ });
@@ -0,0 +1,61 @@
1
+ /* eslint-disable camelcase */
2
+ import React, { useContext } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import Link from 'gatsby-core-theme/src/hooks/link';
5
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
6
+ import { translate, getBonus } from 'gatsby-core-theme/src/helpers/getters';
7
+ import styles from './table.module.scss';
8
+
9
+ const CasinosTable = ({ module }) => {
10
+ const { translations } = useContext(Context);
11
+ const { items } = module || {};
12
+
13
+ const oneLiner = ({ one_liner }) => {
14
+ const [firstLine, secondLine] = one_liner.split('+');
15
+ return (
16
+ <>
17
+ <span className={styles.firstLine}>
18
+ {firstLine}
19
+ <br />
20
+ </span>
21
+ {secondLine && <span className={styles.secondLine}>{`+${secondLine}`}</span>}
22
+ </>
23
+ );
24
+ };
25
+
26
+ return (
27
+ <div className={styles.container}>
28
+ <table>
29
+ <thead>
30
+ <tr>
31
+ <th>{`${translate(translations, 'casino', 'Casino')}`}</th>
32
+ <th>{`${translate(translations, 'bonus', 'Bonus')}`}</th>
33
+ <th>{`${translate(translations, 'visit_casino', 'Visit casino')}`}</th>
34
+ </tr>
35
+ </thead>
36
+ <tbody>
37
+ {items &&
38
+ items.map((item) => (
39
+ <tr>
40
+ <td>{item.title}</td>
41
+ <td>{oneLiner(getBonus('main', item?.relation))}</td>
42
+ <td>
43
+ <Link to={item?.path} name={item?.relation?.name}>
44
+ {`${item?.relation?.name} ${translate(translations, 'read_review', 'Review')}`}
45
+ </Link>
46
+ </td>
47
+ </tr>
48
+ ))}
49
+ </tbody>
50
+ </table>
51
+ </div>
52
+ );
53
+ };
54
+
55
+ export default CasinosTable;
56
+
57
+ CasinosTable.propTypes = {
58
+ module: PropTypes.shape({
59
+ items: PropTypes.arrayOf({}),
60
+ }).isRequired,
61
+ };