gatsby-matrix-theme 48.0.10 → 49.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 (21) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/package.json +2 -2
  3. package/src/components/molecules/header/variants/operator/template-four/template-four.test.js +2 -3
  4. package/src/components/molecules/header/variants/operator/template-three/template-three.test.js +3 -4
  5. package/src/components/molecules/multiple-contributors/contributor/contributor.test.js +10 -1
  6. package/src/components/molecules/multiple-contributors/contributor/index.js +3 -2
  7. package/src/components/molecules/multiple-contributors/multiple-contributors.stories.js +16 -3
  8. package/src/gatsby-core-theme/hooks/tabs/tabs.module.scss +58 -53
  9. package/storybook/public/{164.aa3316bc.iframe.bundle.js → 164.e3d7c6c1.iframe.bundle.js} +3 -3
  10. package/storybook/public/{164.aa3316bc.iframe.bundle.js.map → 164.e3d7c6c1.iframe.bundle.js.map} +1 -1
  11. package/storybook/public/778.fdf62321.iframe.bundle.js +1 -0
  12. package/storybook/public/964.09221769.iframe.bundle.js +1 -0
  13. package/storybook/public/iframe.html +1 -1
  14. package/storybook/public/main.965c11ea.iframe.bundle.js +1 -0
  15. package/storybook/public/project.json +1 -2
  16. package/storybook/public/{runtime~main.a70479a4.iframe.bundle.js → runtime~main.90e368d9.iframe.bundle.js} +1 -1
  17. package/tests/factories/authors/author.factory.js +1 -0
  18. package/storybook/public/778.67768517.iframe.bundle.js +0 -1
  19. package/storybook/public/964.9734fb98.iframe.bundle.js +0 -1
  20. package/storybook/public/main.665c265e.iframe.bundle.js +0 -1
  21. /package/storybook/public/{164.aa3316bc.iframe.bundle.js.LICENSE.txt → 164.e3d7c6c1.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,46 @@
1
+ # [49.0.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v48.0.11...v49.0.0) (2024-08-02)
2
+
3
+
4
+ ### Code Refactoring
5
+
6
+ * correction to reviewer name ([6792e5a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6792e5a4a86d22592b9e5ee7bda1f036ee5bd98b))
7
+
8
+
9
+ ### Config
10
+
11
+ * update theme ([87b1c9b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/87b1c9b70b45c0d04084f9287b247c7193f7457e))
12
+
13
+
14
+ * Merge branch 'tm-4654-multiple-contributor' into 'master' ([d3f1aff](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d3f1affaa67657c93bc59a2bc34bc7f8735fa3db))
15
+ * Merge branch 'master' into tm-4654-multiple-contributor ([e83e6d5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e83e6d50cfc3d3e59d222e84d0471bbb9aa65b95))
16
+ * Merge branch 'master' into tm-4654-multiple-contributor ([1f9855e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1f9855e1b104922cd770663b1510dabe90ca9c52))
17
+
18
+
19
+ ### Features
20
+
21
+ * show author review if author, else show bio ([97d0160](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/97d01609fdbfa3d05bd33ed03bf6f9afdca99492))
22
+
23
+
24
+ ### Tests
25
+
26
+ * fix storybook ([1f91c53](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1f91c53ccfd683ce563b6f917adb8aadece3c93c))
27
+
28
+ ## [48.0.11](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v48.0.10...v48.0.11) (2024-08-02)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * eslint and lighthuse ([fbc9737](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fbc973767bd040b1b94851ab8c16c7de8de1f87a))
34
+ * eslint and lighthuse ([15ddae3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/15ddae342ea5a98b5b56532566f4d4aaacde40e9))
35
+ * eslint and lighthuse ([066c684](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/066c684602bc501172e91a53d0f7110f24dedc51))
36
+ * fix tests ([990dd87](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/990dd874d853b383251145b6108d819abfa90509))
37
+ * update theme ([d4b63aa](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d4b63aab5c0305e1ec55cd466408f6e1a8595547))
38
+
39
+
40
+ ### Config
41
+
42
+ * update theme ([1c92d27](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1c92d27f40f9a13d41b69ef06c44e758926a7800))
43
+
1
44
  ## [48.0.10](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v48.0.9...v48.0.10) (2024-07-29)
2
45
 
3
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "48.0.10",
3
+ "version": "49.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": "^5.11.0",
28
- "gatsby-core-theme": "35.0.8",
28
+ "gatsby-core-theme": "35.1.1",
29
29
  "gatsby-plugin-sharp": "^5.11.0",
30
30
  "gatsby-transformer-sharp": "^5.11.0",
31
31
  "prop-types": "15.7.2",
@@ -2,17 +2,16 @@
2
2
  import React from 'react';
3
3
  import { render, cleanup } from '@testing-library/react';
4
4
  import '@testing-library/jest-dom/extend-expect';
5
- import getOperatorData from '../../../../../../../tests/factories/pages/operator.factory';
5
+ import getOperatorData from 'gatsby-core-theme/tests/factories/relations/operator.factory';
6
6
  import TemplateFour from '.';
7
7
 
8
8
  describe('Operator template four component', () => {
9
9
  const data = getOperatorData();
10
10
 
11
11
  test('Template Four Status Active', () => {
12
- const { container, getByText } = render(<TemplateFour {...data} />);
12
+ const { container, getByText } = render(<TemplateFour {...data} type='operator' />);
13
13
  expect(getByText('Ice Casino')).toBeTruthy();
14
14
  expect(container.querySelectorAll('h1')).toHaveLength(1);
15
- expect(getByText('New')).toBeTruthy();
16
15
  expect(container.querySelectorAll('a')).toHaveLength(3);
17
16
  expect(getByText('100% Bonus')).toBeTruthy();
18
17
  expect(getByText('+ Big Promotions')).toBeTruthy();
@@ -2,17 +2,16 @@
2
2
  import React from 'react';
3
3
  import { render, cleanup, waitFor } from '@testing-library/react';
4
4
  import '@testing-library/jest-dom/extend-expect';
5
- import getOperatorData from '../../../../../../../tests/factories/pages/operator.factory';
5
+ import getOperatorData from 'gatsby-core-theme/tests/factories/relations/operator.factory';
6
6
  import TemplateThree from '.';
7
7
 
8
8
  describe('Operator template three component', () => {
9
9
  const data = getOperatorData();
10
10
 
11
11
  test('Template Three Status Active', () => {
12
- const { container, getByText } = render(<TemplateThree {...data} />);
12
+ const { container, getByText } = render(<TemplateThree {...data} type="operator" />);
13
13
  expect(getByText('Ice Casino')).toBeTruthy();
14
14
  expect(container.querySelectorAll('h1')).toHaveLength(1);
15
- expect(getByText('New')).toBeTruthy();
16
15
  expect(container.querySelectorAll('a')).toHaveLength(3);
17
16
  expect(getByText('100% Bonus')).toBeTruthy();
18
17
  expect(getByText('+ Big Promotions')).toBeTruthy();
@@ -20,7 +19,7 @@ describe('Operator template three component', () => {
20
19
  expect(container.querySelectorAll('li')).toHaveLength(6);
21
20
  });
22
21
  test('Template Three variable component', async () => {
23
- const { container } = render(<TemplateThree {...data} hasVariableComponent />);
22
+ const { container } = render(<TemplateThree {...data} hasVariableComponent type="operator" />);
24
23
 
25
24
  await waitFor(() => {
26
25
  expect(container.querySelector('.variable')).toBeTruthy();
@@ -91,9 +91,18 @@ describe('Author Component', () => {
91
91
  );
92
92
  });
93
93
  });
94
- test('Author bio', async () => {
94
+ test('Author review', async () => {
95
95
  const { container } = render(<Contributor contributor={authorData} />);
96
96
 
97
+ await waitFor(() => {
98
+ expect(container.querySelector('.bottomContainer')).toBeTruthy();
99
+ expect(container.querySelector('.biography')).toBeTruthy();
100
+ expect(container.querySelector('.biography')).toHaveTextContent(authorData.author_review);
101
+ });
102
+ });
103
+ test('Reviewer bio', async () => {
104
+ const { container } = render(<Contributor contributor={authorData} isReviewer />);
105
+
97
106
  await waitFor(() => {
98
107
  expect(container.querySelector('.bottomContainer')).toBeTruthy();
99
108
  expect(container.querySelector('.biography')).toBeTruthy();
@@ -23,6 +23,7 @@ const Contributor = ({
23
23
  pages_count: pageCount,
24
24
  experience,
25
25
  biography,
26
+ author_review: authorReview,
26
27
  } = contributor || {};
27
28
 
28
29
  return (
@@ -58,12 +59,12 @@ const Contributor = ({
58
59
  </div>
59
60
  )}
60
61
  </div>
61
- {biography && (
62
+ {((isReviewer && biography) || (!isReviewer && authorReview)) && (
62
63
  <div className={styles.bottomContainer || ''}>
63
64
  <div
64
65
  className={styles?.biography || ''}
65
66
  // eslint-disable-next-line react/no-danger
66
- dangerouslySetInnerHTML={{ __html: biography }}
67
+ dangerouslySetInnerHTML={{ __html: isReviewer ? biography : authorReview }}
67
68
  />
68
69
  </div>
69
70
  )}
@@ -11,8 +11,21 @@ import getAuthorList from '../../../../tests/factories/authors/author.factory';
11
11
 
12
12
  import Author from '.';
13
13
 
14
- const authorData = getAuthorList({})[1];
15
- const reviewerData = getAuthorList({})[1];
14
+ const author1Props = {
15
+ pages_count: 6,
16
+ name: 'John Doe',
17
+ author_review: 'Ice Casino offers an exhilarating gaming experience with its extensive selection of slots and live dealer games, ensuring hours of entertainment for every type of player. The user-friendly interface and generous bonuses make it a standout choice for both new and seasoned online casino enthusiasts.',
18
+ experience: 4,
19
+ }
20
+
21
+ const author2Props = {
22
+ pages_count: 60,
23
+ name: 'Jack Smith',
24
+ author_review: `Ice Casino stands out for its commitment to player satisfaction, offering a wide array of games and frequent promotions that keep the excitement levels high. The platform's robust security measures and fair play policies ensure a safe and trustworthy environment, making it a top choice for online gaming aficionados.`,
25
+ experience: 10,
26
+ }
27
+
28
+ const reviewerData = getAuthorList({ name: 'Matthew Webb' })[1];
16
29
 
17
30
  export default {
18
31
  title: 'Theme/Modules/Template Blocks/Multiple Contributors',
@@ -21,7 +34,7 @@ export default {
21
34
  authors: {
22
35
  name: 'author',
23
36
  type: { name: 'object', required: true },
24
- defaultValue: [authorData, reviewerData],
37
+ defaultValue: [getAuthorList({ ...author1Props })[1], getAuthorList({ ...author2Props })[1]],
25
38
  description: 'Author Data',
26
39
  table: {
27
40
  type: { summary: 'object' },
@@ -1,76 +1,81 @@
1
+ .titleAndTab {
2
+ width: 100%;
3
+
4
+ @include flex-direction(column);
5
+ @include flex-align(center, space-between);
6
+
7
+ gap: 0.8rem;
8
+ flex-wrap: wrap;
9
+
10
+ > * {
11
+ flex: 0 0 30%;
12
+
13
+ @include min(tablet) {
14
+ flex: unset;
15
+ }
16
+ }
17
+
18
+ > h2 {
19
+ flex: 0 0 58%;
20
+
21
+ @include min(tablet) {
22
+ flex: 1;
23
+ }
24
+ }
25
+ }
26
+
1
27
  .tabsHeader {
2
28
  display: grid;
3
29
  grid-template-columns: auto;
4
- &.invertOrder {
5
- grid-template-columns: max-content;
6
- margin-bottom: 2rem;
7
- }
30
+
8
31
  @include min(tablet) {
9
32
  grid-template-columns: 1fr 1fr;
33
+
10
34
  &.tabsonly {
11
35
  grid-template-columns: 1fr;
12
36
  }
37
+ }
13
38
 
14
- &.invertOrder {
15
- grid-template-columns: max-content;
16
- margin-bottom: 2rem;
17
- }
39
+ h2 {
40
+ margin: 0;
18
41
  }
19
- &.invertOrder {
20
- display: flex;
21
- justify-content: space-between;
22
- flex-direction: column;
23
- > div:first-child {
24
- grid-column: 2;
25
- }
26
- @include min(laptop) {
27
- // flex-direction: row;
28
- align-items: center;
29
- }
42
+ }
30
43
 
31
- > div:nth-child(2) {
32
- grid-column: 1;
33
- @include flex-align(center, flex-start);
34
- display: block;
35
- }
44
+ .invertOrder {
45
+ display: flex;
46
+ justify-content: space-between;
47
+ flex-direction: column;
48
+ margin-bottom: 2rem;
36
49
 
37
- .titleAndTab {
38
- flex-direction: row;
50
+ @include min(tablet) {
51
+ grid-template-columns: max-content;
52
+ margin-bottom: 2rem;
53
+ }
39
54
 
40
- button,
41
- ol {
42
- @include min(tablet) {
43
- width: 100%;
44
- }
45
- }
46
- }
55
+ @include min(laptop) {
56
+ align-items: center;
47
57
  }
48
58
 
49
- h2 {
50
- margin: 0;
59
+ > div:first-child {
60
+ grid-column: 2;
51
61
  }
52
- }
53
62
 
54
- .titleAndTab {
55
- width: 100%;
56
- @include flex-direction(column);
57
- @include flex-align(center, space-between);
58
- gap: 0.8rem;
59
- flex-wrap: wrap;
63
+ > div:nth-child(2) {
64
+ grid-column: 1;
60
65
 
61
- > * {
62
- flex: 0 0 30%;
66
+ @include flex-align(center, flex-start);
63
67
 
64
- @include min(tablet) {
65
- flex: unset;
66
- }
68
+ display: block;
67
69
  }
68
-
69
- > h2 {
70
- flex: 0 0 58%;
71
70
 
72
- @include min(tablet) {
73
- flex: 1;
71
+ .titleAndTab {
72
+ flex-direction: row;
73
+
74
+ button,
75
+ ol {
76
+ @include min(tablet) {
77
+ width: 100%;
78
+ }
74
79
  }
75
80
  }
76
81
  }
@@ -82,7 +87,7 @@
82
87
  padding: 0.9rem 2rem;
83
88
  border: 0;
84
89
  border-radius: 0.4rem;
85
- box-shadow: 0 0.1rem 0.2rem 0 rgba(0, 0, 0, 0.2);
90
+ box-shadow: 0 0.1rem 0.2rem 0 rgb(0 0 0 / 20%);
86
91
  background: var(--color-9);
87
92
  color: var(--color-22);
88
93
  font-weight: 700;