gatsby-matrix-theme 22.0.3 → 23.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.
- package/CHANGELOG.md +35 -0
- package/package.json +2 -2
- package/src/components/molecules/footer/variants/template-one/template-one.stories.js +14 -1
- package/src/gatsby-core-theme/components/molecules/footer/footer.test.js +17 -0
- package/src/gatsby-core-theme/components/molecules/footer/index.js +20 -1
- package/storybook/public/{522.0e8faa1e.iframe.bundle.js → 522.7e682622.iframe.bundle.js} +3 -3
- package/storybook/public/{522.0e8faa1e.iframe.bundle.js.map → 522.7e682622.iframe.bundle.js.map} +1 -1
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.92859cc5.iframe.bundle.js +1 -0
- package/tests/factories/pages/default.factory.js +22 -0
- package/storybook/public/main.9e7c99c1.iframe.bundle.js +0 -1
- /package/storybook/public/{522.0e8faa1e.iframe.bundle.js.LICENSE.txt → 522.7e682622.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
# [23.0.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v22.0.3...v23.0.0) (2023-05-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* updated to latest theme version ([04a6335](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/04a63353c8e7972b8fd0498cd51ca5a64affe1ab))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Code Refactoring
|
|
10
|
+
|
|
11
|
+
* add responsible gamings ([56831e8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/56831e8ea4aae74a8a51e4cc4ee7b9447e4cfc77))
|
|
12
|
+
* add test scripts to responsible gamings ([5f53349](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5f53349fe4b3d9ac3c3e1e9b424193e16d550e57))
|
|
13
|
+
* change to footer logos to comply with partnership site ([d09930b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d09930bfd0928133cfd6046154f7b465474d5bb2))
|
|
14
|
+
* fix issue for nsa ([7e8b2e5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7e8b2e5a56d5f8278dc71fc63d29bd8c8ede7f07))
|
|
15
|
+
* move footer logos variable ahead ([b4b2f0b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b4b2f0b9c0a5b18f12fe1ac7f99e48a82df37939))
|
|
16
|
+
* revert temp ([fd57f7c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fd57f7c297f704334db63eb03a3021a02c0bc25d))
|
|
17
|
+
* temp ([af2b78e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/af2b78e197871cb7e77c0aed2c572d5ac69ee424))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Config
|
|
21
|
+
|
|
22
|
+
* update core theme ([b0c0bb6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b0c0bb605888a6e06a5b43459d3f1167dcd7f56b))
|
|
23
|
+
* update latest core theme ([5ff53b6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5ff53b61c7bd53d4a4645f9acaa25c0cdea1bad8))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
* Merge branch 'tm-3395-responsible-gaming' into 'master' ([fc4681d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fc4681d0238eb4d9a5d6162a9d2b39d6aa5266c1))
|
|
27
|
+
* Merge branch 'tm-3395-responsible-gaming' into 'master' ([bb5c4d1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/bb5c4d10c4bc35cbacbf7834467e07118039bd39))
|
|
28
|
+
* Merge branch 'master' into tm-3395-responsible-gaming ([655f255](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/655f255179becad16f88ff7b220143d05a07acaf))
|
|
29
|
+
* Merge branch 'master' into tm-3395-responsible-gaming ([ee51b7f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ee51b7f0ae7685ddc64250402c5554ccbc01fdbc))
|
|
30
|
+
* Merge branch 'master' into tm-3395-responsible-gaming ([4dd38b0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4dd38b0d9c1f9598c9df77236b4b8b9a1f2526d6))
|
|
31
|
+
* Merge branch 'master' into tm-3395-responsible-gaming ([343d71d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/343d71dcaa7d3e931eb07c269c231c0343314a71))
|
|
32
|
+
* Merge branch 'master' into tm-3395-responsible-gaming ([2312564](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2312564f3e24618667871ceaa52164db0c38e14a))
|
|
33
|
+
* Merge branch 'master' into tm-3395-responsible-gaming ([39eb058](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/39eb058f79894ffed6a609577f76f7d62c62b351))
|
|
34
|
+
* Merge branch 'master' into tm-3395-responsible-gaming ([ddef9fc](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ddef9fcd195fc195dd4a69771ef73c589d518f2b))
|
|
35
|
+
|
|
1
36
|
## [22.0.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v22.0.2...v22.0.3) (2023-05-12)
|
|
2
37
|
|
|
3
38
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-matrix-theme",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0",
|
|
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": "^4.20.0",
|
|
28
|
-
"gatsby-core-theme": "
|
|
28
|
+
"gatsby-core-theme": "22.0.2",
|
|
29
29
|
"gatsby-plugin-sharp": "^4.10.2",
|
|
30
30
|
"gatsby-plugin-sitemap": "^3.3.0",
|
|
31
31
|
"gatsby-transformer-sharp": "^4.10.0",
|
|
@@ -10,11 +10,13 @@ import {
|
|
|
10
10
|
import { getExtraField } from 'gatsby-core-theme/src/helpers/getters';
|
|
11
11
|
import MainProvider from '~context/MainProvider';
|
|
12
12
|
import getFooterData from '../../../../../../tests/factories/modules/footer.factory';
|
|
13
|
+
import getPageData from '../../../../../../tests/factories/pages/default.factory';
|
|
13
14
|
import logo from '../../../../../../storybook-images/logo.svg';
|
|
14
15
|
import securityIcon from '../../../../../../storybook-images/security.svg';
|
|
15
16
|
import TemplateOne from '.';
|
|
16
17
|
|
|
17
18
|
const footerData = getFooterData();
|
|
19
|
+
const pageData = getPageData();
|
|
18
20
|
const helpText = `
|
|
19
21
|
<p>
|
|
20
22
|
Gambling can be addictive, please play responsibly.
|
|
@@ -33,6 +35,17 @@ const helpText = `
|
|
|
33
35
|
|
|
34
36
|
const phoneNum = '- 89 241 5401';
|
|
35
37
|
|
|
38
|
+
const getFooterLogos = () => {
|
|
39
|
+
let refactoredFooterLogos = getExtraField(footerData?.extra_fields, 'logos');
|
|
40
|
+
|
|
41
|
+
refactoredFooterLogos = {
|
|
42
|
+
...refactoredFooterLogos,
|
|
43
|
+
children: [...pageData?.responsibleGaming, ...refactoredFooterLogos.children],
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return refactoredFooterLogos;
|
|
47
|
+
};
|
|
48
|
+
|
|
36
49
|
export default {
|
|
37
50
|
title: 'Matrix-Theme/Layout/Footer/Template One',
|
|
38
51
|
component: TemplateOne,
|
|
@@ -40,7 +53,7 @@ export default {
|
|
|
40
53
|
footerLogos: {
|
|
41
54
|
name: 'footerLogos',
|
|
42
55
|
type: { name: 'object', required: true },
|
|
43
|
-
defaultValue:
|
|
56
|
+
defaultValue: getFooterLogos(),
|
|
44
57
|
description: 'footer logos',
|
|
45
58
|
},
|
|
46
59
|
footerMenu: {
|
|
@@ -4,6 +4,7 @@ import '@testing-library/jest-dom/extend-expect';
|
|
|
4
4
|
import '~tests/helpers/match-media.mock';
|
|
5
5
|
import Footer from '.';
|
|
6
6
|
import getFooterData from '../../../../../tests/factories/modules/footer.factory';
|
|
7
|
+
import getPageData from '../../../../../tests/factories/pages/default.factory';
|
|
7
8
|
|
|
8
9
|
describe('header component', () => {
|
|
9
10
|
test('render', async () => {
|
|
@@ -63,6 +64,22 @@ describe('header component', () => {
|
|
|
63
64
|
expect(container.querySelectorAll('.footer.templateThree')).toHaveLength(0);
|
|
64
65
|
});
|
|
65
66
|
});
|
|
67
|
+
test('Test new responsible gaming logos', async () => {
|
|
68
|
+
const { container } = render(
|
|
69
|
+
<Footer section={getFooterData()} template="homepage" page={getPageData()} />
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
await waitFor(() => {
|
|
73
|
+
expect(container.querySelectorAll('.footer .logos li')).toHaveLength(6);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
test('Test when new responsible gaming logos are not available', async () => {
|
|
77
|
+
const { container } = render(<Footer section={getFooterData()} template="homepage" />);
|
|
78
|
+
|
|
79
|
+
await waitFor(() => {
|
|
80
|
+
expect(container.querySelectorAll('.footer .logos li')).toHaveLength(3);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
66
83
|
});
|
|
67
84
|
afterEach(() => {
|
|
68
85
|
cleanup();
|
|
@@ -43,11 +43,30 @@ const Footer = (props) => {
|
|
|
43
43
|
</p>`;
|
|
44
44
|
const phoneNum = '- 89 241 5401';
|
|
45
45
|
|
|
46
|
+
const footerLogos = getExtraField(props.section?.extra_fields, 'logos');
|
|
47
|
+
|
|
48
|
+
const getFooterLogos = () => {
|
|
49
|
+
let refactoredFooterLogos = { children: [] };
|
|
50
|
+
|
|
51
|
+
if (footerLogos === null) {
|
|
52
|
+
refactoredFooterLogos = {
|
|
53
|
+
children: [...props.page?.responsibleGaming],
|
|
54
|
+
};
|
|
55
|
+
} else {
|
|
56
|
+
refactoredFooterLogos = {
|
|
57
|
+
...footerLogos,
|
|
58
|
+
children: [...props.page?.responsibleGaming, ...footerLogos.children],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return refactoredFooterLogos;
|
|
63
|
+
};
|
|
64
|
+
|
|
46
65
|
props = {
|
|
47
66
|
...props,
|
|
48
67
|
showLinks: props.template !== 'ppc',
|
|
49
68
|
copyrightDisclaimer: getExtraField(props.section?.extra_fields, 'copyright_disclaimer'),
|
|
50
|
-
footerLogos:
|
|
69
|
+
footerLogos: props.page?.responsibleGaming?.length ? getFooterLogos() : footerLogos,
|
|
51
70
|
hasDisclaimer: true,
|
|
52
71
|
showCopyright: true,
|
|
53
72
|
footerMenu: getExtraField(props.section?.extra_fields, 'links'),
|