gatsby-matrix-theme 37.0.3 → 37.0.5
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.
- package/CHANGELOG.md +15 -0
- package/package.json +2 -2
- package/src/components/atoms/newsletter/privacy&button/index.js +16 -2
- package/src/components/molecules/operator-summary/template-one/index.js +34 -21
- package/src/components/molecules/operator-summary/template-one/template-one.test.js +1 -3
- package/src/components/molecules/operator-summary/template-three/index.js +28 -15
- package/src/components/molecules/operator-summary/template-three/template-three.test.js +1 -1
- package/src/components/molecules/operator-summary/template-two/index.js +33 -18
- package/src/components/molecules/operator-summary/template-two/template-two.test.js +1 -3
- package/src/components/molecules/small-welcome-bonus/index.js +4 -0
- package/src/helpers/operator.js +20 -0
- package/storybook/public/{487.2d630f0c.iframe.bundle.js → 487.a0ab2ddb.iframe.bundle.js} +4 -4
- package/storybook/public/{487.2d630f0c.iframe.bundle.js.map → 487.a0ab2ddb.iframe.bundle.js.map} +1 -1
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.ed864fce.iframe.bundle.js +2 -0
- package/storybook/public/main.d7d353ae.iframe.bundle.js +0 -2
- /package/storybook/public/{487.2d630f0c.iframe.bundle.js.LICENSE.txt → 487.a0ab2ddb.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook/public/{main.d7d353ae.iframe.bundle.js.LICENSE.txt → main.ed864fce.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [37.0.5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v37.0.4...v37.0.5) (2023-11-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* operator review summary ([67d5d3a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/67d5d3a39a95e15779ddc9ff7ab91923263c9636))
|
|
7
|
+
* operator review summary ([9657b9d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9657b9d1b55abe9e3be6d31b5a1c5b7a262c93f9))
|
|
8
|
+
|
|
9
|
+
## [37.0.4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v37.0.3...v37.0.4) (2023-11-15)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* buttons fixes ([c563413](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/c5634135fce42d4aa0b56db78d663b81f65b8e1c))
|
|
15
|
+
|
|
1
16
|
## [37.0.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v37.0.2...v37.0.3) (2023-11-15)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-matrix-theme",
|
|
3
|
-
"version": "37.0.
|
|
3
|
+
"version": "37.0.5",
|
|
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.
|
|
28
|
+
"gatsby-core-theme": "30.0.19",
|
|
29
29
|
"gatsby-plugin-sharp": "^5.11.0",
|
|
30
30
|
"gatsby-plugin-sitemap": "^3.3.0",
|
|
31
31
|
"gatsby-transformer-sharp": "^5.11.0",
|
|
@@ -3,13 +3,25 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import Button from 'gatsby-core-theme/src/components/atoms/button/button';
|
|
4
4
|
import styles from './newsletter-privacy&button.module.scss';
|
|
5
5
|
|
|
6
|
-
const PrivacyandSuccess = ({
|
|
6
|
+
const PrivacyandSuccess = ({
|
|
7
|
+
privacyText,
|
|
8
|
+
btnText,
|
|
9
|
+
buttonSize = 'm',
|
|
10
|
+
buttonType = 'primary',
|
|
11
|
+
onSubmit = null,
|
|
12
|
+
}) => (
|
|
7
13
|
<div className={styles?.display || ''}>
|
|
8
14
|
{privacyText ? (
|
|
9
15
|
// eslint-disable-next-line react/no-danger
|
|
10
16
|
<p className={styles?.privacytext || ''} dangerouslySetInnerHTML={{ __html: privacyText }} />
|
|
11
17
|
) : null}
|
|
12
|
-
<Button
|
|
18
|
+
<Button
|
|
19
|
+
isInternalLink={false}
|
|
20
|
+
btnText={btnText}
|
|
21
|
+
buttonSize={buttonSize}
|
|
22
|
+
buttonType={buttonType}
|
|
23
|
+
onClick={onSubmit}
|
|
24
|
+
/>
|
|
13
25
|
</div>
|
|
14
26
|
);
|
|
15
27
|
|
|
@@ -17,6 +29,8 @@ PrivacyandSuccess.propTypes = {
|
|
|
17
29
|
privacyText: PropTypes.string,
|
|
18
30
|
btnText: PropTypes.string,
|
|
19
31
|
onSubmit: PropTypes.func,
|
|
32
|
+
buttonType: PropTypes.string,
|
|
33
|
+
buttonSize: PropTypes.string,
|
|
20
34
|
};
|
|
21
35
|
|
|
22
36
|
export default PrivacyandSuccess;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
/* eslint-disable react/no-danger */
|
|
1
2
|
/* eslint-disable camelcase */
|
|
2
3
|
import React, { useContext } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { imagePrettyUrl,
|
|
5
|
+
import { imagePrettyUrl, translate } from 'gatsby-core-theme/src/helpers/getters';
|
|
5
6
|
import { generatePlaceholderString } from 'gatsby-core-theme/src/helpers/generators.mjs';
|
|
6
7
|
import { formatDate } from 'gatsby-core-theme/src/helpers/date-time';
|
|
7
8
|
import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
|
|
8
9
|
import { Context } from 'gatsby-core-theme/src/context/MainProvider';
|
|
9
10
|
import Ratings from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
|
|
11
|
+
import getOperatorForSummary from '../../../../helpers/operator';
|
|
10
12
|
import Author from '../../../atoms/author/template-one';
|
|
11
13
|
import OperatorBanner from '../../../atoms/header-operator-bannner';
|
|
12
14
|
import styles from './template-one.module.scss';
|
|
@@ -20,10 +22,18 @@ const TemplateOne = ({
|
|
|
20
22
|
showExperience = false,
|
|
21
23
|
}) => {
|
|
22
24
|
const { translations } = useContext(Context) || {};
|
|
23
|
-
|
|
25
|
+
|
|
26
|
+
const operatorDetails = getOperatorForSummary(page);
|
|
27
|
+
|
|
28
|
+
if (!operatorDetails) {
|
|
29
|
+
return <></>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const operatorData = operatorDetails[0];
|
|
33
|
+
const operatorSummary = operatorDetails[1];
|
|
34
|
+
|
|
24
35
|
const { standardised_logo_url_object, logo_url_object, name } = operatorData;
|
|
25
|
-
const
|
|
26
|
-
const author = page?.reviewer;
|
|
36
|
+
const author = page.reviewer_id ? page?.reviewer : null;
|
|
27
37
|
const img = operatorImg
|
|
28
38
|
? standardised_logo_url_object?.filename || logo_url_object?.filename
|
|
29
39
|
: author?.image;
|
|
@@ -40,23 +50,25 @@ const TemplateOne = ({
|
|
|
40
50
|
<LazyImage src={imagePrettyUrl(img)} width={imgWidth} height={imgHeight} alt={name} />
|
|
41
51
|
{operatorImg && <Ratings rating={operatorData?.rating} />}
|
|
42
52
|
</div>
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
{author && (
|
|
54
|
+
<div className={styles.author}>
|
|
55
|
+
<Author
|
|
56
|
+
label="By"
|
|
57
|
+
authorName={author?.name}
|
|
58
|
+
verify={imagePrettyUrl(author?.image)}
|
|
59
|
+
authorPath={author?.profile_page_path}
|
|
60
|
+
/>
|
|
61
|
+
<span>
|
|
62
|
+
{author?.pages_count} {translate(translations, 'reviews', 'Reviews')}
|
|
63
|
+
</span>
|
|
64
|
+
<p>
|
|
65
|
+
{translate(translations, 'updated_on', 'Updated on')} {formatDate(page.updated_at)}
|
|
66
|
+
</p>
|
|
67
|
+
{showExperience && author?.experience && (
|
|
68
|
+
<div className={styles.experience}>{author?.experience}</div>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
60
72
|
{operatorSummary && (
|
|
61
73
|
<div
|
|
62
74
|
className={styles.description}
|
|
@@ -83,6 +95,7 @@ TemplateOne.propTypes = {
|
|
|
83
95
|
operatorImg: PropTypes.bool,
|
|
84
96
|
page: PropTypes.shape({
|
|
85
97
|
reviewer: PropTypes.shape({}),
|
|
98
|
+
reviewer_id: PropTypes.number,
|
|
86
99
|
relation_type: PropTypes.string,
|
|
87
100
|
extra_fields: PropTypes.shape({}),
|
|
88
101
|
template: PropTypes.string,
|
|
@@ -4,7 +4,7 @@ import OperatorSummary from '.';
|
|
|
4
4
|
|
|
5
5
|
const mockPage = {
|
|
6
6
|
reviewer: {},
|
|
7
|
-
relation_type: '
|
|
7
|
+
relation_type: 'operator',
|
|
8
8
|
extra_fields: {},
|
|
9
9
|
template: 'operator',
|
|
10
10
|
relation: {
|
|
@@ -27,7 +27,5 @@ test('renders with custom props', () => {
|
|
|
27
27
|
|
|
28
28
|
expect(getByText('Expert Casino Review')).toBeInTheDocument();
|
|
29
29
|
expect(getByAltText('Rizk')).toBeInTheDocument();
|
|
30
|
-
expect(getByText('Reviews')).toBeInTheDocument();
|
|
31
|
-
expect(getByText('Reviews')).toHaveTextContent('Reviews');
|
|
32
30
|
expect(document.querySelector('.description')).not.toBeInTheDocument();
|
|
33
31
|
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
/* eslint-disable react/no-danger */
|
|
1
2
|
/* eslint-disable camelcase */
|
|
2
3
|
import React, { useContext } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { imagePrettyUrl,
|
|
5
|
+
import { imagePrettyUrl, translate } from 'gatsby-core-theme/src/helpers/getters';
|
|
5
6
|
import { generatePlaceholderString } from 'gatsby-core-theme/src/helpers/generators.mjs';
|
|
6
7
|
import { Context } from 'gatsby-core-theme/src/context/MainProvider';
|
|
7
8
|
import Bonus from 'gatsby-core-theme/src/components/molecules/bonus/template-one';
|
|
8
9
|
import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
|
|
9
10
|
import Tnc from 'gatsby-core-theme/src/components/molecules/tnc';
|
|
11
|
+
import getOperatorForSummary from '../../../../helpers/operator';
|
|
10
12
|
import AuthorName from '../../../atoms/author/template-one';
|
|
11
13
|
import styles from './template-three.module.scss';
|
|
12
14
|
|
|
@@ -20,9 +22,17 @@ const TemplateThree = ({
|
|
|
20
22
|
tncContainer = false,
|
|
21
23
|
}) => {
|
|
22
24
|
const { translations } = useContext(Context) || {};
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
const operatorDetails = getOperatorForSummary(page);
|
|
27
|
+
|
|
28
|
+
if (!operatorDetails) {
|
|
29
|
+
return <></>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const operatorData = operatorDetails[0];
|
|
33
|
+
const operatorSummary = operatorDetails[1];
|
|
34
|
+
|
|
35
|
+
const author = page.reviewer_id ? page?.reviewer : null;
|
|
26
36
|
const title = generatePlaceholderString(
|
|
27
37
|
translate(translations, 'expert_casino_review_title', 'Expert Casino Review [operator_name]'),
|
|
28
38
|
translations,
|
|
@@ -43,18 +53,20 @@ const TemplateThree = ({
|
|
|
43
53
|
dangerouslySetInnerHTML={{ __html: operatorSummary }}
|
|
44
54
|
/>
|
|
45
55
|
)}
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
+
{author && (
|
|
57
|
+
<div className={styles.author}>
|
|
58
|
+
<LazyImage
|
|
59
|
+
src={imagePrettyUrl(author?.image)}
|
|
60
|
+
width={imgWidth}
|
|
61
|
+
height={imgHeight}
|
|
62
|
+
alt={author?.name}
|
|
63
|
+
/>
|
|
64
|
+
<div>
|
|
65
|
+
<AuthorName verify={verify} authorName={author?.name} />
|
|
66
|
+
<span>{author?.author_title}</span>
|
|
67
|
+
</div>
|
|
56
68
|
</div>
|
|
57
|
-
|
|
69
|
+
)}
|
|
58
70
|
</div>
|
|
59
71
|
<Bonus
|
|
60
72
|
tncFixed={tncFixed}
|
|
@@ -86,6 +98,7 @@ TemplateThree.propTypes = {
|
|
|
86
98
|
page: PropTypes.shape({
|
|
87
99
|
reviewer: PropTypes.shape({}),
|
|
88
100
|
relation_type: PropTypes.string,
|
|
101
|
+
reviewer_id: PropTypes.number,
|
|
89
102
|
extra_fields: PropTypes.shape({}),
|
|
90
103
|
template: PropTypes.string,
|
|
91
104
|
updated_at: PropTypes.string,
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
/* eslint-disable react/no-danger */
|
|
1
2
|
/* eslint-disable camelcase */
|
|
2
3
|
import React, { useContext } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { imagePrettyUrl,
|
|
5
|
+
import { imagePrettyUrl, translate } from 'gatsby-core-theme/src/helpers/getters';
|
|
5
6
|
import { generatePlaceholderString } from 'gatsby-core-theme/src/helpers/generators.mjs';
|
|
6
7
|
import { formatDate } from 'gatsby-core-theme/src/helpers/date-time';
|
|
7
8
|
import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
|
|
8
9
|
import Tnc from 'gatsby-core-theme/src/components/molecules/tnc';
|
|
9
10
|
import { Context } from 'gatsby-core-theme/src/context/MainProvider';
|
|
10
11
|
import Ratings from 'gatsby-core-theme/src/components/molecules/star-rating/index';
|
|
12
|
+
import getOperatorForSummary from '../../../../helpers/operator';
|
|
11
13
|
import Author from '../../../atoms/author/template-one';
|
|
12
14
|
import OperatorBanner from '../../../atoms/header-operator-bannner';
|
|
13
15
|
import styles from './template-two.module.scss';
|
|
@@ -17,15 +19,24 @@ const TemplateTwo = ({
|
|
|
17
19
|
imgWidth = 128,
|
|
18
20
|
imgHeight = 146,
|
|
19
21
|
tnc = false,
|
|
20
|
-
operatorImg =
|
|
22
|
+
operatorImg = true,
|
|
21
23
|
}) => {
|
|
22
24
|
const { translations } = useContext(Context) || {};
|
|
23
|
-
|
|
25
|
+
|
|
26
|
+
const operatorDetails = getOperatorForSummary(page);
|
|
27
|
+
|
|
28
|
+
if (!operatorDetails) {
|
|
29
|
+
return <></>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const operatorData = operatorDetails[0];
|
|
33
|
+
const operatorSummary = operatorDetails[1];
|
|
34
|
+
|
|
24
35
|
const { name } = operatorData;
|
|
25
36
|
const imageObject = operatorData?.standardised_logo_url_object || operatorData?.logo_url_object;
|
|
26
|
-
const
|
|
27
|
-
const author = page?.reviewer;
|
|
37
|
+
const author = page.reviewer_id ? page?.reviewer : null;
|
|
28
38
|
const img = operatorImg ? imageObject : author?.image;
|
|
39
|
+
|
|
29
40
|
const title = generatePlaceholderString(
|
|
30
41
|
translate(translations, 'expert_casino_review_title', 'Expert Casino Review'),
|
|
31
42
|
translations,
|
|
@@ -37,7 +48,7 @@ const TemplateTwo = ({
|
|
|
37
48
|
<div className={styles.details}>
|
|
38
49
|
<div className={styles.img}>
|
|
39
50
|
<LazyImage
|
|
40
|
-
src={imagePrettyUrl(img, imgWidth, imgHeight)}
|
|
51
|
+
src={imagePrettyUrl(img?.filename, imgWidth, imgHeight)}
|
|
41
52
|
width={imgWidth}
|
|
42
53
|
height={imgHeight}
|
|
43
54
|
alt={name}
|
|
@@ -56,17 +67,20 @@ const TemplateTwo = ({
|
|
|
56
67
|
dangerouslySetInnerHTML={{ __html: operatorSummary }}
|
|
57
68
|
/>
|
|
58
69
|
)}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
|
|
71
|
+
{author && (
|
|
72
|
+
<div className={styles.author}>
|
|
73
|
+
<Author
|
|
74
|
+
label="By"
|
|
75
|
+
authorName={author?.name}
|
|
76
|
+
verify={imagePrettyUrl(author?.image)}
|
|
77
|
+
authorPath={author?.profile_page_path}
|
|
78
|
+
/>
|
|
79
|
+
<span>
|
|
80
|
+
{author?.pages_count} {translate(translations, 'reviews', 'Reviews')}
|
|
81
|
+
</span>
|
|
82
|
+
</div>
|
|
83
|
+
)}
|
|
70
84
|
</div>
|
|
71
85
|
|
|
72
86
|
<OperatorBanner logo={imageObject} operator={operatorData} template={page?.template} />
|
|
@@ -81,8 +95,9 @@ TemplateTwo.propTypes = {
|
|
|
81
95
|
tnc: PropTypes.bool,
|
|
82
96
|
operatorImg: PropTypes.bool,
|
|
83
97
|
page: PropTypes.shape({
|
|
84
|
-
reviewer: PropTypes.shape({}),
|
|
85
98
|
relation_type: PropTypes.string,
|
|
99
|
+
reviewer_id: PropTypes.number,
|
|
100
|
+
reviewer: PropTypes.shape({}),
|
|
86
101
|
extra_fields: PropTypes.shape({}),
|
|
87
102
|
template: PropTypes.string,
|
|
88
103
|
updated_at: PropTypes.string,
|
|
@@ -4,7 +4,7 @@ import OperatorSummary from '.';
|
|
|
4
4
|
|
|
5
5
|
const mockPage = {
|
|
6
6
|
reviewer: {},
|
|
7
|
-
relation_type: '
|
|
7
|
+
relation_type: 'operator',
|
|
8
8
|
extra_fields: {},
|
|
9
9
|
template: 'operator',
|
|
10
10
|
relation: {
|
|
@@ -27,7 +27,5 @@ test('renders with custom props', () => {
|
|
|
27
27
|
|
|
28
28
|
expect(getByText('Expert Casino Review')).toBeInTheDocument();
|
|
29
29
|
expect(getByAltText('Rizk')).toBeInTheDocument();
|
|
30
|
-
expect(getByText('Reviews')).toBeInTheDocument();
|
|
31
|
-
expect(getByText('Reviews')).toHaveTextContent('Reviews');
|
|
32
30
|
expect(document.querySelector('.description')).not.toBeInTheDocument();
|
|
33
31
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
1
2
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
3
|
/* eslint-disable react/prop-types */
|
|
3
4
|
/* eslint-disable camelcase */
|
|
@@ -18,6 +19,9 @@ import styles from './small-welcome-bonus.module.scss';
|
|
|
18
19
|
|
|
19
20
|
const Index = ({ page }) => {
|
|
20
21
|
const operator = page?.extra_fields?.game_review_summary_operator;
|
|
22
|
+
if (!operator) {
|
|
23
|
+
return <></>;
|
|
24
|
+
}
|
|
21
25
|
const { status } = operator;
|
|
22
26
|
const { translations } = useContext(Context) || {};
|
|
23
27
|
const prettyLink = prettyTracker(operator, 'main', false, page.template);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getExtraField } from 'gatsby-core-theme/src/helpers/getters';
|
|
2
|
+
|
|
3
|
+
const getOperatorForSummary = (page) => {
|
|
4
|
+
switch (page.relation_type) {
|
|
5
|
+
case 'operator':
|
|
6
|
+
return page?.relation
|
|
7
|
+
? [page?.relation, getExtraField(page.extra_fields, 'operator_review_summary', null)]
|
|
8
|
+
: null;
|
|
9
|
+
case 'game':
|
|
10
|
+
// eslint-disable-next-line no-case-declarations
|
|
11
|
+
const operator = getExtraField(page.extra_fields, 'game_review_summary_operator', null);
|
|
12
|
+
return operator
|
|
13
|
+
? [operator, getExtraField(page.extra_fields, 'game_review_summary', null)]
|
|
14
|
+
: null;
|
|
15
|
+
default:
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default getOperatorForSummary;
|