gatsby-matrix-theme 40.0.15 → 40.0.16

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 (28) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +1 -1
  3. package/src/components/atoms/info-grid/grid-item/item.module.scss +6 -0
  4. package/src/components/atoms/review-credits/index.js +2 -2
  5. package/src/components/molecules/header/variants/author/assets/name/index.js +8 -4
  6. package/src/components/molecules/header/variants/author/assets/name/name.module.scss +21 -2
  7. package/src/components/molecules/header/variants/author/template-four/index.js +7 -4
  8. package/src/components/molecules/header/variants/author/template-four/template-four.test.js +12 -1
  9. package/src/components/molecules/header/variants/author/template-one/index.js +17 -7
  10. package/src/components/molecules/header/variants/author/template-one/template-one.test.js +13 -4
  11. package/src/components/molecules/header/variants/author/template-three/index.js +14 -5
  12. package/src/components/molecules/header/variants/author/template-three/template-three.test.js +12 -1
  13. package/src/components/molecules/header/variants/author/template-two/index.js +7 -4
  14. package/src/components/molecules/header/variants/author/template-two/template-two.test.js +12 -1
  15. package/src/components/molecules/header/variants/operator/template-three/template-three.test.js +8 -1
  16. package/src/components/molecules/header/variants/operator/variables/index.js +6 -1
  17. package/src/components/molecules/header/variants/payment/template-five/template-five.module.test.js +26 -1
  18. package/src/constants/info-grid.js +2 -0
  19. package/src/gatsby-core-theme/components/molecules/main/index.js +37 -9
  20. package/src/helpers/info-grid.js +13 -0
  21. package/storybook/public/625.4e46db89.iframe.bundle.js +1 -0
  22. package/storybook/public/iframe.html +1 -1
  23. package/storybook/public/main.bb104e56.iframe.bundle.js +2 -0
  24. package/storybook/public/project.json +1 -1
  25. package/storybook/public/{runtime~main.4427aac3.iframe.bundle.js → runtime~main.1b74f155.iframe.bundle.js} +1 -1
  26. package/storybook/public/625.8b8c54c4.iframe.bundle.js +0 -1
  27. package/storybook/public/main.a8cbc4c3.iframe.bundle.js +0 -2
  28. /package/storybook/public/{main.a8cbc4c3.iframe.bundle.js.LICENSE.txt → main.bb104e56.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## [40.0.16](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v40.0.15...v40.0.16) (2024-04-23)
2
+
3
+
4
+ ### Code Refactoring
5
+
6
+ * changes to pronoun on author header pages ([6c60a9d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6c60a9d17b53491c471cb4ada7264747e110167f))
7
+ * changes to review credits or author based on site name ([637cdd7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/637cdd729e9e6df2a2c9c14a9c767a8abf93e481))
8
+ * correction to typo ([43699dd](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/43699dd7364cd631ecbd83874602f90c9dffd6ca))
9
+
10
+
11
+ * Merge branch 'review-credits' into 'master' ([3e0043e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3e0043e04defbb40a16243bf46fad23ea29c1875))
12
+ * Merge branch 'tm-4272-author-info-grid' into 'master' ([e3d21cb](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e3d21cbfb8fc239919aec88cf302274a47275397))
13
+
14
+
15
+ ### Tests
16
+
17
+ * fix test ([5c17b33](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5c17b3313f5f8745952e18261ea187fc0266ee99))
18
+
1
19
  ## [40.0.15](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v40.0.14...v40.0.15) (2024-04-23)
2
20
 
3
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "40.0.15",
3
+ "version": "40.0.16",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -155,6 +155,8 @@
155
155
  }
156
156
 
157
157
  &:nth-of-type(2) {
158
+ @include flex-direction(row);
159
+ gap: 0.4rem;
158
160
  font-size: 1.8rem;
159
161
  line-height: 2.6rem;
160
162
  padding: 0;
@@ -166,6 +168,10 @@
166
168
  color: var(--info-grid-template-three-text-color);
167
169
  text-decoration: none;
168
170
  }
171
+
172
+ small {
173
+ font-size: 100%;
174
+ }
169
175
  }
170
176
  }
171
177
 
@@ -154,12 +154,12 @@ const ReviewCredits = ({
154
154
  {buttonIcon && (
155
155
  <LazyImage
156
156
  src={buttonIcon}
157
- alt={translate(translations, 'contributers', 'contributers icon')}
157
+ alt={translate(translations, 'contributors', 'contributors icon')}
158
158
  width={18}
159
159
  height={14}
160
160
  />
161
161
  )}
162
- {translate(translations, 'contributers', 'About This page')}
162
+ {translate(translations, 'contributors', 'About This page')}
163
163
  </>
164
164
  );
165
165
 
@@ -5,12 +5,15 @@ import { translate } from '~helpers/getters';
5
5
  import { Context } from '~context/MainProvider';
6
6
  import styles from './name.module.scss';
7
7
 
8
- export default function Name({ className = '', name, icon }) {
8
+ export default function Name({ className = '', name, icon, pronouns = '' }) {
9
9
  const { translations } = useContext(Context) || {};
10
10
 
11
11
  return (
12
- <h1 className={`${className || ''} ${styles?.name || ''}`}>
13
- {name}
12
+ <div className={styles.title}>
13
+ <h1 className={`${className || ''} ${styles?.name || ''}`}>
14
+ {name}
15
+ {pronouns && <small>({pronouns})</small>}
16
+ </h1>
14
17
  <LazyImage
15
18
  className={styles.verify}
16
19
  src={icon || '../../../images/verify.svg'}
@@ -19,7 +22,7 @@ export default function Name({ className = '', name, icon }) {
19
22
  width={20}
20
23
  height={20}
21
24
  />
22
- </h1>
25
+ </div>
23
26
  );
24
27
  }
25
28
 
@@ -27,4 +30,5 @@ Name.propTypes = {
27
30
  className: PropTypes.string,
28
31
  name: PropTypes.string,
29
32
  icon: PropTypes.string,
33
+ pronouns: PropTypes.string,
30
34
  };
@@ -6,22 +6,41 @@
6
6
  font-weight: 700;
7
7
  text-transform: capitalize;
8
8
  color: #1c1a28;
9
+ @include flex-direction(column);
10
+
11
+ small {
12
+ font-size: 60%;
13
+ line-height: 2rem;
14
+ }
9
15
 
10
16
  @include min(tablet) {
11
17
  line-height: 4.2rem;
12
18
  font-size: 3.2rem;
13
19
  }
20
+
21
+ @include min(laptop) {
22
+ @include flex-direction(row);
23
+ @include flex-align(center, center);
24
+ gap: 0.4rem;
25
+ }
14
26
  }
15
27
 
16
28
  .verify {
17
- margin-left: 0.4rem;
18
29
  height: 1.6rem;
19
30
  width: 1.6rem;
20
31
  vertical-align: top;
21
32
 
22
33
  @include min(tablet) {
23
- margin-left: 0.8rem;
24
34
  height: 2.4rem;
25
35
  width: 2.4rem;
26
36
  }
27
37
  }
38
+
39
+ .title {
40
+ @include flex-direction(row);
41
+ gap: 0.4rem;
42
+
43
+ @include min(tablet) {
44
+ gap: 0.8rem;
45
+ }
46
+ }
@@ -10,7 +10,9 @@ import styles from './template-four.module.scss';
10
10
  import { translate } from '~helpers/getters';
11
11
 
12
12
  export default function TemplateFour({ author, icons, authorTitle }) {
13
- const { translations } = useContext(Context);
13
+ const { translations } = useContext(Context) || {};
14
+ const { pages_count: pagesCount, author_title: jobTitle, name, pronouns } = author || null;
15
+
14
16
  return (
15
17
  <div className={styles?.container || ''}>
16
18
  <div>
@@ -19,17 +21,18 @@ export default function TemplateFour({ author, icons, authorTitle }) {
19
21
  <Ribbon
20
22
  className={styles?.posts || ''}
21
23
  author={author}
22
- content={`${author.pages_count} ${translate(translations, 'posts', 'Posts')}`}
24
+ content={`${pagesCount} ${translate(translations, 'posts', 'Posts')}`}
23
25
  />
24
26
  </div>
25
27
 
26
28
  <div>
27
29
  <Name
28
30
  className={styles?.name || ''}
29
- name={authorTitle || author.name}
31
+ name={authorTitle || name}
30
32
  icon={icons?.verify}
33
+ pronouns={pronouns || ''}
31
34
  />
32
- <div className={styles?.title || ''}>{author.author_title}</div>
35
+ {jobTitle && <div className={styles?.title || ''}>{jobTitle}</div>}
33
36
  <Socials author={author} />
34
37
  </div>
35
38
  </div>
@@ -1,10 +1,13 @@
1
1
  /* eslint-disable no-multi-assign */
2
2
  import React from 'react';
3
- import { render, cleanup } from '@testing-library/react';
3
+ import { render, cleanup, waitFor } from '@testing-library/react';
4
4
  import MainProvider from '~context/MainProvider';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
+ import getAuthorList from '../../../../../../../tests/factories/authors/author.factory';
6
7
  import TemplateFour from '.';
7
8
 
9
+ const author = getAuthorList({})[1];
10
+
8
11
  describe('Author Header', () => {
9
12
  test('Template Four', () => {
10
13
  const { container, getByText } = render(
@@ -34,6 +37,14 @@ describe('Author Header', () => {
34
37
  expect(getByText('Online Casino Specialist')).toBeTruthy();
35
38
  expect(container.querySelectorAll('a')).toHaveLength(5);
36
39
  });
40
+ test('Test author pronoun', async () => {
41
+ const { container, getByText } = render(<TemplateFour author={author} />);
42
+
43
+ await waitFor(() => {
44
+ expect(getByText('(He/him/his)')).toBeTruthy();
45
+ expect(container.querySelector('small')).toHaveTextContent(author.pronouns);
46
+ });
47
+ });
37
48
  });
38
49
 
39
50
  afterEach(() => {
@@ -11,31 +11,41 @@ import { translate } from '~helpers/getters';
11
11
  import styles from './template-one.module.scss';
12
12
 
13
13
  export default function TemplateOne({ author, icons, authorTitle }) {
14
- const { translations } = useContext(Context);
14
+ const { translations } = useContext(Context) || {};
15
+ const {
16
+ pages_count: pagesCount,
17
+ author_title: jobTitle,
18
+ name,
19
+ biography,
20
+ expertise,
21
+ pronouns,
22
+ } = author || null;
23
+
15
24
  return (
16
25
  <div className={styles?.container || ''}>
17
26
  <Ribbon
18
27
  className={styles?.posts || ''}
19
28
  author={author}
20
- content={`${author.pages_count} ${translate(translations, 'posts', 'Posts')}`}
29
+ content={`${pagesCount} ${translate(translations, 'posts', 'Posts')}`}
21
30
  />
22
31
  <Portrait className={styles?.portrait || ''} author={author} />
23
32
  <div>
24
- <div className={styles?.title || ''}>{author.author_title}</div>
33
+ {jobTitle && <div className={styles?.title || ''}>{jobTitle}</div>}
25
34
  <Name
26
35
  className={styles?.name || ''}
27
- name={authorTitle || author.name}
36
+ name={authorTitle || name}
28
37
  icon={icons?.verify}
38
+ pronouns={pronouns || ''}
29
39
  />
30
40
  <Socials className={styles?.socials || ''} author={author} />
31
- {author.biography && (
41
+ {biography && (
32
42
  <div
33
43
  className={styles?.biography || ''}
34
44
  // eslint-disable-next-line react/no-danger
35
- dangerouslySetInnerHTML={{ __html: author.biography }}
45
+ dangerouslySetInnerHTML={{ __html: biography }}
36
46
  />
37
47
  )}
38
- <Expertise expertise={author.expertise} icon={icons?.expertise} />
48
+ <Expertise expertise={expertise} icon={icons?.expertise} />
39
49
  </div>
40
50
  </div>
41
51
  );
@@ -1,14 +1,15 @@
1
1
  /* eslint-disable no-multi-assign */
2
2
  import React from 'react';
3
- import { render, cleanup } from '@testing-library/react';
3
+ import { render, cleanup, waitFor } from '@testing-library/react';
4
4
  import MainProvider from '~context/MainProvider';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
- import getAuthorList from '~tests/factories/authors/author.factory';
6
+ import getAuthorList from '../../../../../../../tests/factories/authors/author.factory';
7
7
  import TemplateOne from '.';
8
8
 
9
+ const author = getAuthorList({})[1];
10
+
9
11
  describe('Author Header', () => {
10
12
  test('Template One', () => {
11
- const author = getAuthorList({})[1];
12
13
  const { container, getByText } = render(
13
14
  <MainProvider value={{}}>
14
15
  <TemplateOne author={author} />
@@ -16,11 +17,19 @@ describe('Author Header', () => {
16
17
  );
17
18
  expect(getByText('Author 1 Name')).toBeTruthy();
18
19
  expect(getByText('Sports Betting')).toBeTruthy();
19
- expect(getByText('Author 1 Biography')).toBeTruthy();
20
+ expect(container.querySelectorAll('.biography')).toBeTruthy();
20
21
  expect(container.querySelectorAll('a')).toHaveLength(6);
21
22
  expect(container.querySelectorAll('ul')).toHaveLength(1);
22
23
  expect(container.querySelectorAll('li')).toHaveLength(3);
23
24
  });
25
+ test('Test author pronoun', async () => {
26
+ const { container, getByText } = render(<TemplateOne author={author} />);
27
+
28
+ await waitFor(() => {
29
+ expect(getByText('(He/him/his)')).toBeTruthy();
30
+ expect(container.querySelector('small')).toHaveTextContent(author.pronouns);
31
+ });
32
+ });
24
33
  });
25
34
 
26
35
  afterEach(() => {
@@ -11,13 +11,21 @@ import { translate } from '~helpers/getters';
11
11
  import styles from './template-three.module.scss';
12
12
 
13
13
  export default function TemplateThree({ author, icons, authorTitle }) {
14
- const { translations } = useContext(Context);
14
+ const { translations } = useContext(Context) || {};
15
+ const {
16
+ pages_count: pagesCount,
17
+ author_title: jobTitle,
18
+ name,
19
+ expertise,
20
+ pronouns,
21
+ } = author || null;
22
+
15
23
  return (
16
24
  <div className={styles?.container || ''}>
17
25
  <Ribbon
18
26
  className={styles?.posts || ''}
19
27
  author={author}
20
- content={`${author.pages_count} ${translate(translations, 'posts', 'Posts')}`}
28
+ content={`${pagesCount} ${translate(translations, 'posts', 'Posts')}`}
21
29
  />
22
30
  <div>
23
31
  <Portrait className={styles?.portrait || ''} author={author} />
@@ -25,11 +33,12 @@ export default function TemplateThree({ author, icons, authorTitle }) {
25
33
  <Socials className={styles?.socials || ''} author={author} />
26
34
  <Name
27
35
  className={styles?.name || ''}
28
- name={authorTitle || author.name}
36
+ name={authorTitle || name}
29
37
  icon={icons?.verify}
38
+ pronouns={pronouns || ''}
30
39
  />
31
- <div className={styles?.title || ''}>{author.author_title}</div>
32
- <Expertise expertise={author.expertise} icon={icons?.expertise} />
40
+ {jobTitle && <div className={styles?.title || ''}>{jobTitle}</div>}
41
+ <Expertise expertise={expertise} icon={icons?.expertise} />
33
42
  </div>
34
43
  </div>
35
44
  </div>
@@ -1,10 +1,13 @@
1
1
  /* eslint-disable no-multi-assign */
2
2
  import React from 'react';
3
- import { render, cleanup } from '@testing-library/react';
3
+ import { render, cleanup, waitFor } from '@testing-library/react';
4
4
  import MainProvider from '~context/MainProvider';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
+ import getAuthorList from '../../../../../../../tests/factories/authors/author.factory';
6
7
  import TemplateThree from '.';
7
8
 
9
+ const author = getAuthorList({})[1];
10
+
8
11
  describe('Author Header', () => {
9
12
  test('Template Three', () => {
10
13
  const { container, getByText } = render(
@@ -37,6 +40,14 @@ describe('Author Header', () => {
37
40
  expect(container.querySelectorAll('ul')).toHaveLength(1);
38
41
  expect(container.querySelectorAll('li')).toHaveLength(2);
39
42
  });
43
+ test('Test author pronoun', async () => {
44
+ const { container, getByText } = render(<TemplateThree author={author} />);
45
+
46
+ await waitFor(() => {
47
+ expect(getByText('(He/him/his)')).toBeTruthy();
48
+ expect(container.querySelector('small')).toHaveTextContent(author.pronouns);
49
+ });
50
+ });
40
51
  });
41
52
 
42
53
  afterEach(() => {
@@ -11,22 +11,25 @@ import { translate } from '~helpers/getters';
11
11
  import styles from './template-two.module.scss';
12
12
 
13
13
  export default function TemplateTwo({ author, icons, authorTitle }) {
14
- const { translations } = useContext(Context);
14
+ const { translations } = useContext(Context) || {};
15
+ const { pages_count: pagesCount, author_title: jobTitle, name, pronouns } = author || null;
16
+
15
17
  return (
16
18
  <div className={styles?.container || ''}>
17
19
  <Ribbon
18
20
  className={styles?.posts || ''}
19
21
  author={author}
20
- content={`${author.pages_count} ${translate(translations, 'posts', 'Posts')}`}
22
+ content={`${pagesCount} ${translate(translations, 'posts', 'Posts')}`}
21
23
  />
22
24
  <div>
23
25
  <Portrait className={styles?.portrait || ''} author={author} />
24
26
  <div>
25
- <div className={styles?.title || ''}>{author.author_title}</div>
27
+ {jobTitle && <div className={styles?.title || ''}>{jobTitle}</div>}
26
28
  <Name
27
29
  className={styles?.name || ''}
28
- name={authorTitle || author.name}
30
+ name={authorTitle || name}
29
31
  icon={icons?.verify}
32
+ pronouns={pronouns || ''}
30
33
  />
31
34
  <Socials className={styles?.socials || ''} author={author} />
32
35
  <Expertise expertise={author?.expertise || ''} icon={icons?.expertise} />
@@ -1,10 +1,13 @@
1
1
  /* eslint-disable no-multi-assign */
2
2
  import React from 'react';
3
- import { render, cleanup } from '@testing-library/react';
3
+ import { render, cleanup, waitFor } from '@testing-library/react';
4
4
  import MainProvider from '~context/MainProvider';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
+ import getAuthorList from '../../../../../../../tests/factories/authors/author.factory';
6
7
  import TemplateTwo from '.';
7
8
 
9
+ const author = getAuthorList({})[1];
10
+
8
11
  describe('Author Header', () => {
9
12
  test('Template Two', () => {
10
13
  const { container, getByText } = render(
@@ -37,6 +40,14 @@ describe('Author Header', () => {
37
40
  expect(container.querySelectorAll('ul')).toHaveLength(1);
38
41
  expect(container.querySelectorAll('li')).toHaveLength(2);
39
42
  });
43
+ test('Test author pronoun', async () => {
44
+ const { container, getByText } = render(<TemplateTwo author={author} />);
45
+
46
+ await waitFor(() => {
47
+ expect(getByText('(He/him/his)')).toBeTruthy();
48
+ expect(container.querySelector('small')).toHaveTextContent(author.pronouns);
49
+ });
50
+ });
40
51
  });
41
52
 
42
53
  afterEach(() => {
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-multi-assign */
2
2
  import React from 'react';
3
- import { render, cleanup } from '@testing-library/react';
3
+ import { render, cleanup, waitFor } from '@testing-library/react';
4
4
  import '@testing-library/jest-dom/extend-expect';
5
5
  import getOperatorData from '../../../../../../../tests/factories/pages/operator.factory';
6
6
  import TemplateThree from '.';
@@ -19,6 +19,13 @@ describe('Operator template three component', () => {
19
19
  expect(container.querySelectorAll('ul')).toHaveLength(1);
20
20
  expect(container.querySelectorAll('li')).toHaveLength(6);
21
21
  });
22
+ test('Template Three variable component', async () => {
23
+ const { container } = render(<TemplateThree {...data} hasVariableComponent />);
24
+
25
+ await waitFor(() => {
26
+ expect(container.querySelector('.variable')).toBeTruthy();
27
+ });
28
+ });
22
29
  });
23
30
 
24
31
  afterEach(() => {
@@ -1,5 +1,10 @@
1
1
  import React from 'react';
2
+ import PropTypes from 'prop-types';
2
3
 
3
- const VariableComponent = () => <></>;
4
+ const VariableComponent = ({ className }) => <div className={className || ''} />;
4
5
 
5
6
  export default VariableComponent;
7
+
8
+ VariableComponent.propTypes = {
9
+ className: PropTypes.string,
10
+ };
@@ -1,7 +1,8 @@
1
1
  /* eslint-disable no-multi-assign */
2
2
  import React from 'react';
3
- import { render, cleanup } from '@testing-library/react';
3
+ import { render, cleanup, waitFor, fireEvent } from '@testing-library/react';
4
4
  import '@testing-library/jest-dom/extend-expect';
5
+ import { textWordsLimit } from 'gatsby-core-theme/src/helpers/getters';
5
6
  import getPaymentData from '../../../../../../../tests/factories/pages/payment.factory';
6
7
  import TemplateOneThree from '.';
7
8
 
@@ -33,6 +34,30 @@ describe('Payment template one three component', () => {
33
34
  expect(container.getElementsByClassName('desc')).toBeTruthy();
34
35
  expect(container.querySelectorAll('li')).toHaveLength(4);
35
36
  });
37
+ test('Template five toggle read more button', async () => {
38
+ const { container } = render(<TemplateOneThree {...data} />);
39
+
40
+ await waitFor(() => {
41
+ expect(container.querySelector('.desc')).toBeTruthy();
42
+ expect(container.querySelector('.showReadMore')).toBeTruthy();
43
+ expect(container.querySelector('.showReadMore span')).toBeTruthy();
44
+ expect(container.querySelector('.desc')).toHaveTextContent(
45
+ `${textWordsLimit(data.description, 60)} Continue reading`
46
+ );
47
+ expect(container.querySelector('.showReadMore span')).toHaveTextContent('Continue reading');
48
+ });
49
+ });
50
+ test('Template five toggle read more button event', async () => {
51
+ const { container } = render(<TemplateOneThree {...data} />);
52
+ const button = container.querySelector('.showReadMore');
53
+
54
+ fireEvent.click(button);
55
+
56
+ await waitFor(() => {
57
+ // test after click
58
+ expect(container.querySelector('.showReadMore span')).toBeFalsy();
59
+ });
60
+ });
36
61
  });
37
62
 
38
63
  afterEach(() => {
@@ -11,6 +11,7 @@ import {
11
11
  getCurrencies,
12
12
  getMaxWin,
13
13
  getMaxStake,
14
+ // getExperience, // Note: to be used later
14
15
  } from '../helpers/info-grid';
15
16
 
16
17
  export const defaultInfoGrid = {
@@ -72,6 +73,7 @@ export const defaultInfoGrid = {
72
73
  email_address: ['email_address', 'Email Address', (value) => generateLink(value)],
73
74
  lives_in: ['lives_in', 'Lives In'],
74
75
  articles_written: ['pages_count', 'Articles Written'],
76
+ // experience: ['experience', 'Experience', (value, props) => getExperience(value, { ...props, text: 'Years' })] // Note: Use this fn to get experience and pass custom text
75
77
  },
76
78
  };
77
79
 
@@ -62,6 +62,20 @@ const Main = ({
62
62
  showAuthor
63
63
  ? loadable(() => import('../../../../components/atoms/review-credits'))
64
64
  : null;
65
+ const Author =
66
+ page.path !== '/' &&
67
+ !isContactUsPage &&
68
+ page.path !== 'news' &&
69
+ page.path !== 'sitemap' &&
70
+ page.template !== 'ppc' &&
71
+ page.author &&
72
+ showAuthor
73
+ ? loadable(() => import('~atoms/author'))
74
+ : null;
75
+ const useReviewCredits =
76
+ process.env.GATSBY_SITE_NAME === 'irishluck.ie' ||
77
+ process.env.GATSBY_SITE_NAME === 'demosite' ||
78
+ process.env.GATSBY_SITE_NAME === 'playcasino.co.za';
65
79
  const Feedback =
66
80
  page?.sections?.main?.feedbackCounter &&
67
81
  !isContactUsPage &&
@@ -77,15 +91,29 @@ const Main = ({
77
91
  <main className={`${styles?.modulePage || ''} ${styles[page?.template] || ''}`}>
78
92
  {NotFound && <NotFound pageContext={pageContext} />}
79
93
  {HtmlSitemap && <HtmlSitemap pageContext={pageContext} />}
80
- {ReviewCredits && (
81
- <ReviewCredits
82
- date={date}
83
- author={page?.author_id && page?.author}
84
- readingTime={page.reading_time}
85
- reviewer={page.reviewer_id && page?.reviewer}
86
- hasAuthorBox={Boolean(AuthorBox)}
87
- />
88
- )}
94
+ {useReviewCredits
95
+ ? ReviewCredits && (
96
+ <ReviewCredits
97
+ date={date}
98
+ author={page?.author_id && page?.author}
99
+ readingTime={page.reading_time}
100
+ reviewer={page.reviewer_id && page?.reviewer}
101
+ hasAuthorBox={Boolean(AuthorBox)}
102
+ />
103
+ )
104
+ : Author && (
105
+ <Author
106
+ name={page.author?.name}
107
+ date={date}
108
+ type={page?.template}
109
+ authorImg={page?.author?.image}
110
+ readingTime={page.reading_time}
111
+ link={page?.author?.profile_page_path}
112
+ reviewer={page.reviewer_id && page?.reviewer}
113
+ hasAuthorBox={Boolean(AuthorBox)}
114
+ headerOffset={174}
115
+ />
116
+ )}
89
117
  {section.modules &&
90
118
  section.modules.map((module, index) => (
91
119
  <Module
@@ -211,3 +211,16 @@ export const generateLink = (value, props, addRel = false) => {
211
211
  export const getMaxWin = (value) => (value ? `${value}x innsatsen` : null);
212
212
  export const getMaxStake = (value) => (value ? `${value} kroner` : null);
213
213
  export const removeEmojis = (text) => text?.replace(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu, '');
214
+ export const getExperience = (value, props) => {
215
+ if (value === null) return null;
216
+
217
+ const text = props?.text || '';
218
+ const translations = props?.translations || null;
219
+
220
+ return (
221
+ <>
222
+ {value.match(/\d+/)}
223
+ <small>{translate(translations, 'years', text)}</small>
224
+ </>
225
+ );
226
+ };
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkgatsby_matrix_theme=self.webpackChunkgatsby_matrix_theme||[]).push([[625],{"./src/components/molecules/header/variants/operator/variables/index.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../node_modules/react/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__),VariableComponent=function VariableComponent(_ref){var className=_ref.className;return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div",{className:className||""})};VariableComponent.displayName="VariableComponent",VariableComponent.__docgenInfo={description:"",methods:[],displayName:"VariableComponent",props:{className:{description:"",type:{name:"string"},required:!1}}},__webpack_exports__.default=VariableComponent,VariableComponent.propTypes={className:prop_types__WEBPACK_IMPORTED_MODULE_1___default().string},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/molecules/header/variants/operator/variables/index.js"]={name:"VariableComponent",docgenInfo:VariableComponent.__docgenInfo,path:"src/components/molecules/header/variants/operator/variables/index.js"})}}]);