gatsby-core-theme 40.0.3 → 40.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 +21 -0
- package/gatsby-node.mjs +3 -21
- package/package.json +1 -1
- package/src/components/atoms/admin/bar/index.js +9 -2
- package/src/components/atoms/content-box/content-box.test.js +4 -3
- package/src/components/atoms/disclaimer/disclaimer.test.js +3 -2
- package/src/components/molecules/cookie-modal/index.js +1 -1
- package/src/components/molecules/footer/index.js +3 -3
- package/src/components/molecules/footer/variants/template-one/index.js +1 -1
- package/src/components/molecules/footer/variants/template-one/template-one.test.js +4 -3
- package/src/components/molecules/footer/variants/template-three/index.js +1 -1
- package/src/components/molecules/footer/variants/template-three/template-three.test.js +4 -3
- package/src/components/molecules/footer/variants/template-two/index.js +1 -1
- package/src/components/molecules/footer/variants/template-two/template-two.test.js +4 -3
- package/src/components/organisms/cookie-consent/index.js +1 -1
- package/src/components/organisms/navigation/index.js +1 -1
- package/src/components/pages/tracker/index-ssr.js +2 -1
- package/src/components/pages/tracker-geo/index.js +1 -1
- package/src/helpers/processImageNode.js +32 -11
- package/src/helpers/server-data.js +1 -1
- package/src/pages/preview/index.js +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [40.0.5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v40.0.4...v40.0.5) (2024-10-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* align with the current master ([4c4284a](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/4c4284ab1196266b45f6f30acc84b6ac98c970f4))
|
|
7
|
+
* content module images with data size ([daa7c0f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/daa7c0f5ef0b9a241811ecf2bb0be6bf24d5c95e))
|
|
8
|
+
* new images path ([1b7bfb0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/1b7bfb0569fdd4040373c2a3cb0be7d21789a4b0))
|
|
9
|
+
* preview ([83d0c2f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/83d0c2f6610c926eae74030d12cd19581176a908))
|
|
10
|
+
* preview feature ([37c64ed](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/37c64ed1b1180e9f4258f7d654ace2dbd931f0aa))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
* Merge branch 'tm-4346-content-modules' into 'master' ([5392b4f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5392b4f946755c1219567afa463af6cb99615af1))
|
|
14
|
+
|
|
15
|
+
## [40.0.4](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v40.0.3...v40.0.4) (2024-10-15)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* preview feature ([e01820d](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e01820d1a5a543dd6209c78dd3826d9b13bf3ed4))
|
|
21
|
+
|
|
1
22
|
## [40.0.3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v40.0.2...v40.0.3) (2024-10-15)
|
|
2
23
|
|
|
3
24
|
|
package/gatsby-node.mjs
CHANGED
|
@@ -248,19 +248,6 @@ export const createPages = async ({ actions: { createPage } }, themeOptions) =>
|
|
|
248
248
|
// create every single page
|
|
249
249
|
Object.keys(processed.site_markets).forEach((siteMarket) => {
|
|
250
250
|
if (!processed.pages[siteMarket]['page']) processed.pages[siteMarket]['page'] = [];
|
|
251
|
-
processed.pages[siteMarket]['page'].push({
|
|
252
|
-
meta_title: 'Preview',
|
|
253
|
-
relation_type: 'page',
|
|
254
|
-
path: 'preview',
|
|
255
|
-
template: 'default',
|
|
256
|
-
meta_robots: ['noindex', 'nofollow'],
|
|
257
|
-
sections: {
|
|
258
|
-
main: { modules: [] },
|
|
259
|
-
navigation: { modules: [] },
|
|
260
|
-
sidebar: { modules: [] },
|
|
261
|
-
footer: { modules: [] },
|
|
262
|
-
},
|
|
263
|
-
});
|
|
264
251
|
let count = 0;
|
|
265
252
|
Object.keys(processed.pages[siteMarket]).forEach((pageType) => {
|
|
266
253
|
processed.pages[siteMarket][pageType].forEach((page) => {
|
|
@@ -271,10 +258,7 @@ export const createPages = async ({ actions: { createPage } }, themeOptions) =>
|
|
|
271
258
|
const processedPage = page;
|
|
272
259
|
processedPage.preconnect_links = preconnectLinks;
|
|
273
260
|
|
|
274
|
-
siteSchema =
|
|
275
|
-
page.path === 'preview'
|
|
276
|
-
? (page.siteSchema = Object.values(schemaData || {})[0])
|
|
277
|
-
: schemaData[page['market_id']];
|
|
261
|
+
siteSchema = schemaData[page['market_id']];
|
|
278
262
|
authors = response.authors;
|
|
279
263
|
|
|
280
264
|
// siteInfo, siteSchema and authors are added to page for schemaGenerator()
|
|
@@ -329,8 +313,7 @@ export const createPages = async ({ actions: { createPage } }, themeOptions) =>
|
|
|
329
313
|
path: `/${page.path}`,
|
|
330
314
|
component: `${__dirname}/src/components/app-ssr.js`,
|
|
331
315
|
context: {
|
|
332
|
-
...contextData
|
|
333
|
-
isPreview: page.path === 'preview',
|
|
316
|
+
...contextData
|
|
334
317
|
},
|
|
335
318
|
});
|
|
336
319
|
} else {
|
|
@@ -342,8 +325,7 @@ export const createPages = async ({ actions: { createPage } }, themeOptions) =>
|
|
|
342
325
|
path: page.path.charAt(0) === '/' ? page.path : `/${page.path}`,
|
|
343
326
|
component,
|
|
344
327
|
context: {
|
|
345
|
-
...contextData
|
|
346
|
-
isPreview: page.path === 'preview',
|
|
328
|
+
...contextData
|
|
347
329
|
},
|
|
348
330
|
});
|
|
349
331
|
}
|
package/package.json
CHANGED
|
@@ -136,7 +136,9 @@ const AdminBar = ({ page, marketSections, menu }) => {
|
|
|
136
136
|
)}
|
|
137
137
|
</li>
|
|
138
138
|
<li>
|
|
139
|
-
<span className={`${styles.label} ${styles.labelBorder}`}>
|
|
139
|
+
<span className={`${styles.label} ${styles.labelBorder}`}>
|
|
140
|
+
Footer Section
|
|
141
|
+
</span>
|
|
140
142
|
</li>
|
|
141
143
|
{footerExtraFields && getFooterLinks(footerExtraFields)}
|
|
142
144
|
</ul>
|
|
@@ -168,7 +170,12 @@ const AdminBar = ({ page, marketSections, menu }) => {
|
|
|
168
170
|
className={`${styles.menuItem} ${styles.preview} ${
|
|
169
171
|
!preview ? styles.previewOff : ""
|
|
170
172
|
}`}
|
|
171
|
-
|
|
173
|
+
target={!preview ? "_blank" : ""}
|
|
174
|
+
href={
|
|
175
|
+
!preview
|
|
176
|
+
? `/preview/?path=${page.path}&market_id=${page.market_id}`
|
|
177
|
+
: `/${page.path}`
|
|
178
|
+
}
|
|
172
179
|
rel="noreferrer"
|
|
173
180
|
>
|
|
174
181
|
{preview ? "Preview Mode On" : "Preview Mode Off"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-restricted-syntax */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { render, cleanup } from '@testing-library/react';
|
|
3
4
|
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -7,17 +8,17 @@ import ContentBox from '.';
|
|
|
7
8
|
const info = [
|
|
8
9
|
{
|
|
9
10
|
title: 'Fully licensed casinos',
|
|
10
|
-
image: '
|
|
11
|
+
image: '/images/content-1.png',
|
|
11
12
|
text: 'We only list and review fully licensed and legally operating casinos so you can be sure where you end up playing will be safe and secure.',
|
|
12
13
|
},
|
|
13
14
|
{
|
|
14
15
|
title: 'Get the most for your money',
|
|
15
|
-
image: '
|
|
16
|
+
image: '/images/content-2.png',
|
|
16
17
|
text: 'We list all the features the Casinos have to offer so you can make an educated decision about where to place your money for maximum gains!',
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
20
|
title: 'Authenticly written articles',
|
|
20
|
-
image: '
|
|
21
|
+
image: '/images/content-3.png',
|
|
21
22
|
text: 'All our Authors are professional writers with industry know-how, so you can depend on what we say is the truth!',
|
|
22
23
|
},
|
|
23
24
|
];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-unused-expressions */
|
|
2
|
+
/* eslint-disable no-restricted-syntax */
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { render, cleanup, fireEvent } from '@testing-library/react';
|
|
4
5
|
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -9,10 +10,10 @@ describe('Disclaimer Component', () => {
|
|
|
9
10
|
// eslint-disable-next-line global-require
|
|
10
11
|
const func = require('../../../helpers/device-detect');
|
|
11
12
|
func.isNativeImageLazyLoadingSupported = jest.fn(() => true);
|
|
12
|
-
const { container } = render(<Disclaimer dmcaImage="
|
|
13
|
+
const { container } = render(<Disclaimer dmcaImage="/images/dmca.png" />);
|
|
13
14
|
|
|
14
15
|
expect(container.querySelector('img')).toBeTruthy();
|
|
15
|
-
expect(container.querySelector('img')).toHaveAttribute('src', '
|
|
16
|
+
expect(container.querySelector('img')).toHaveAttribute('src', '/images/dmca.png');
|
|
16
17
|
expect(container.querySelector('img')).toHaveAttribute('loading', 'eager');
|
|
17
18
|
|
|
18
19
|
const Button = container.querySelector('a');
|
|
@@ -47,7 +47,7 @@ const Footer = (props) => {
|
|
|
47
47
|
const getFooterLogos = () => {
|
|
48
48
|
let refactoredFooterLogos = { children: [] };
|
|
49
49
|
|
|
50
|
-
if (footerLogos === null) {
|
|
50
|
+
if (footerLogos === null || !footerLogos.children) {
|
|
51
51
|
refactoredFooterLogos = {
|
|
52
52
|
children: [...page?.page?.responsibleGaming],
|
|
53
53
|
};
|
|
@@ -79,8 +79,8 @@ const Footer = (props) => {
|
|
|
79
79
|
asSeenOn: getExtraField(section?.extra_fields, 'as_seen_on'),
|
|
80
80
|
gamblingText: getExtraField(section?.extra_fields, 'gambling_text'),
|
|
81
81
|
socialIcons: getExtraField(section?.extra_fields, 'social_icons'),
|
|
82
|
-
logo: '
|
|
83
|
-
dmcaImage: '
|
|
82
|
+
logo: '/images/logo.svg',
|
|
83
|
+
dmcaImage: '/images/dmca.png',
|
|
84
84
|
dmcaWidth: 100,
|
|
85
85
|
dmcaHeight: 30,
|
|
86
86
|
securityIcon: <Security />,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-restricted-syntax */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { render, cleanup, waitFor } from '@testing-library/react';
|
|
3
4
|
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -63,7 +64,7 @@ beforeEach(() => {
|
|
|
63
64
|
socialIcons,
|
|
64
65
|
hasDisclaimer: true,
|
|
65
66
|
showCopyright: true,
|
|
66
|
-
logo: '
|
|
67
|
+
logo: '/images/logo.svg',
|
|
67
68
|
securityIcon: <Security />,
|
|
68
69
|
helpText,
|
|
69
70
|
phoneNum,
|
|
@@ -200,13 +201,13 @@ describe('Show Footer', () => {
|
|
|
200
201
|
props = {
|
|
201
202
|
...props,
|
|
202
203
|
showCopyright: false,
|
|
203
|
-
dmcaImage: '
|
|
204
|
+
dmcaImage: '/images/dmca.png',
|
|
204
205
|
};
|
|
205
206
|
const { container } = renderComponent(props);
|
|
206
207
|
expect(container.querySelector('.logos > a').querySelector('img')).toBeTruthy();
|
|
207
208
|
expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
|
|
208
209
|
'src',
|
|
209
|
-
'
|
|
210
|
+
'/images/dmca.png'
|
|
210
211
|
);
|
|
211
212
|
expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
|
|
212
213
|
'loading',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-restricted-syntax */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { render, cleanup, waitFor } from '@testing-library/react';
|
|
3
4
|
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -77,7 +78,7 @@ beforeEach(() => {
|
|
|
77
78
|
socialIcons,
|
|
78
79
|
hasDisclaimer: true,
|
|
79
80
|
showCopyright: true,
|
|
80
|
-
logo: '
|
|
81
|
+
logo: '/images/logo.svg',
|
|
81
82
|
securityIcon: <Security />,
|
|
82
83
|
helpText,
|
|
83
84
|
phoneNum,
|
|
@@ -223,13 +224,13 @@ describe('Show template one', () => {
|
|
|
223
224
|
props = {
|
|
224
225
|
...props,
|
|
225
226
|
showCopyright: false,
|
|
226
|
-
dmcaImage: '
|
|
227
|
+
dmcaImage: '/images/dmca.png',
|
|
227
228
|
};
|
|
228
229
|
const { container } = renderComponent(props);
|
|
229
230
|
expect(container.querySelector('.logos > a').querySelector('img')).toBeTruthy();
|
|
230
231
|
expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
|
|
231
232
|
'src',
|
|
232
|
-
'
|
|
233
|
+
'/images/dmca.png'
|
|
233
234
|
);
|
|
234
235
|
expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
|
|
235
236
|
'loading',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-restricted-syntax */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { render, cleanup, waitFor } from '@testing-library/react';
|
|
3
4
|
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -76,7 +77,7 @@ beforeEach(() => {
|
|
|
76
77
|
socialIcons,
|
|
77
78
|
hasDisclaimer: true,
|
|
78
79
|
showCopyright: true,
|
|
79
|
-
logo: '
|
|
80
|
+
logo: '/images/logo.svg',
|
|
80
81
|
securityIcon: <Security />,
|
|
81
82
|
helpText,
|
|
82
83
|
phoneNum,
|
|
@@ -222,13 +223,13 @@ describe('Show template one', () => {
|
|
|
222
223
|
props = {
|
|
223
224
|
...props,
|
|
224
225
|
showCopyright: false,
|
|
225
|
-
dmcaImage: '
|
|
226
|
+
dmcaImage: '/images/dmca.png',
|
|
226
227
|
};
|
|
227
228
|
const { container } = renderComponent(props);
|
|
228
229
|
expect(container.querySelector('.logos > a').querySelector('img')).toBeTruthy();
|
|
229
230
|
expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
|
|
230
231
|
'src',
|
|
231
|
-
'
|
|
232
|
+
'/images/dmca.png'
|
|
232
233
|
);
|
|
233
234
|
expect(container.querySelector('.logos > a').querySelector('img')).toHaveAttribute(
|
|
234
235
|
'loading',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
2
|
/* eslint-disable react/prop-types */
|
|
3
3
|
/* eslint-disable react/forbid-prop-types */
|
|
4
|
+
/* eslint-disable no-console */
|
|
4
5
|
import React, { useEffect } from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import Button from '~atoms/button/button';
|
|
@@ -19,7 +20,7 @@ const Tracker = ({
|
|
|
19
20
|
bgImage = '',
|
|
20
21
|
bgVideo = '',
|
|
21
22
|
redirectTimer = 3000,
|
|
22
|
-
logo = '
|
|
23
|
+
logo = '/images/logo.svg',
|
|
23
24
|
counter = false,
|
|
24
25
|
isStory = false,
|
|
25
26
|
operatorLogo = false,
|
|
@@ -26,17 +26,38 @@ const processImageNode = (node, moduleWidth = 960, loading) => {
|
|
|
26
26
|
stylesClass = 'alignRight';
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
let imgWidth
|
|
30
|
+
|
|
31
|
+
if (node.attribs.width) {
|
|
32
|
+
imgWidth =
|
|
33
|
+
node.attribs.width > moduleWidth
|
|
34
|
+
? moduleWidth
|
|
35
|
+
: node.attribs.width.replace('px', '')
|
|
36
|
+
} else if (node?.attribs['data-width']) {
|
|
37
|
+
imgWidth =
|
|
38
|
+
node?.attribs['data-width'] > moduleWidth
|
|
39
|
+
? moduleWidth
|
|
40
|
+
: node?.attribs['data-width']?.replace('px', '')
|
|
41
|
+
} else {
|
|
42
|
+
imgWidth = getValueFromStyle(node?.attribs?.style, 'width') || ''
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let imgHeight
|
|
46
|
+
|
|
47
|
+
if (node.attribs.height) {
|
|
48
|
+
imgHeight =
|
|
49
|
+
node.attribs.height === 'auto'
|
|
50
|
+
? '298'
|
|
51
|
+
: node.attribs.height.replace('px', '')
|
|
52
|
+
} else if (node.attribs['data-height']) {
|
|
53
|
+
imgHeight =
|
|
54
|
+
node.attribs['data-height'] === 'auto'
|
|
55
|
+
? '298'
|
|
56
|
+
: node.attribs['data-height'].replace('px', '')
|
|
57
|
+
} else {
|
|
58
|
+
imgHeight = getValueFromStyle(node?.attribs?.style, 'height') || ''
|
|
59
|
+
}
|
|
60
|
+
|
|
40
61
|
|
|
41
62
|
const lazyProps = {
|
|
42
63
|
src: parseContentImageUrl(node.attribs.src, imgWidth, imgHeight),
|
|
@@ -8,7 +8,7 @@ import {getData} from '~helpers/api'
|
|
|
8
8
|
import processor from "./processor/index.mjs";
|
|
9
9
|
import { fetchSiteSettings } from './fetch-site-settings.mjs';
|
|
10
10
|
|
|
11
|
-
export async function getAPIData(page, url, preview) {
|
|
11
|
+
export async function getAPIData(page, url, headers, preview) {
|
|
12
12
|
if (preview) {
|
|
13
13
|
try {
|
|
14
14
|
const siteName = process.env.GATSBY_SITE_NAME;
|
|
@@ -37,7 +37,6 @@ const AppSSR = ({serverData }) => {
|
|
|
37
37
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
38
|
}, []);
|
|
39
39
|
|
|
40
|
-
|
|
41
40
|
return (
|
|
42
41
|
<>
|
|
43
42
|
<MainProvider
|
|
@@ -88,8 +87,7 @@ export async function getServerData(props) {
|
|
|
88
87
|
// eslint-disable-next-line no-shadow
|
|
89
88
|
const { pageContext, url, headers } = props;
|
|
90
89
|
let res = "";
|
|
91
|
-
|
|
92
|
-
res = await getAPIData(pageContext.page, url, headers, preview);
|
|
90
|
+
res = await getAPIData(pageContext.page, url, headers, true);
|
|
93
91
|
|
|
94
92
|
return res;
|
|
95
93
|
}
|