gatsby-core-theme 36.0.1 → 36.0.2
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 +8 -0
- package/package.json +1 -1
- package/src/components/atoms/author-box/template-one/fact-check/index.js +4 -2
- package/src/components/atoms/author-box/template-one/index.js +2 -2
- package/src/components/atoms/author-box/template-three/fact-check/index.js +2 -1
- package/src/components/atoms/author-box/template-three/index.js +1 -1
- package/src/components/atoms/author-box/template-two/fact-check/index.js +4 -2
- package/src/components/atoms/author-box/template-two/index.js +1 -1
- package/src/components/atoms/menu/items/item/item.test.js +1 -3
- package/src/components/molecules/footer/variables/index.js +1 -2
- package/src/components/molecules/footer/variables/variables.test.js +20 -0
- package/src/components/molecules/footer/variants/template-two/index.js +1 -0
- package/src/components/molecules/header/variants/default/variables/variables.test.js +20 -0
- package/src/components/molecules/header/variants/operator/variables/variables.test.js +20 -0
- package/src/components/molecules/main/index.js +41 -27
- package/src/helpers/processor/index.mjs +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [36.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v36.0.1...v36.0.2) (2024-08-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* author box reviewed by ([c7b7564](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c7b7564bcee16f5f9bfe9ce2caa0f83518c691f8))
|
|
7
|
+
* tests ([6506b80](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6506b807dcef263557ad8bea26ad14a9dfb3a762))
|
|
8
|
+
|
|
1
9
|
## [36.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v36.0.0...v36.0.1) (2024-08-21)
|
|
2
10
|
|
|
3
11
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
1
2
|
/* eslint-disable react/no-danger */
|
|
2
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import { FaClock } from '@react-icons/all-files/fa/FaClock';
|
|
5
6
|
|
|
@@ -14,11 +15,12 @@ export default function FactCheck({
|
|
|
14
15
|
dateFormat = 'DD.MM.YYYY',
|
|
15
16
|
dateSeparator = '/',
|
|
16
17
|
readingTime = '',
|
|
17
|
-
reviewer
|
|
18
|
+
reviewer,
|
|
18
19
|
verifiedIconWidth = 14,
|
|
19
20
|
verifiedIconHeight = 14,
|
|
20
21
|
readTimeIcon = <FaClock title="Clock Icon" />,
|
|
21
22
|
}) {
|
|
23
|
+
|
|
22
24
|
return (
|
|
23
25
|
<>
|
|
24
26
|
{(readingTime || reviewer || date) && (
|
|
@@ -5,13 +5,13 @@ import AuthorDetails from '../details';
|
|
|
5
5
|
import AuthorDescription from '../description';
|
|
6
6
|
import FactCheck from './fact-check';
|
|
7
7
|
|
|
8
|
-
export default function AuthorBox({ author, reviewer
|
|
8
|
+
export default function AuthorBox({ author, reviewer, readingTime = '', date = '' }) {
|
|
9
9
|
return (
|
|
10
10
|
<div className={styles.container || ''} id="authorbox">
|
|
11
11
|
<AuthorDetails author={author} />
|
|
12
12
|
<AuthorDescription author={author} />
|
|
13
13
|
{author?.ribbon_label && <div className={styles.ribbon || ''}>{author?.ribbon_label}</div>}
|
|
14
|
-
<FactCheck author={author} reviewer={reviewer} readingTime={readingTime} date={date} />
|
|
14
|
+
{reviewer && <FactCheck author={author} reviewer={reviewer} readingTime={readingTime} date={date} />}
|
|
15
15
|
</div>
|
|
16
16
|
);
|
|
17
17
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
1
2
|
/* eslint-disable react/no-danger */
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
@@ -14,7 +15,7 @@ export default function FactCheck({
|
|
|
14
15
|
dateFormat = 'DD.MM.YYYY',
|
|
15
16
|
dateSeparator = '/',
|
|
16
17
|
readingTime = '',
|
|
17
|
-
reviewer
|
|
18
|
+
reviewer,
|
|
18
19
|
verifiedIconWidth = 14,
|
|
19
20
|
verifiedIconHeight = 14,
|
|
20
21
|
readTimeIcon = <FaClock title="Clock Icon" />,
|
|
@@ -6,7 +6,7 @@ import AuthorDescription from '../description';
|
|
|
6
6
|
import FactCheck from './fact-check';
|
|
7
7
|
import Expertion from './expertion';
|
|
8
8
|
|
|
9
|
-
export default function AuthorBox({ author, reviewer
|
|
9
|
+
export default function AuthorBox({ author, reviewer, readingTime = '', date = '' }) {
|
|
10
10
|
return (
|
|
11
11
|
<div className={styles.container || ''} id="authorbox">
|
|
12
12
|
{author?.ribbon_label && <div className={styles.ribbon || ''}>{author?.ribbon_label}</div>}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
1
2
|
/* eslint-disable react/no-danger */
|
|
2
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import { FaClock } from '@react-icons/all-files/fa/FaClock';
|
|
5
6
|
|
|
@@ -14,11 +15,12 @@ export default function FactCheck({
|
|
|
14
15
|
dateFormat = 'DD.MM.YYYY',
|
|
15
16
|
dateSeparator = '/',
|
|
16
17
|
readingTime = '',
|
|
17
|
-
reviewer
|
|
18
|
+
reviewer,
|
|
18
19
|
verifiedIconWidth = 14,
|
|
19
20
|
verifiedIconHeight = 14,
|
|
20
21
|
readTimeIcon = <FaClock title="Clock Icon" />,
|
|
21
22
|
}) {
|
|
23
|
+
|
|
22
24
|
return (
|
|
23
25
|
<>
|
|
24
26
|
{(readingTime || reviewer || date) && (
|
|
@@ -10,7 +10,7 @@ export default function AuthorBox({ author, reviewer = {}, readingTime = '', dat
|
|
|
10
10
|
<div className={styles.container || ''} id="authorbox">
|
|
11
11
|
<AuthorDetails template="templateTwo" ribbon author={author} extraInfo />
|
|
12
12
|
<AuthorDescription template="templateTwo" author={author} />
|
|
13
|
-
<FactCheck author={author} reviewer={reviewer} readingTime={readingTime} date={date} />
|
|
13
|
+
{reviewer && <FactCheck author={author} reviewer={reviewer} readingTime={readingTime} date={date} />}
|
|
14
14
|
</div>
|
|
15
15
|
);
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render, cleanup, waitFor
|
|
2
|
+
import { render, cleanup, waitFor } from '@testing-library/react';
|
|
3
3
|
import '@testing-library/jest-dom/extend-expect';
|
|
4
4
|
|
|
5
5
|
import getNavigation from '~tests/factories/sections/navigationStatic.factory';
|
|
@@ -21,7 +21,6 @@ describe('Menu Component', () => {
|
|
|
21
21
|
test('render menu link item', async () => {
|
|
22
22
|
const { container, getByText } = render(<Item item={menus.children[3]} />);
|
|
23
23
|
await waitFor(() => {
|
|
24
|
-
expect(container).toBeTruthy();
|
|
25
24
|
expect(container.querySelectorAll('a')).toHaveLength(1);
|
|
26
25
|
expect(getByText('Sportsbooks').getAttribute('href')).toEqual('/sportsbooks');
|
|
27
26
|
});
|
|
@@ -30,7 +29,6 @@ describe('Menu Component', () => {
|
|
|
30
29
|
test('render item ', async () => {
|
|
31
30
|
const { container, getByText } = render(<Item item={menus.children[3]} />);
|
|
32
31
|
await waitFor(() => {
|
|
33
|
-
expect(container).toBeTruthy();
|
|
34
32
|
expect(container.querySelectorAll('a')).toHaveLength(1);
|
|
35
33
|
expect(getByText('Sportsbooks').getAttribute('href')).toEqual('/sportsbooks');
|
|
36
34
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Image from '~hooks/gatsby-img';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
|
|
5
|
-
const VariableComponent = ({ className }) => <div className={className || ''}
|
|
4
|
+
const VariableComponent = ({ className }) => <div className={className || ''} />;
|
|
6
5
|
|
|
7
6
|
export default VariableComponent;
|
|
8
7
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
4
|
+
|
|
5
|
+
import Variable from '.';
|
|
6
|
+
|
|
7
|
+
describe('Variable Component', () => {
|
|
8
|
+
test('render with props', () => {
|
|
9
|
+
const { container } = render(
|
|
10
|
+
<Variable
|
|
11
|
+
className='test'
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
expect(container.querySelectorAll('.test')).toHaveLength(1);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
cleanup();
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
4
|
+
|
|
5
|
+
import Variable from '.';
|
|
6
|
+
|
|
7
|
+
describe('Variable Component', () => {
|
|
8
|
+
test('render with props', () => {
|
|
9
|
+
const { container } = render(
|
|
10
|
+
<Variable
|
|
11
|
+
className='test'
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
expect(container.querySelectorAll('.test')).toHaveLength(1);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
cleanup();
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
4
|
+
|
|
5
|
+
import Variable from '.';
|
|
6
|
+
|
|
7
|
+
describe('Variable Component', () => {
|
|
8
|
+
test('render with props', () => {
|
|
9
|
+
const { container } = render(
|
|
10
|
+
<Variable
|
|
11
|
+
className='test'
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
expect(container.querySelectorAll('.test')).toHaveLength(1);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
cleanup();
|
|
20
|
+
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React, { lazy, Suspense } from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import { getURLParam } from
|
|
4
|
-
import Module from
|
|
5
|
-
import styles from
|
|
6
|
-
import keygen from
|
|
7
|
-
import settings from
|
|
8
|
-
import AuthorBoxComponent from
|
|
9
|
-
import { isSearchPath } from
|
|
10
|
-
import Search from
|
|
1
|
+
import React, { lazy, Suspense } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { getURLParam } from "gatsby-core-theme/src/helpers/getters";
|
|
4
|
+
import Module from "~molecules/module";
|
|
5
|
+
import styles from "./main.module.scss";
|
|
6
|
+
import keygen from "~helpers/keygen";
|
|
7
|
+
import settings from "../../../constants/settings.mjs";
|
|
8
|
+
import AuthorBoxComponent from "../../atoms/author-box";
|
|
9
|
+
import { isSearchPath } from "~helpers/isSearchPath";
|
|
10
|
+
import Search from "~pages/search";
|
|
11
11
|
|
|
12
12
|
const Main = ({
|
|
13
13
|
section = {},
|
|
@@ -20,23 +20,35 @@ const Main = ({
|
|
|
20
20
|
const siteName = process.env.GATSBY_SITE_NAME;
|
|
21
21
|
const showNewsletter =
|
|
22
22
|
!(
|
|
23
|
-
settings.newsletter[siteName]?.filter_pages?.includes(
|
|
24
|
-
settings.newsletter[siteName]?.filter_pages?.includes(
|
|
25
|
-
|
|
23
|
+
settings.newsletter[siteName]?.filter_pages?.includes("*") ||
|
|
24
|
+
settings.newsletter[siteName]?.filter_pages?.includes(
|
|
25
|
+
page?.relation_type
|
|
26
|
+
) ||
|
|
27
|
+
settings.newsletter.default?.filter_pages?.includes(
|
|
28
|
+
page?.relation_type
|
|
29
|
+
) ||
|
|
26
30
|
exclNewsletter
|
|
27
31
|
) && !process.env?.HIDE_NEWSLETTER;
|
|
28
32
|
const pathPrefixes = isSearchPath(allMarkets, page.path);
|
|
29
|
-
const HtmlSitemap = pageContext.sitemapData
|
|
33
|
+
const HtmlSitemap = pageContext.sitemapData
|
|
34
|
+
? lazy(() => import(`~atoms/sitemap`))
|
|
35
|
+
: null;
|
|
30
36
|
const AuthorBox = page.author_id;
|
|
31
|
-
const NotFound = page?.path?.includes(
|
|
32
|
-
|
|
37
|
+
const NotFound = page?.path?.includes("404")
|
|
38
|
+
? lazy(() => import(`~atoms/not-found`))
|
|
39
|
+
: null;
|
|
40
|
+
const Newsletter = showNewsletter
|
|
41
|
+
? lazy(() => import("~molecules/newsletter"))
|
|
42
|
+
: null;
|
|
33
43
|
const NewsletterSuccess =
|
|
34
|
-
showNewsletter &&
|
|
44
|
+
showNewsletter &&
|
|
45
|
+
typeof window !== "undefined" &&
|
|
46
|
+
Boolean(getURLParam("subscribed"))
|
|
35
47
|
? lazy(() => import(`../newsletter/success`))
|
|
36
48
|
: null;
|
|
37
49
|
|
|
38
50
|
return (
|
|
39
|
-
<main className={styles.modulePage ||
|
|
51
|
+
<main className={styles.modulePage || ""}>
|
|
40
52
|
{section.modules &&
|
|
41
53
|
section.modules.map((module, index) => (
|
|
42
54
|
<Module
|
|
@@ -60,17 +72,19 @@ const Main = ({
|
|
|
60
72
|
</Suspense>
|
|
61
73
|
)}
|
|
62
74
|
{AuthorBox && (
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/>
|
|
70
|
-
</Suspense>
|
|
75
|
+
<AuthorBoxComponent
|
|
76
|
+
author={page.author}
|
|
77
|
+
date={page.updated_at ? page.updated_at : page.created_at}
|
|
78
|
+
readingTime={page.reading_time}
|
|
79
|
+
reviewer={page.reviewer_id && page.reviewer}
|
|
80
|
+
/>
|
|
71
81
|
)}
|
|
72
82
|
{pathPrefixes && (
|
|
73
|
-
<Search
|
|
83
|
+
<Search
|
|
84
|
+
page={page}
|
|
85
|
+
serverData={serverData}
|
|
86
|
+
allMarkets={pageContext.allMarkets}
|
|
87
|
+
/>
|
|
74
88
|
)}
|
|
75
89
|
{Newsletter && (
|
|
76
90
|
<Suspense fallback={<></>}>
|
|
@@ -343,6 +343,8 @@ export default {
|
|
|
343
343
|
// add reviewer object to page
|
|
344
344
|
if (page.reviewer_id !== null && data.authors[page.reviewer_id]) {
|
|
345
345
|
transformedPages[market][pageType][index].reviewer = data.authors[page.reviewer_id];
|
|
346
|
+
} else {
|
|
347
|
+
transformedPages[market][pageType][index].reviewer = null;
|
|
346
348
|
}
|
|
347
349
|
|
|
348
350
|
// add page styles object to page
|