gatsby-matrix-theme 34.0.0 → 34.0.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.json +2 -2
  3. package/src/components/atoms/author/template-one/author-TemplateOne.test.js +26 -0
  4. package/src/components/atoms/author/template-one/author-template.module.scss +15 -0
  5. package/src/components/atoms/author/template-one/author-templateOne.stories.js +57 -0
  6. package/src/components/atoms/author/template-one/index.js +34 -0
  7. package/src/components/atoms/author/template-two/author-TemplateTwo.test.js +25 -0
  8. package/src/components/atoms/author/template-two/author-template.module.scss +29 -0
  9. package/src/components/atoms/author/template-two/author-templateTwo.stories.js +54 -0
  10. package/src/components/atoms/author/template-two/index.js +34 -0
  11. package/src/components/atoms/cards/operator-card/template-four/index.js +26 -67
  12. package/src/components/atoms/cards/operator-card/template-four/template-four.module.scss +107 -149
  13. package/src/components/atoms/cards/operator-card/template-four/template-four.stories.js +0 -6
  14. package/src/components/atoms/cards/operator-card/template-four/template-four.test.js +5 -5
  15. package/src/components/atoms/cards/operator-card/template-one/index.js +25 -82
  16. package/src/components/atoms/cards/operator-card/template-one/template-one.module.scss +37 -108
  17. package/src/components/atoms/cards/operator-card/template-one/template-one.stories.js +1 -6
  18. package/src/components/atoms/cards/operator-card/template-one/template-one.test.js +10 -10
  19. package/src/components/atoms/cards/operator-card/template-three/index.js +24 -63
  20. package/src/components/atoms/cards/operator-card/template-three/template-three.module.scss +54 -125
  21. package/src/components/atoms/cards/operator-card/template-three/template-three.stories.js +1 -6
  22. package/src/components/atoms/cards/operator-card/template-three/template-three.test.js +5 -5
  23. package/src/components/atoms/cards/operator-card/template-two/index.js +26 -69
  24. package/src/components/atoms/cards/operator-card/template-two/template-two.module.scss +99 -106
  25. package/src/components/atoms/cards/operator-card/template-two/template-two.stories.js +1 -6
  26. package/src/components/atoms/cards/operator-card/template-two/template-two.test.js +5 -5
  27. package/src/components/molecules/operator-details/index.js +162 -0
  28. package/src/components/molecules/operator-details/operator-details.module.scss +134 -0
  29. package/src/components/molecules/operator-details/operator-details.stories.js +104 -0
  30. package/src/components/molecules/operator-details/operator-details.test.js +70 -0
  31. package/src/components/molecules/toplist/row/variant-one.js +17 -81
  32. package/src/components/molecules/toplist/row/variant-one.module.scss +2 -2
  33. package/src/components/molecules/toplist/row/variant-one.test.js +10 -6
  34. package/src/images/verifiedAuthor.svg +5 -0
  35. package/storybook/public/{695.5ae799a0.iframe.bundle.js → 695.f2b7e675.iframe.bundle.js} +3 -3
  36. package/storybook/public/{695.5ae799a0.iframe.bundle.js.map → 695.f2b7e675.iframe.bundle.js.map} +1 -1
  37. package/storybook/public/iframe.html +1 -1
  38. package/storybook/public/main.f9a5f827.iframe.bundle.js +2 -0
  39. package/storybook/public/static/media/verifiedAuthor.129f7601.svg +5 -0
  40. package/storybook-images/verifiedAuthor.svg +5 -0
  41. package/storybook/public/main.a50e487f.iframe.bundle.js +0 -2
  42. /package/storybook/public/{695.5ae799a0.iframe.bundle.js.LICENSE.txt → 695.f2b7e675.iframe.bundle.js.LICENSE.txt} +0 -0
  43. /package/storybook/public/{main.a50e487f.iframe.bundle.js.LICENSE.txt → main.f9a5f827.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [34.0.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v34.0.0...v34.0.1) (2023-09-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * author test ([923a49c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/923a49c713f62d6b53c642b78bbdbc1a6ebeeade))
7
+ * cards props ([a3a94de](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a3a94de9768c6f92f736ea24a1e55271ab66f4ad))
8
+ * changes for operator banner ([1fb6cd1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1fb6cd1cc29a716d80980e183999b071c5827014))
9
+ * conficts ([3b8fca8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3b8fca8865d76c5104a02c2be40f88903d845b3b))
10
+ * conflict ([3b2e0df](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3b2e0df3cd2433eb50b905a6f5c8c6a2c7f00776))
11
+ * operator details ([fe13484](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fe13484a7674fea6d908fd0079e6123f3a4ff57c))
12
+ * remove uneccesay css ([49802e9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/49802e9814d8e0c69b37c244c4d2095c57635723))
13
+ * small fix ([8c67ea5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8c67ea5c1c1e7434913d7f9705de3b29064cccb7))
14
+ * small toplist props ([9c575d7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9c575d7dbecf6ec0767ede34d7884eb23b095593))
15
+ * storybook text ([359a3ce](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/359a3ce60d36b6fdac7d0c7ca2099f05532fe24c))
16
+ * update theme ([a1b2654](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a1b2654875a68e405ece0790b3e0a944ca408ad8))
17
+
18
+
19
+ * Merge branch 'tm-3658-operator-details' into 'master' ([b9e3539](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b9e353946bd93beadfa053b0c724192242fca4ea))
20
+ * Merge branch 'tm-3658-operator-details' into 'master' ([6a198a7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6a198a7252ba6f020da131996e7f6a3ae077475b))
21
+
1
22
  # [34.0.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v33.0.2...v34.0.0) (2023-09-25)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "34.0.0",
3
+ "version": "34.0.1",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@react-icons/all-files": "^4.1.0",
27
27
  "gatsby": "^5.11.0",
28
- "gatsby-core-theme": "30.0.1",
28
+ "gatsby-core-theme": "30.0.2",
29
29
  "gatsby-plugin-sharp": "^5.11.0",
30
30
  "gatsby-plugin-sitemap": "^3.3.0",
31
31
  "gatsby-transformer-sharp": "^5.11.0",
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { render, cleanup } from '@testing-library/react';
3
+ import AuthorTemplateOne from '.';
4
+
5
+ describe('AuthorTemplateOne Component', () => {
6
+ it('renders author name in desired format when authorTemplateTwo is false', () => {
7
+ const { getByText } = render(
8
+ <AuthorTemplateOne
9
+ label="Written by"
10
+ authorName="John Doe"
11
+ authorPath="/path-to-author"
12
+ verify="../../../../images/verifiedAuthor.svgs"
13
+ />
14
+ );
15
+
16
+ expect(getByText('Written by John D.')).toBeInTheDocument();
17
+ expect(getByText('Written by John D.')).toHaveAttribute('href', '/path-to-author');
18
+ const link = getByText('Written by John D.');
19
+ expect(link).toBeInTheDocument();
20
+ expect(link).toHaveAttribute('href', '/path-to-author');
21
+ });
22
+ });
23
+
24
+ afterEach(() => {
25
+ cleanup();
26
+ });
@@ -0,0 +1,15 @@
1
+ .authorTemplate {
2
+ > a {
3
+ color: #3c3c40 !important;
4
+ font-size: 1.4rem;
5
+ font-weight: 500;
6
+ line-height: 2.2rem;
7
+ white-space: nowrap;
8
+
9
+ > img {
10
+ width: 1.4rem;
11
+ height: 1.4rem;
12
+ }
13
+ }
14
+ }
15
+
@@ -0,0 +1,57 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ import React from 'react';
3
+ import {
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ ArgsTable,
8
+ PRIMARY_STORY,
9
+ } from '@storybook/addon-docs/blocks';
10
+ import verifyIcon from '../../../../../storybook-images/verifiedAuthor.svg';
11
+ import AuthorTemplateOne from '.';
12
+
13
+ export default {
14
+ title: 'Theme/Atoms/Author/Template One',
15
+ component: AuthorTemplateOne,
16
+ argTypes: {
17
+ label: {
18
+ control: 'text',
19
+ defaultValue: 'By',
20
+ },
21
+ authorName: {
22
+ control: 'text',
23
+ defaultValue: 'John Doe',
24
+ },
25
+ authorPath: {
26
+ control: 'text',
27
+ defaultValue: 'https://example.com',
28
+ },
29
+ showIconMobile: {
30
+ control: 'boolean',
31
+ defaultValue: true,
32
+ },
33
+ verify: {
34
+ control: 'text',
35
+ defaultValue: verifyIcon,
36
+ },
37
+ },
38
+ parameters: {
39
+ docs: {
40
+ description: {
41
+ component: 'AuthorTemplateOne component',
42
+ },
43
+ page: () => (
44
+ <>
45
+ <Title />
46
+ <Description />
47
+ <Primary />
48
+ <ArgsTable story={PRIMARY_STORY} />
49
+ </>
50
+ ),
51
+ },
52
+ },
53
+ };
54
+
55
+ const Template = (args) => <AuthorTemplateOne {...args} />;
56
+
57
+ export const Default = Template.bind({});
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
4
+ import Link from 'gatsby-core-theme/src/hooks/link';
5
+ import styles from './author-template.module.scss';
6
+
7
+ const AuthorTemplateOne = ({
8
+ label = '',
9
+ authorName,
10
+ authorPath,
11
+ verify = '../../../../images/verifiedAuthor.svg',
12
+ }) => {
13
+ const author = authorName?.split(/\s+/);
14
+
15
+ return (
16
+ author.length > 0 && (
17
+ <span className={styles.authorTemplate}>
18
+ <Link to={authorPath}>
19
+ {`${label} ${`${author[0]} ${author[1]?.slice(0, 1)}.`}`}
20
+ <LazyImage src={verify} alt="verify" width={14} height={14} />
21
+ </Link>
22
+ </span>
23
+ )
24
+ );
25
+ };
26
+
27
+ AuthorTemplateOne.propTypes = {
28
+ label: PropTypes.string,
29
+ authorName: PropTypes.string,
30
+ authorPath: PropTypes.string,
31
+ verify: PropTypes.string,
32
+ };
33
+
34
+ export default AuthorTemplateOne;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { render, cleanup } from '@testing-library/react';
3
+ import AuthorTemplateTwo from '.';
4
+
5
+ describe('AuthorTemplateOne Component', () => {
6
+ it('renders author name in desired format when authorTemplateTwo is false', () => {
7
+ const { container } = render(
8
+ <AuthorTemplateTwo
9
+ label="Written by"
10
+ authorName="John Doe"
11
+ authorPath="/path-to-author"
12
+ verify="../../../../images/verifiedAuthor.svgs"
13
+ />
14
+ );
15
+
16
+ expect(container.querySelectorAll('span'));
17
+ expect(container.querySelectorAll('span')).toHaveLength(1);
18
+ expect(container.querySelectorAll('a')).toHaveLength(1);
19
+ expect(container.querySelector('a')).toHaveAttribute('href', '/path-to-author');
20
+ });
21
+ });
22
+
23
+ afterEach(() => {
24
+ cleanup();
25
+ });
@@ -0,0 +1,29 @@
1
+
2
+
3
+ .authorImage {
4
+ position: relative;
5
+
6
+ > img:first-child {
7
+ border-radius: 10rem;
8
+ border: 1px solid #ececec;
9
+ min-width: 2.1rem;
10
+ }
11
+ > img:nth-child(2) {
12
+ position: absolute;
13
+ bottom: 4px;
14
+ right: -1px;
15
+ }
16
+
17
+ > a {
18
+ > img:first-child {
19
+ border-radius: 10rem;
20
+ border: 1px solid #ececec;
21
+ min-width: 2.1rem;
22
+ }
23
+ > img:nth-child(2) {
24
+ position: absolute;
25
+ bottom: 4px;
26
+ right: -1px;
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,54 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ import React from 'react';
3
+ import {
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ ArgsTable,
8
+ PRIMARY_STORY,
9
+ } from '@storybook/addon-docs/blocks';
10
+ import verifyIcon from '../../../../../storybook-images/verifiedAuthor.svg';
11
+ import AuthorTemplateOne from '.';
12
+
13
+ export default {
14
+ title: 'Theme/Atoms/Author/Template Two',
15
+ component: AuthorTemplateOne,
16
+ argTypes: {
17
+ authorName: {
18
+ control: 'text',
19
+ defaultValue: 'John Doe',
20
+ },
21
+ authorPath: {
22
+ control: 'text',
23
+ defaultValue: 'https://example.com',
24
+ },
25
+ authorImage: {
26
+ control: 'text',
27
+ defaultValue: '1675685947/ellipse-1.png',
28
+ },
29
+
30
+ verify: {
31
+ control: 'text',
32
+ defaultValue: verifyIcon,
33
+ },
34
+ },
35
+ parameters: {
36
+ docs: {
37
+ description: {
38
+ component: 'AuthorTemplateOne component',
39
+ },
40
+ page: () => (
41
+ <>
42
+ <Title />
43
+ <Description />
44
+ <Primary />
45
+ <ArgsTable story={PRIMARY_STORY} />
46
+ </>
47
+ ),
48
+ },
49
+ },
50
+ };
51
+
52
+ const Template = (args) => <AuthorTemplateOne {...args} />;
53
+
54
+ export const Default = Template.bind({});
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { imagePrettyUrl } from 'gatsby-core-theme/src/helpers/getters';
4
+ import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
5
+ import Link from 'gatsby-core-theme/src/hooks/link';
6
+ import styles from './author-template.module.scss';
7
+
8
+ const AuthorTemplateTwo = ({
9
+ authorName,
10
+ authorPath,
11
+ authorImage,
12
+ verify = '../../../../images/verifiedAuthor.svg',
13
+ }) => (
14
+ <span className={styles.authorImage}>
15
+ <Link to={authorPath}>
16
+ <LazyImage
17
+ src={imagePrettyUrl(authorImage, 21, 21)}
18
+ width={21}
19
+ height={21}
20
+ alt={authorName}
21
+ />
22
+ <LazyImage src={verify} alt="verify" width={10} height={10} />
23
+ </Link>
24
+ </span>
25
+ );
26
+
27
+ AuthorTemplateTwo.propTypes = {
28
+ authorName: PropTypes.string,
29
+ authorPath: PropTypes.string,
30
+ authorImage: PropTypes.string,
31
+ verify: PropTypes.string,
32
+ };
33
+
34
+ export default AuthorTemplateTwo;
@@ -1,27 +1,23 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
- import React, { useContext } from 'react';
2
+ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import loadable from '@loadable/component';
5
4
  import { BiLike } from '@react-icons/all-files/bi/BiLike';
6
5
  import { BiDislike } from '@react-icons/all-files/bi/BiDislike';
7
- import { getAltText, imagePrettyUrl, translate } from 'gatsby-core-theme/src/helpers/getters';
8
- import Link from 'gatsby-core-theme/src/hooks/link';
9
- import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
10
6
  import Bonus from 'gatsby-core-theme/src/components/molecules/bonus-box/template-three';
11
7
  import ReviewLink from 'gatsby-core-theme/src/components/atoms/review-link';
12
- import { Context } from 'gatsby-core-theme/src/context/MainProvider';
13
8
  import Rating from '../../../ratings';
9
+ import OperatorDetails from '../../../../molecules/operator-details';
14
10
  import styles from './template-four.module.scss';
15
11
 
16
12
  const TemplateFour = ({
17
13
  item,
18
14
  useOneStarRating = true,
19
15
  page,
20
- showHalfStars = false,
21
16
  showRibbon = false,
22
17
  showAuthor = true,
23
18
  showRatingLabel = false,
24
19
  showRatingDecimal = false,
20
+ authorTemplateTwo = true,
25
21
  verifyIcon = '../../../images/verify.svg',
26
22
  }) => {
27
23
  const { ribbons } = item?.relation;
@@ -29,65 +25,26 @@ const TemplateFour = ({
29
25
  const { name, status } = relation;
30
26
  const reviewPath = path || relation.path;
31
27
  const isInactive = status === 'inactive';
32
- const { translations } = useContext(Context) || {};
33
- const StarRating = useOneStarRating
34
- ? loadable(() => import('gatsby-core-theme/src/components/molecules/star-rating/one-star'))
35
- : loadable(() => import('gatsby-core-theme/src/components/molecules/star-rating'));
28
+ // const prettyLink = prettyTracker(relation, 'main', false, page?.template);
36
29
 
37
30
  return (
38
31
  <div className={styles?.operatorCard || ''}>
39
- <div className={styles?.cardHeader || ''}>
40
- <Link
41
- to={reviewPath}
42
- title={name}
43
- className={`${styles?.casinoLogo || ''} operator-card-gtm`}
44
- >
45
- <LazyImage
46
- width={88}
47
- height={88}
48
- src={imagePrettyUrl(relation?.standardised_logo_url_object?.filename, 88, 88)}
49
- alt={getAltText(relation?.standardised_logo_url_object, name)}
50
- />
51
- {showRibbon && ribbons && ribbons.length > 0 && (
52
- <span className={styles.ribbon}>{ribbons[0]}</span>
53
- )}
54
- </Link>
55
- <Link to={reviewPath} title={name} className="operator-card-gtm">
56
- {name}
57
- </Link>
58
- <div
59
- className={`${styles?.headerDetails || ''} ${
60
- showRatingLabel ? styles?.showRatingLabel || '' : ''
61
- }`}
62
- >
63
- <StarRating
64
- numOfStars={5}
65
- halfStars={showHalfStars}
66
- rating={relation.rating}
67
- showLabel={showRatingLabel}
68
- showDecimal={showRatingDecimal}
69
- />
70
- {showAuthor && item?.author && (
71
- <div className={styles?.authorData || ''}>
72
- <LazyImage
73
- alt={item?.author?.name}
74
- loading="eager"
75
- width={80}
76
- height={80}
77
- src={imagePrettyUrl(item?.author?.image, 80, 80)}
78
- />
79
- <span>
80
- <LazyImage
81
- src={verifyIcon}
82
- alt={translate(translations, 'verified', 'Verified')}
83
- width={10}
84
- height={10}
85
- />
86
- </span>
87
- </div>
88
- )}
89
- </div>
90
- </div>
32
+ <OperatorDetails
33
+ item={item}
34
+ showReviewLink={false}
35
+ costumeStyle={styles.operatorDetails}
36
+ imageWidth={88}
37
+ imageHeight={88}
38
+ ribbons={ribbons}
39
+ showRibbon={showRibbon}
40
+ icon={verifyIcon}
41
+ template={page?.template}
42
+ showAuthor={showAuthor}
43
+ authorTemplateTwo={authorTemplateTwo}
44
+ useOneStarRating={useOneStarRating}
45
+ showRatingLabel={showRatingLabel}
46
+ showRatingDecimal={showRatingDecimal}
47
+ />
91
48
  <div className={styles?.cardContent || ''}>
92
49
  <Rating item={relation} type="operatorCards" />
93
50
  {!isInactive && <Bonus welcomeBonus={false} item={relation} ctaBtn tracker="main" />}
@@ -135,17 +92,19 @@ TemplateFour.propTypes = {
135
92
  true_votes: PropTypes.number,
136
93
  false_votes: PropTypes.number,
137
94
  }).isRequired,
138
- useOneStarRating: PropTypes.bool,
95
+
139
96
  page: PropTypes.shape({
140
97
  template: PropTypes.string,
141
98
  type: PropTypes.string,
142
99
  }),
143
- showHalfStars: PropTypes.bool,
100
+ authorTemplateTwo: PropTypes.bool,
144
101
  showAuthor: PropTypes.bool,
145
- showRatingLabel: PropTypes.bool,
146
- showRatingDecimal: PropTypes.bool,
102
+
147
103
  verifyIcon: PropTypes.string,
148
104
  showRibbon: PropTypes.bool,
105
+ useOneStarRating: PropTypes.bool,
106
+ showRatingLabel: PropTypes.bool,
107
+ showRatingDecimal: PropTypes.bool,
149
108
  };
150
109
 
151
110
  export default TemplateFour;