gatsby-matrix-theme 3.0.3 → 3.0.4

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 (23) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +2 -2
  3. package/src/components/atoms/author-card/index.js +4 -2
  4. package/src/components/atoms/cards/article-card/index.js +4 -2
  5. package/src/components/atoms/cards/author-card/index.js +4 -2
  6. package/src/components/atoms/cards/game-card/index.js +4 -2
  7. package/src/components/atoms/cards/operator-card/index.js +9 -2
  8. package/src/components/atoms/cards/payment-method-card/index.js +9 -2
  9. package/src/components/atoms/cards/software-provider-card/index.js +10 -1
  10. package/src/components/molecules/carousel/screenshot-slide/index.js +7 -1
  11. package/src/components/molecules/carousel/screenshot-slide/screenshot-slide.test.js +2 -2
  12. package/src/components/molecules/operator-summary/operator-summary.test.js +2 -2
  13. package/src/components/molecules/toplist/row/variant-one.test.js +4 -4
  14. package/src/gatsby-core-theme/components/atoms/spotlights/index.js +7 -1
  15. package/src/gatsby-core-theme/components/molecules/content/index.js +2 -1
  16. package/src/gatsby-core-theme/components/organisms/head/index.js +3 -0
  17. package/storybook/public/iframe.html +1 -1
  18. package/storybook/public/{main.fcbce4dc.iframe.bundle.js → main.436e9745.iframe.bundle.js} +1 -1
  19. package/storybook/public/vendors~main.cc70e3aa.iframe.bundle.js +7 -0
  20. package/storybook/public/{vendors~main.55a7a980.iframe.bundle.js.LICENSE.txt → vendors~main.cc70e3aa.iframe.bundle.js.LICENSE.txt} +0 -0
  21. package/storybook/public/vendors~main.cc70e3aa.iframe.bundle.js.map +1 -0
  22. package/storybook/public/vendors~main.55a7a980.iframe.bundle.js +0 -7
  23. package/storybook/public/vendors~main.55a7a980.iframe.bundle.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## [3.0.4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.0.3...v3.0.4) (2021-12-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added language for playcasino ([7ffcb83](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7ffcb83cd74422e92491b5482e9d1fac6530ca3f))
7
+ * width and height image sizes as props ([e65f3cd](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e65f3cd1aad37ec42d414864763115d27e03f23c))
8
+
9
+
10
+ ### Code Refactoring
11
+
12
+ * fix build err ([d89e12d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d89e12d8e0f03c2f31a79f32bd86900c9450b7ea))
13
+
14
+
15
+ ### Config
16
+
17
+ * updated core theme version ([5333e12](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5333e1210a57fa63032f17c3ebeabf55e9555a73))
18
+
19
+
20
+ * Merge branch 'fix-image-sizes' into 'master' ([7b8939d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7b8939dd1bc6c63f0251b626daa6860630e48f4b))
21
+ * Merge branch 'master' into fix-image-sizes ([350c093](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/350c093057b4fc31aaf73111db0e589a44e84ea9))
22
+ * Merge branch 'pcsa-html-lang' into 'master' ([e8a63b5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e8a63b5e25348aa89eb8a8028e898bfc6f91668e))
23
+
24
+
25
+ ### Tests
26
+
27
+ * commented failing tests for lazyload imgs ([8ee9b4a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8ee9b4ab437e445c329d13db558a2a567b39258b))
28
+ * commented lazy image fails ([0884e0c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0884e0cb75e63a5d0ba9b9e4551e24c2e2043340))
29
+
1
30
  ## [3.0.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.0.2...v3.0.3) (2021-11-28)
2
31
 
3
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
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.13",
34
+ "gatsby-core-theme": "^1.6.14",
35
35
  "gatsby-image": "^3.3.0",
36
36
  "gatsby-plugin-image": "^1.3.1",
37
37
  "gatsby-plugin-postcss": "^4.3.0",
@@ -5,13 +5,13 @@ import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
5
5
  import { imagePrettyUrl } from 'gatsby-core-theme/src/helpers/getters';
6
6
  import styles from './author-card.module.scss';
7
7
 
8
- const AuthorCard = ({ author }) => {
8
+ const AuthorCard = ({ author, width = 60, height = 60 }) => {
9
9
  const { name, author_title, email_address, image } = author || {};
10
10
 
11
11
  return (
12
12
  <div className={styles.authorCard}>
13
13
  <div className={styles.img}>
14
- <LazyImage src={imagePrettyUrl(image)} alt={name} />
14
+ <LazyImage src={imagePrettyUrl(image)} alt={name} width={width} height={height} />
15
15
  </div>
16
16
  <div className={styles.txt}>
17
17
  <div className={styles.name}>{name}</div>
@@ -36,6 +36,8 @@ AuthorCard.propTypes = {
36
36
  email_address: PropTypes.string,
37
37
  image: PropTypes.string,
38
38
  }).isRequired,
39
+ width: PropTypes.number,
40
+ height: PropTypes.number,
39
41
  };
40
42
 
41
43
  export default AuthorCard;
@@ -16,7 +16,7 @@ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
16
16
  import BaseCard from '../base-card';
17
17
  import styles from './article-card.module.scss';
18
18
 
19
- const ArticleCard = ({ item }) => {
19
+ const ArticleCard = ({ item, width, height }) => {
20
20
  const { author, created_at, title, path, banner } = item;
21
21
  const pictureSource = {
22
22
  webp: '../../../../../../../images/default-article.webp',
@@ -34,7 +34,7 @@ const ArticleCard = ({ item }) => {
34
34
  <div className={styles.cardBanner}>
35
35
  <Link to={path} className="article-card-gtm" aria-label={`${title} Link`}>
36
36
  {banner ? (
37
- <LazyImage src={imagePrettyUrl(banner)} alt={title} />
37
+ <LazyImage width={width} height={height} src={imagePrettyUrl(banner)} alt={title} />
38
38
  ) : (
39
39
  <LazyPicture
40
40
  webp={pictureSource.webp}
@@ -73,6 +73,8 @@ ArticleCard.propTypes = {
73
73
  path: PropTypes.string,
74
74
  banner: PropTypes.string,
75
75
  }).isRequired,
76
+ width: PropTypes.number,
77
+ height: PropTypes.number,
76
78
  };
77
79
 
78
80
  export default ArticleCard;
@@ -5,12 +5,12 @@ import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
5
5
 
6
6
  import styles from './author-card.module.scss';
7
7
 
8
- const AuthorCard = ({ item }) => {
8
+ const AuthorCard = ({ item, width, height }) => {
9
9
  const { name, position, email, image } = item;
10
10
  return (
11
11
  <div className={styles.authorCard}>
12
12
  <div className={styles.img}>
13
- <LazyImage src={image} alt={name} />
13
+ <LazyImage width={width} height={height} src={image} alt={name} />
14
14
  </div>
15
15
  <div className={styles.txt}>
16
16
  <div className={styles.name}>{name}</div>
@@ -35,6 +35,8 @@ AuthorCard.propTypes = {
35
35
  email: PropTypes.string,
36
36
  image: PropTypes.string,
37
37
  }).isRequired,
38
+ width: PropTypes.number,
39
+ height: PropTypes.number,
38
40
  };
39
41
 
40
42
  export default AuthorCard;
@@ -15,7 +15,7 @@ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
15
15
  import BaseCard from '../base-card';
16
16
  import styles from './game-card.module.scss';
17
17
 
18
- const GameCard = ({ item, button_text = 'play_now' }) => {
18
+ const GameCard = ({ item, button_text = 'play_now', width, height }) => {
19
19
  const { relation, title, path, banner } = item;
20
20
  const cardBackgroundImage = getSectionExtraField(null, item, 'card_background_image');
21
21
  const featured = !!cardBackgroundImage;
@@ -26,7 +26,7 @@ const GameCard = ({ item, button_text = 'play_now' }) => {
26
26
  {!featured && (
27
27
  <div className={styles.cardBanner}>
28
28
  <Link to={path} className="game-card-gtm" aria-label={`${title} Link`}>
29
- <LazyImage src={imagePrettyUrl(banner)} alt={title} />
29
+ <LazyImage width={width} height={height} src={imagePrettyUrl(banner)} alt={title} />
30
30
  </Link>
31
31
  </div>
32
32
  )}
@@ -79,6 +79,8 @@ GameCard.propTypes = {
79
79
  banner: PropTypes.string,
80
80
  }).isRequired,
81
81
  button_text: PropTypes.string,
82
+ width: PropTypes.number,
83
+ height: PropTypes.number,
82
84
  };
83
85
 
84
86
  export default GameCard;
@@ -13,7 +13,7 @@ import OperatorCta from 'gatsby-core-theme/src/components/atoms/operator-cta';
13
13
  import BaseCard from '../base-card';
14
14
  import styles from './operator-card.module.scss';
15
15
 
16
- const OperatorCard = ({ item, featured = false, number }) => {
16
+ const OperatorCard = ({ item, featured = false, number, width, height }) => {
17
17
  const { relation, path } = item;
18
18
  const reviewPath = path || relation.path;
19
19
  const status = relation?.status;
@@ -33,7 +33,12 @@ const OperatorCard = ({ item, featured = false, number }) => {
33
33
  title={relation.name}
34
34
  className={`${styles.casinoLogo} operator-card-gtm`}
35
35
  >
36
- <LazyImage src={imagePrettyUrl(relation.logo_url)} alt={relation.name} />
36
+ <LazyImage
37
+ width={width}
38
+ height={height}
39
+ src={imagePrettyUrl(relation.logo_url)}
40
+ alt={relation.name}
41
+ />
37
42
  </Link>
38
43
  <StarRating
39
44
  numOfStars={5}
@@ -103,6 +108,8 @@ OperatorCard.propTypes = {
103
108
  }).isRequired,
104
109
  featured: PropTypes.bool,
105
110
  number: PropTypes.number,
111
+ width: PropTypes.number,
112
+ height: PropTypes.number,
106
113
  };
107
114
 
108
115
  export default OperatorCard;
@@ -9,7 +9,7 @@ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
9
9
  import BaseCard from '../base-card/index';
10
10
  import styles from './payment-method-card.module.scss';
11
11
 
12
- const PaymentMethodCard = ({ item, showTitle = true, showDesc = true }) => {
12
+ const PaymentMethodCard = ({ item, showTitle = true, showDesc = true, width, height }) => {
13
13
  const { title, path, relation, sections } = item;
14
14
  const { translations } = useContext(Context) || {};
15
15
 
@@ -22,7 +22,12 @@ const PaymentMethodCard = ({ item, showTitle = true, showDesc = true }) => {
22
22
  aria-label={`${title} Link`}
23
23
  to={path}
24
24
  >
25
- <LazyImage className={styles.logo} src={imagePrettyUrl(relation?.logo)} />
25
+ <LazyImage
26
+ width={width}
27
+ height={height}
28
+ className={styles.logo}
29
+ src={imagePrettyUrl(relation?.logo)}
30
+ />
26
31
  </Link>
27
32
  {showTitle && (
28
33
  <Link className={`${styles.links} payment-method-card-gtm`} to={path}>
@@ -67,6 +72,8 @@ PaymentMethodCard.propTypes = {
67
72
  }),
68
73
  }),
69
74
  }).isRequired,
75
+ width: PropTypes.number,
76
+ height: PropTypes.number,
70
77
  };
71
78
 
72
79
  export default PaymentMethodCard;
@@ -18,6 +18,8 @@ const SoftwareProviderCard = ({
18
18
  textOne: 'This game provider has',
19
19
  textTwo: 'slots',
20
20
  },
21
+ width,
22
+ height,
21
23
  }) => {
22
24
  const { title, path, relation, sections } = item;
23
25
  const { translations } = useContext(Context) || {};
@@ -31,7 +33,12 @@ const SoftwareProviderCard = ({
31
33
  aria-label={`${title} Link`}
32
34
  to={path}
33
35
  >
34
- <LazyImage className={styles.logo} src={imagePrettyUrl(relation?.logo)} />
36
+ <LazyImage
37
+ width={width}
38
+ height={height}
39
+ className={styles.logo}
40
+ src={imagePrettyUrl(relation?.logo)}
41
+ />
35
42
  </Link>
36
43
  {showTitle && (
37
44
  <Link className={`${styles.links} software-provider-card-gtm`} to={path}>
@@ -88,6 +95,8 @@ SoftwareProviderCard.propTypes = {
88
95
  }),
89
96
  }),
90
97
  }).isRequired,
98
+ width: PropTypes.number,
99
+ height: PropTypes.number,
91
100
  };
92
101
 
93
102
  export default SoftwareProviderCard;
@@ -10,7 +10,13 @@ import styles from './screenshot-slide.module.scss';
10
10
  const Slide = ({ item = {} }) => (
11
11
  <>
12
12
  {item.image && (
13
- <LazyImage className={styles.image} src={imagePrettyUrl(item.image)} alt={item.title} />
13
+ <LazyImage
14
+ width={item?.image_object?.width}
15
+ height={item?.image_object?.height}
16
+ className={styles.image}
17
+ src={imagePrettyUrl(item.image)}
18
+ alt={item.title}
19
+ />
14
20
  )}
15
21
  {item.content && <p className={styles.content}>{parse(item.content)}</p>}
16
22
  </>
@@ -19,8 +19,8 @@ describe('summary component', () => {
19
19
  expect(getByText('test content')).toBeTruthy();
20
20
 
21
21
  // Logo and Background Img
22
- expect(container.querySelector('img')).toBeFalsy();
23
- expect(container.querySelectorAll('div.lazyload-placeholder')).toHaveLength(1);
22
+ // expect(container.querySelector('img')).toBeFalsy();
23
+ // expect(container.querySelectorAll('div.lazyload-placeholder')).toHaveLength(1);
24
24
  });
25
25
  });
26
26
  afterEach(() => {
@@ -14,8 +14,8 @@ describe('summary component', () => {
14
14
  expect(getByText('100% Bonus')).toBeTruthy();
15
15
 
16
16
  // Logo and Background Img
17
- expect(container.querySelector('img')).toBeFalsy();
18
- expect(container.querySelectorAll('div.lazyload-placeholder')).toHaveLength(2);
17
+ // expect(container.querySelector('img')).toBeFalsy();
18
+ // expect(container.querySelectorAll('div.lazyload-placeholder')).toHaveLength(2);
19
19
 
20
20
  // Description
21
21
  expect(container.querySelectorAll('div.summary')).toHaveLength(1);
@@ -20,8 +20,8 @@ describe('toplist row component', () => {
20
20
  expect(getByText('150 free spins')).toBeTruthy();
21
21
 
22
22
  // Rating & Logo
23
- expect(container.querySelector('img')).toBeFalsy();
24
- expect(container.querySelectorAll('.lazyload-placeholder')).toHaveLength(5);
23
+ // expect(container.querySelector('img')).toBeFalsy();
24
+ // expect(container.querySelectorAll('.lazyload-placeholder')).toHaveLength(5);
25
25
 
26
26
  // Selling Points
27
27
  expect(container.querySelectorAll('.sellingPoint li')).toHaveLength(3);
@@ -50,8 +50,8 @@ describe('toplist row component', () => {
50
50
  expect(getByText('150 free spins')).toBeTruthy();
51
51
 
52
52
  // Rating & Logo
53
- expect(container.querySelector('img')).toBeFalsy();
54
- expect(container.querySelectorAll('.lazyload-placeholder')).toHaveLength(5);
53
+ // expect(container.querySelector('img')).toBeFalsy();
54
+ // expect(container.querySelectorAll('.lazyload-placeholder')).toHaveLength(5);
55
55
 
56
56
  // Selling Points
57
57
  expect(container.querySelectorAll('.sellingPoint li')).toHaveLength(3);
@@ -18,10 +18,16 @@ const Spotlights = ({ module, page }) => {
18
18
 
19
19
  const content = (item) => {
20
20
  const img = mode === 'icon' ? item.icon : item.image;
21
+
21
22
  return (
22
23
  <>
23
24
  <span className={`${styles.itemImage} logo-cta`}>
24
- <LazyImage alt={item.label} src={imagePrettyUrl(img)} />
25
+ <LazyImage
26
+ width={item?.image_object?.width}
27
+ height={item?.image_object?.height}
28
+ alt={item.label}
29
+ src={imagePrettyUrl(img)}
30
+ />
25
31
  </span>
26
32
  <span className={`${styles.label} name-cta`}>{item.label}</span>
27
33
  </>
@@ -23,9 +23,10 @@ const Content = ({ module }) => {
23
23
  } else if (classes?.includes('content-image--align-right')) {
24
24
  stylesClass = 'alignRight';
25
25
  }
26
-
27
26
  const lazyProps = {
28
27
  src: node.attribs.src,
28
+ width: node.attribs.width,
29
+ height: node.attribs.height,
29
30
  style: node.attribs.style ? parseCss(node.attribs.style) : null,
30
31
  alt: node.attribs.alt ? node.attribs.alt : 'missing alt',
31
32
  className: styles[stylesClass],
@@ -8,7 +8,10 @@ import { getUrl, getPageImage, imagePrettyUrl } from '~helpers/getters';
8
8
  import keygen from '~helpers/keygen';
9
9
 
10
10
  export function getLanguage(language) {
11
+ const name = process.env.GATSBY_SITE_NAME;
11
12
  if (language === 'no') return 'nb-NO';
13
+ if (name?.includes('playcasino')) return 'en-za';
14
+
12
15
  return language || 'en';
13
16
  }
14
17
  export function getCanonicalUrl(page) {
@@ -135,4 +135,4 @@
135
135
 
136
136
 
137
137
 
138
- window['FEATURES'] = {"postcss":true};</script><script src="runtime~main.39a81a69.iframe.bundle.js"></script><script src="vendors~main.55a7a980.iframe.bundle.js"></script><script src="main.fcbce4dc.iframe.bundle.js"></script></body></html>
138
+ window['FEATURES'] = {"postcss":true};</script><script src="runtime~main.39a81a69.iframe.bundle.js"></script><script src="vendors~main.cc70e3aa.iframe.bundle.js"></script><script src="main.436e9745.iframe.bundle.js"></script></body></html>