gatsby-matrix-theme 35.0.6 → 36.0.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 (27) hide show
  1. package/.storybook/preview.js +1 -0
  2. package/CHANGELOG.md +19 -0
  3. package/package.json +1 -1
  4. package/src/components/molecules/operator-details/index.js +1 -1
  5. package/src/components/molecules/toplist/row/variant-one.js +29 -9
  6. package/src/components/molecules/toplist/row/variant-one.module.scss +58 -157
  7. package/src/components/molecules/toplist/row/variant-one.stories.js +130 -0
  8. package/src/components/molecules/toplist/row/variant-one.test.js +4 -5
  9. package/src/gatsby-core-theme/components/molecules/tnc/tnc.module.scss +22 -25
  10. package/src/gatsby-core-theme/components/organisms/toplist/index.js +6 -7
  11. package/src/gatsby-core-theme/components/organisms/toplist/list/index.js +26 -31
  12. package/src/gatsby-core-theme/components/organisms/toplist/list/list.module.scss +0 -2
  13. package/src/gatsby-core-theme/components/organisms/toplist/list/template-one.module.scss +3 -0
  14. package/src/gatsby-core-theme/components/organisms/toplist/list/template-two.module.scss +24 -0
  15. package/src/gatsby-core-theme/components/organisms/toplist/toplist.stories.js +94 -0
  16. package/src/gatsby-core-theme/hooks/tabs/title/index.js +1 -1
  17. package/storybook/public/263.d26badb6.iframe.bundle.js +1 -0
  18. package/storybook/public/{487.3b92b087.iframe.bundle.js → 487.3b85849c.iframe.bundle.js} +3 -3
  19. package/storybook/public/{487.3b92b087.iframe.bundle.js.map → 487.3b85849c.iframe.bundle.js.map} +1 -1
  20. package/storybook/public/iframe.html +1 -1
  21. package/storybook/public/main.66dd33ac.iframe.bundle.js +2 -0
  22. package/storybook/public/runtime~main.e8ac6bf5.iframe.bundle.js +1 -0
  23. package/tests/factories/modules/toplist.factory.js +1179 -15
  24. package/storybook/public/main.828e3579.iframe.bundle.js +0 -2
  25. package/storybook/public/runtime~main.445065e1.iframe.bundle.js +0 -1
  26. /package/storybook/public/{487.3b92b087.iframe.bundle.js.LICENSE.txt → 487.3b85849c.iframe.bundle.js.LICENSE.txt} +0 -0
  27. /package/storybook/public/{main.828e3579.iframe.bundle.js.LICENSE.txt → main.66dd33ac.iframe.bundle.js.LICENSE.txt} +0 -0
@@ -44,6 +44,7 @@ export const parameters = {
44
44
  'Modules',
45
45
  [
46
46
  'Anchor',
47
+ 'Toplist',
47
48
  'Cards',
48
49
  [
49
50
  'Game',
package/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ # [36.0.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v35.0.6...v36.0.0) (2023-11-08)
2
+
3
+
4
+ ### Code Refactoring
5
+
6
+ * add storybook ([6fd83b6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6fd83b61ed90f6563e3bb0da790370667ee8664d))
7
+ * changes to toplist ([e5e4cc5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e5e4cc5287b488791db4ca568df1895e986ef4a5))
8
+ * style changes ([34d11b9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/34d11b943a6db6e145078466975b068916c6361b))
9
+ * toplist changes ([5cbd4db](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5cbd4db57cf8e7a8133999a2f2f1cdc89b49fb26))
10
+
11
+
12
+ * Merge branch 'tm-3691-toplist-1' into 'master' ([7b73b20](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7b73b20a2a2fb541b5e47d7b4c55418f2ca8c0fc))
13
+ * Merge branch 'master' into tm-3691-toplist-1 ([189329d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/189329dbea8964fd4a160da9f5abdf58f571d6c2))
14
+
15
+
16
+ ### Tests
17
+
18
+ * fix test ([59fa022](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/59fa0226c2f5ba086b613054ea2369e62a76c608))
19
+
1
20
  ## [35.0.6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v35.0.5...v35.0.6) (2023-11-07)
2
21
 
3
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "35.0.6",
3
+ "version": "36.0.0",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -49,7 +49,7 @@ const OperatorDetails = ({
49
49
 
50
50
  const reviewPath = item?.review_link ? `/${item?.review_link}` : item?.path || null;
51
51
 
52
- const rating = item.rating || item?.relation?.rating;
52
+ const rating = item?.rating || item?.relation?.rating;
53
53
 
54
54
  const StarRating =
55
55
  // eslint-disable-next-line no-nested-ternary
@@ -21,6 +21,7 @@ export default function Row({
21
21
  showAuthor,
22
22
  useOneStarRating,
23
23
  template,
24
+ verifyIcon = '../../../../images/verifiedAuthor.svg',
24
25
  }) {
25
26
  const tandcEnabled = item?.extra_fields?.terms_and_conditions_text_enabled === '1';
26
27
  const sellingPoints = item.selling_points;
@@ -32,13 +33,10 @@ export default function Row({
32
33
  }
33
34
  };
34
35
 
35
- return (
36
- <li
37
- className={`${className || ''} ${styles?.row || ''} ${
38
- !tandcEnabled ? styles?.rowNoTandC || '' : ''
39
- }`}
40
- ref={(el) => addToRefs(el, index)}
41
- >
36
+ const firstRowItems = index === 0 || index === 1 || index === 2;
37
+
38
+ const Content = () => (
39
+ <>
42
40
  <CasinoDetails
43
41
  item={item}
44
42
  tracker={tracker}
@@ -47,9 +45,10 @@ export default function Row({
47
45
  showAuthor={showAuthor}
48
46
  useOneStarRating={useOneStarRating}
49
47
  costumeStyle={styles.operatorDetails}
50
- authorTemplateTwo={authorTemplateTwo}
48
+ authorTemplateTwo={!!(firstRowItems || authorTemplateTwo)}
51
49
  ribbons={ribbons}
52
50
  showRibbon
51
+ icon={verifyIcon}
53
52
  />
54
53
 
55
54
  <Bonus item={item} tracker={oneliner} />
@@ -62,8 +61,28 @@ export default function Row({
62
61
  gtmClass="toplist-operator-cta-gtm"
63
62
  pageTemplate={template}
64
63
  />
64
+ </>
65
+ );
65
66
 
66
- {tandcEnabled && <Tnc onlyMobile={layout === 'list'} operator={item} />}
67
+ return (
68
+ <li
69
+ className={`${className || ''} ${styles?.row || ''} ${
70
+ layout === 'grid' && firstRowItems ? styles.grid || '' : styles.list || ''
71
+ } ${!tandcEnabled ? styles?.rowNoTandC || '' : ''}`}
72
+ ref={(el) => addToRefs(el, index)}
73
+ >
74
+ {tandcEnabled ? (
75
+ <>
76
+ <div className={styles.container}>
77
+ <Content />
78
+ </div>
79
+ <div className={styles.tnc || ''}>
80
+ <Tnc isFixed hasCollapse={false} operator={item} />
81
+ </div>
82
+ </>
83
+ ) : (
84
+ <Content />
85
+ )}
67
86
  </li>
68
87
  );
69
88
  }
@@ -112,4 +131,5 @@ Row.propTypes = {
112
131
  }).isRequired,
113
132
  showAuthor: PropTypes.bool,
114
133
  useOneStarRating: PropTypes.bool,
134
+ verifyIcon: PropTypes.string,
115
135
  };
@@ -5,184 +5,85 @@
5
5
  text-align: center;
6
6
  @include flex-direction(column);
7
7
  @include flex-align(stretch, stretch);
8
- padding: 2.4rem;
9
- gap: 2.4rem;
10
8
  box-shadow: 0px 4px 4px -2px rgba(27, 27, 28, 0.04), 0px 6px 8px -2px rgba(27, 27, 28, 0.06);
11
9
 
12
- @include min(tablet) {
13
- display: grid;
14
- grid-template-columns: 1.5fr 1.5fr 1fr;
15
- column-gap: 2.4rem;
16
- text-align: inherit;
17
- row-gap: 2.4rem;
18
- }
19
-
20
- @include min(laptop) {
21
- grid-template-columns: 2.5fr 2fr 2fr 0.5fr;
22
- }
23
-
24
- > div {
25
- @include min(tablet) {
26
- @include flex-direction(column);
27
- grid-row: 1 / span 2;
28
- }
29
- @include min(laptop) {
30
- @include flex-direction(row);
31
- grid-row: 1;
10
+ a {
11
+ > span {
12
+ width: auto;
32
13
  }
33
14
  }
15
+ }
34
16
 
35
- ul {
36
- @include flex-align(center, center);
37
-
17
+ .list {
18
+ &.rowNoTandC,
19
+ > .container {
38
20
  @include min(tablet) {
39
- order: 3;
40
- padding-left: 3rem;
41
- grid-row: 1 / span 2;
42
- }
43
-
44
- @include min(laptop) {
45
- grid-row: 1;
46
- }
47
-
48
- @include min(desktop) {
49
- order: 3;
50
- }
51
-
52
- li {
53
- color: #150e06;
54
- text-align: left;
55
-
56
- &::before {
57
- top: 0.5rem;
21
+ grid-template-columns: 1.5fr 1.5fr 1fr;
22
+ text-align: inherit;
23
+ column-gap: 2.4rem;
24
+ row-gap: 2.4rem;
25
+ align-items: center;
26
+
27
+ ul {
28
+ grid-row: 1/span 2;
29
+ grid-column: 2;
30
+ padding-left: 3rem;
58
31
  }
59
32
  }
60
- }
61
-
62
- &.grid {
63
- border-radius: 1.2rem;
64
- padding: 2rem 2rem 0.5rem 2rem;
65
- text-align: center;
66
- min-height: 39rem;
67
-
33
+
68
34
  @include min(laptop) {
69
- grid-template-columns: 1fr;
70
- }
71
-
72
- @include min(tablet) {
73
- grid-template-columns: 1fr;
74
- }
75
-
76
- .numbers {
77
- position: absolute;
78
- text-align: center;
79
- width: 2.4rem;
80
- height: 2.4rem;
81
- background-color: var(--toplist-ranking-base-color);
82
- border-radius: 0.8rem 0 0.8rem 0;
83
- color: #fff;
84
- font-size: 1.4rem;
85
- line-height: 2.4rem;
86
- left: 0;
87
- top: 0;
88
-
89
- &.num_1 {
90
- background-color: var(--toplist-ranking-first-color);
91
- }
92
-
93
- &.num_2 {
94
- background-color: var(--toplist-ranking-second-color);
95
- }
96
-
97
- &.num_3 {
98
- background-color: var(--toplist-ranking-third-color);
35
+ grid-template-columns: 2.5fr 2fr 2fr 0.5fr;
36
+
37
+ ul {
38
+ grid-row: 1;
99
39
  }
100
40
  }
41
+ }
42
+ }
101
43
 
102
- .tandc {
103
- grid-column: 1;
104
- background: transparent;
105
- }
106
-
107
- .casinoDetails {
108
- padding-left: 0;
109
- height: 8.5rem;
110
-
111
- @include min(tablet) {
112
- @include flex-align(center, space-between);
113
- padding-left: 0;
114
- }
115
-
116
- > div {
117
- width: 80%;
118
- margin: 0 auto;
119
- }
120
- }
121
-
122
- .bonus {
123
- flex-direction: column !important;
124
- justify-content: flex-start;
125
- background: transparent;
126
- height: 9.3rem;
127
-
128
- @include min(tablet) {
129
- order: unset;
130
- grid-column: 1;
131
-
132
- > * {
133
- padding-right: 0 !important;
134
- }
135
- }
44
+ .rowNoTandC {
45
+ padding: 1.6rem;
46
+ gap: 2.4rem;
136
47
 
137
- a > div {
138
- width: 100%;
139
- text-align: center;
140
- @include flex-align(center, flex-start);
141
- flex-direction: column;
48
+ @include min(laptop) {
49
+ padding: 2.4rem;
50
+ }
51
+ }
142
52
 
143
- div:first-child {
144
- padding-right: 0 !important;
53
+ .grid {
54
+ @include flex-align(stretch, space-between);
55
+ @include min(tablet) {
56
+ display: flex !important;
57
+
58
+ > div {
59
+ > a {
60
+ > img {
61
+ width: 8.8rem;
62
+ height: 8.8rem;
145
63
  }
146
64
  }
147
65
  }
66
+ }
67
+ }
148
68
 
149
- .cta {
150
- @include flex-align(center, center);
151
- @include flex-direction(column);
152
-
153
- a:first-child {
154
- width: 90%;
155
- margin-top: 1rem;
156
- }
157
-
158
- a:nth-child(2) {
159
- padding-top: 1.5rem;
160
- display: inline-block;
161
- }
162
- }
69
+ .container {
70
+ padding: 1.6rem;
71
+ @include flex-direction(column);
72
+ @include flex-align(stretch, stretch);
73
+ gap: 2.4rem;
74
+ flex: 1;
163
75
 
164
- .pros {
165
- height: 6.25rem;
166
- }
76
+ @include min(tablet) {
77
+ display: grid;
167
78
  }
168
79
 
169
- > a:last-child {
170
- order: 4;
171
- @include flex-align(center, center);
172
-
173
- @include min(tablet) {
174
- grid-column: 3;
175
- grid-row: 2;
176
- }
177
-
178
- @include min(laptop) {
179
- grid-column: 4;
180
- grid-row: 1;
181
- align-self: center;
182
- }
80
+ @include min(laptop) {
81
+ padding: 2.4rem;
183
82
  }
184
83
  }
185
84
 
186
- .rowNoTandC {
187
- padding-bottom: 2.4rem;
188
- }
85
+ .tnc {
86
+ padding: 0.8rem 2.4rem;
87
+ background-color: #fafafa;
88
+ border-radius: 0px 0px 16px 16px;
89
+ }
@@ -0,0 +1,130 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ import React from 'react';
3
+ import {
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ Stories,
8
+ PRIMARY_STORY,
9
+ ArgsTable,
10
+ } from '@storybook/addon-docs/blocks';
11
+ import verifyIcon from '../../../../../storybook-images/verifiedAuthor.svg';
12
+ import { getToplistItem } from '../../../../../tests/factories/modules/toplist.factory';
13
+ import Row from './variant-one';
14
+
15
+ export default {
16
+ title: 'Theme/Modules/Toplist/Row/Variant One',
17
+ component: Row,
18
+ argTypes: {
19
+ item: {
20
+ name: 'item',
21
+ type: { name: 'object', required: true },
22
+ defaultValue: getToplistItem(),
23
+ description: 'toplist item',
24
+ },
25
+ tracker: {
26
+ name: 'tracker',
27
+ type: { name: 'string', required: false },
28
+ defaultValue: 'main',
29
+ description: 'tracker name',
30
+ },
31
+ oneliner: {
32
+ name: 'oneliner',
33
+ type: { name: 'string', required: false },
34
+ defaultValue: 'main',
35
+ description: 'oneliner name',
36
+ },
37
+ layout: {
38
+ name: 'layout',
39
+ type: { name: 'string', required: false },
40
+ defaultValue: 'list',
41
+ description: 'Layout for toplist (Check Theme > Modules > Toplist > Layout for differences)',
42
+ table: {
43
+ type: { summary: 'string' },
44
+ defaultValue: { summary: 'list' },
45
+ },
46
+ control: {
47
+ type: 'inline-radio',
48
+ options: ['list', 'grid'],
49
+ },
50
+ },
51
+ index: {
52
+ name: 'index',
53
+ type: { name: 'number', required: false },
54
+ defaultValue: 4,
55
+ description: 'Index of current item',
56
+ },
57
+ className: {
58
+ name: 'className',
59
+ type: { name: 'string', required: false },
60
+ defaultValue: '',
61
+ description: 'classes names passed from parent component',
62
+ },
63
+ itemRefs: {
64
+ name: 'itemRefs',
65
+ type: { name: 'string', required: false },
66
+ defaultValue: '',
67
+ description: 'itemRefs passed from parent component',
68
+ },
69
+ authorTemplateTwo: {
70
+ name: 'authorTemplateTwo',
71
+ type: { name: 'boolean', required: false },
72
+ defaultValue: false,
73
+ description: 'Show the correct author template',
74
+ },
75
+ showAuthor: {
76
+ name: 'showAuthor',
77
+ type: { name: 'boolean', required: false },
78
+ defaultValue: true,
79
+ description: 'Show/hide author data',
80
+ table: {
81
+ type: { summary: 'boolean' },
82
+ defaultValue: { summary: true },
83
+ },
84
+ },
85
+ useOneStarRating: {
86
+ name: 'useOneStarRating',
87
+ type: { name: 'boolean', required: false },
88
+ defaultValue: true,
89
+ description: 'Show/hide one star rating',
90
+ table: {
91
+ type: { summary: 'boolean' },
92
+ defaultValue: { summary: true },
93
+ },
94
+ },
95
+ template: {
96
+ name: 'template',
97
+ type: { name: 'string', required: false },
98
+ defaultValue: 'operator_review',
99
+ description: 'Page Template',
100
+ },
101
+ verifyIcon: {
102
+ name: 'verifyIcon',
103
+ type: { name: 'string', required: false },
104
+ defaultValue: verifyIcon,
105
+ description: 'Show the correct author',
106
+ },
107
+ },
108
+ parameters: {
109
+ docs: {
110
+ description: {
111
+ component:
112
+ 'List of casinos typically displaying bonus information, unique selling points and a CTA. Depending on the data received from Hercules, the toplist will display as a multi-toplist with tabs, single toplist, and/or with a load more button. The toplist rows are customizable, reusable and can even be displayed in grid style rather than rows.',
113
+ },
114
+ page: () => (
115
+ <>
116
+ <Title />
117
+ <Description />
118
+ <Primary />
119
+ <Stories />
120
+ <ArgsTable story={PRIMARY_STORY} />
121
+ </>
122
+ ),
123
+ },
124
+ },
125
+ };
126
+
127
+ const Template = (args) => <Row {...args} />;
128
+
129
+ export const Default = Template.bind({});
130
+ Default.args = {};
@@ -23,13 +23,12 @@ describe('toplist row component', () => {
23
23
  expect(container.querySelector('img')).toBeTruthy();
24
24
 
25
25
  // Selling Points
26
- expect(container.querySelectorAll('.sellingPoint li')).toHaveLength(3);
27
- expect(getByText('1')).toBeTruthy();
28
- expect(getByText('2')).toBeTruthy();
29
- expect(getByText('3')).toBeTruthy();
26
+ expect(container.querySelectorAll('.sellingPoint li')).toHaveLength(2);
27
+ expect(getByText('200% Bonus')).toBeTruthy();
28
+ expect(getByText('Nice design')).toBeTruthy();
30
29
 
31
30
  // CTA
32
- expect(getByText('Visit').closest('a').getAttribute('href')).toEqual('/shortName1');
31
+ expect(getByText('Visit').closest('a').getAttribute('href')).toEqual('/slotum');
33
32
  });
34
33
  });
35
34
  afterEach(() => {
@@ -1,33 +1,30 @@
1
1
  .isFixed {
2
2
  max-height: 45px;
3
3
  overflow-y: auto;
4
- text-align: center;
5
- }
4
+ padding-right: 1.6rem;
5
+ font-size: 1rem;
6
+ font-weight: 400;
7
+ line-height: 1.4rem;
8
+ color: #515156;
6
9
 
7
- .storybook {
8
- max-width: 34.3rem;
9
- margin: 0 auto;
10
-
11
- .isFixed {
12
- text-align: justify;
13
- padding-right: 1.6rem;
14
- max-height: 7.2rem;
15
-
16
- &::-webkit-scrollbar {
17
- -webkit-appearance: none;
18
- width: 0.4rem;
19
- }
10
+ a {
11
+ font-weight: 500;
12
+ color: #165af8;
13
+ }
20
14
 
21
- &::-webkit-scrollbar-thumb {
22
- border-radius: 2px;
23
- background-color: #6b6a72;
24
- }
15
+ &::-webkit-scrollbar {
16
+ -webkit-appearance: none;
17
+ width: 0.4rem;
18
+ }
25
19
 
26
- /* Track */
27
- &::-webkit-scrollbar-track {
28
- background: #e9e9e9;
29
- border-radius: 2px;
30
- }
20
+ &::-webkit-scrollbar-thumb {
21
+ border-radius: 2px;
22
+ background-color: #6b6a72;
31
23
  }
32
- }
33
24
 
25
+ /* Track */
26
+ &::-webkit-scrollbar-track {
27
+ background: #e9e9e9;
28
+ border-radius: 2px;
29
+ }
30
+ }
@@ -5,36 +5,35 @@ import PropTypes from 'prop-types';
5
5
  import loadable from '@loadable/component';
6
6
  import keygen from '~helpers/keygen';
7
7
  import List from './list';
8
- import Row from '../../../../components/molecules/toplist/row/variant-one';
9
8
  import styles from './toplist.module.scss';
10
9
 
11
10
  const TopList = ({
12
11
  module,
13
12
  toplistHeading,
14
- CustomRow = Row,
15
13
  page,
16
14
  isHomepageFirstModule = false,
15
+ verifyIcon = '../../../../images/verifiedAuthor.svg',
17
16
  }) => {
18
17
  const showTabs = module.items.length > 1;
18
+ const moduleStyle = module?.style;
19
+
19
20
  const content = module.items.map((toplist) => (
20
21
  <div label={toplist.title} key={keygen()}>
21
22
  {toplistHeading}
22
23
  <List
23
- pagePath={page.path}
24
+ pagePath={page?.path}
24
25
  toplist={toplist}
25
- CustomRow={CustomRow}
26
26
  modulestyle={module?.style}
27
27
  hasLoadMoreButton={toplist.show_load_more}
28
28
  initItemsCount={toplist.num_items_initial_load}
29
29
  loadItemsCount={toplist.num_items_load_more}
30
30
  pageTemplate={page?.template}
31
31
  template={page?.template}
32
+ verifyIcon={verifyIcon}
32
33
  />
33
34
  </div>
34
35
  ));
35
36
 
36
- const moduleStyle = module?.style;
37
-
38
37
  const Tabs = showTabs && loadable(() => import('~hooks/tabs'));
39
38
  const Title =
40
39
  !showTabs &&
@@ -85,8 +84,8 @@ TopList.propTypes = {
85
84
  }),
86
85
  isHomepageFirstModule: PropTypes.bool,
87
86
  toplistHeading: PropTypes.element,
88
- CustomRow: PropTypes.func,
89
87
  page: PropTypes.shape({ template: PropTypes.string, path: PropTypes.string }),
88
+ verifyIcon: PropTypes.string,
90
89
  };
91
90
 
92
91
  export default TopList;