gatsby-core-theme 44.10.1 → 44.10.12-beta.1
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/.ci.yml +1 -0
- package/CHANGELOG.md +101 -0
- package/gatsby-browser.js +3 -145
- package/gatsby-config.js +3 -3
- package/gatsby-node.mjs +7 -1
- package/gatsby-ssr.js +142 -0
- package/package.json +2 -1
- package/src/components/app-ssr.js +16 -18
- package/src/components/atoms/admin/bar/index.js +6 -2
- package/src/components/atoms/admin/button/index.js +4 -3
- package/src/components/atoms/contact-form/index.js +2 -2
- package/src/components/atoms/market-dropdown/index.js +7 -9
- package/src/components/atoms/notifications/index.js +2 -3
- package/src/components/atoms/ratings/index.js +7 -6
- package/src/components/atoms/review-link/index.js +16 -11
- package/src/components/atoms/search/autocomplete/article/index.js +13 -9
- package/src/components/atoms/search/autocomplete/default/index.js +13 -9
- package/src/components/atoms/search/autocomplete/game/index.js +22 -12
- package/src/components/atoms/search/autocomplete/operator/index.js +26 -18
- package/src/components/molecules/bonus/template-one/index.js +15 -2
- package/src/components/molecules/bonus/template-two/index.js +7 -1
- package/src/components/molecules/cookie-modal/index.js +1 -1
- package/src/components/molecules/floating-area/index.js +6 -12
- package/src/components/molecules/footer/index.js +35 -27
- package/src/components/molecules/footer/variants/template-one/template-one.stories.js +70 -67
- package/src/components/molecules/footer/variants/template-one/template-one.test.js +92 -69
- package/src/components/molecules/footer/variants/template-three/template-three.stories.js +4 -4
- package/src/components/molecules/footer/variants/template-three/template-three.test.js +98 -73
- package/src/components/molecules/footer/variants/template-two/template-two.stories.js +3 -3
- package/src/components/molecules/footer/variants/template-two/template-two.test.js +96 -73
- package/src/components/molecules/header/variants/default/template-one/index.js +15 -13
- package/src/components/molecules/header/variants/default/template-one/template-one.test.js +37 -29
- package/src/components/molecules/header/variants/slot/template-one/templateone.test.js +32 -29
- package/src/components/molecules/leave-comment-form/index.js +90 -79
- package/src/components/molecules/main/index.js +5 -7
- package/src/components/molecules/menu/index.js +28 -30
- package/src/components/molecules/newsletter/form/index.js +2 -2
- package/src/components/molecules/newsletter/index.js +23 -19
- package/src/components/molecules/tnc/index.js +4 -2
- package/src/components/organisms/anchor/template-two/index.js +33 -18
- package/src/components/organisms/footer-navigation/index.js +10 -9
- package/src/components/organisms/navigation/navigationContext.js +28 -4
- package/src/components/organisms/search/index.js +17 -4
- package/src/constants/ratings-constant.js +7 -9
- package/src/helpers/getters.mjs +3 -3
- package/src/helpers/processImageNode.js +38 -30
- package/src/helpers/processImageNode.test.js +33 -24
- package/src/helpers/replaceMedia.js +2 -2
- package/src/resolver/games.mjs +1 -1
- package/src/resolver/operators.mjs +23 -13
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
|
-
import React from
|
|
3
|
-
import PropTypes from
|
|
4
|
-
import { FaArrowRight } from
|
|
5
|
-
import LazyImage from
|
|
6
|
-
import { getAltText } from
|
|
7
|
-
import Button from
|
|
8
|
-
import { imagePrettyUrl, getExtraField } from
|
|
9
|
-
import VariableComponent from
|
|
10
|
-
import styles from
|
|
2
|
+
import React from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { FaArrowRight } from "@react-icons/all-files/fa/FaArrowRight";
|
|
5
|
+
import LazyImage from "~hooks/lazy-image";
|
|
6
|
+
import { getAltText } from "~helpers/image";
|
|
7
|
+
import Button from "~atoms/button/button";
|
|
8
|
+
import { imagePrettyUrl, getExtraField } from "~helpers/getters";
|
|
9
|
+
import VariableComponent from "~molecules/header/variants/default/variables";
|
|
10
|
+
import styles from "./template-one.module.scss";
|
|
11
11
|
|
|
12
12
|
export default function TemplateOne({
|
|
13
13
|
page,
|
|
@@ -17,11 +17,11 @@ export default function TemplateOne({
|
|
|
17
17
|
imageObj,
|
|
18
18
|
width = 356,
|
|
19
19
|
height = 343,
|
|
20
|
-
buttonType="secondary",
|
|
21
|
-
buttonSize="m",
|
|
20
|
+
buttonType = "secondary",
|
|
21
|
+
buttonSize = "m",
|
|
22
22
|
hasVariableComponent = false,
|
|
23
23
|
}) {
|
|
24
|
-
const link = getExtraField(extraFields,
|
|
24
|
+
const link = getExtraField(extraFields, "link");
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
27
|
<div className={styles.templateOne}>
|
|
@@ -55,7 +55,9 @@ export default function TemplateOne({
|
|
|
55
55
|
className={styles.image}
|
|
56
56
|
/>
|
|
57
57
|
)}
|
|
58
|
-
{hasVariableComponent &&
|
|
58
|
+
{hasVariableComponent && (
|
|
59
|
+
<VariableComponent page={page} className={styles.variable} />
|
|
60
|
+
)}
|
|
59
61
|
</div>
|
|
60
62
|
);
|
|
61
63
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { render, cleanup } from
|
|
3
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render, cleanup } from "@testing-library/react";
|
|
3
|
+
import "@testing-library/jest-dom/extend-expect";
|
|
4
4
|
|
|
5
|
-
import { getExtraField, imagePrettyUrl } from
|
|
6
|
-
import MainProvider from
|
|
7
|
-
import getPageData from
|
|
8
|
-
import TemplateOne from
|
|
5
|
+
import { getExtraField, imagePrettyUrl } from "~helpers/getters";
|
|
6
|
+
import MainProvider from "~context/MainProvider";
|
|
7
|
+
import getPageData from "../../../../../../../tests/factories/pages/default.factory";
|
|
8
|
+
import TemplateOne from ".";
|
|
9
9
|
|
|
10
10
|
const translations = {
|
|
11
|
-
online_casino:
|
|
11
|
+
online_casino: "Online Casino",
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
function renderComponent(pageData) {
|
|
@@ -35,44 +35,52 @@ let data;
|
|
|
35
35
|
beforeEach(() => {
|
|
36
36
|
data = getPageData();
|
|
37
37
|
});
|
|
38
|
-
describe(
|
|
39
|
-
test(
|
|
38
|
+
describe("Show template one", () => {
|
|
39
|
+
test("render with props", () => {
|
|
40
40
|
const { container } = renderComponent(data);
|
|
41
|
-
|
|
41
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
42
|
+
expect(container.querySelector(".templateOne")).toBeTruthy();
|
|
42
43
|
});
|
|
43
|
-
test(
|
|
44
|
+
test("show correct title", () => {
|
|
44
45
|
const { container } = renderComponent(data);
|
|
45
|
-
expect(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
);
|
|
46
|
+
expect(
|
|
47
|
+
container.querySelector(".headerContainer").querySelector("h1")
|
|
48
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
49
|
+
).toBeTruthy();
|
|
50
|
+
expect(
|
|
51
|
+
container.querySelector(".headerContainer").querySelector("h1").innerHTML
|
|
52
|
+
).toEqual(data.title);
|
|
49
53
|
});
|
|
50
|
-
test(
|
|
54
|
+
test("show correct description", () => {
|
|
51
55
|
const { container } = renderComponent(data);
|
|
52
|
-
expect(
|
|
53
|
-
|
|
54
|
-
);
|
|
56
|
+
expect(
|
|
57
|
+
container.querySelector(".headerContainer").querySelector("div").innerHTML
|
|
58
|
+
).toEqual(data.description);
|
|
55
59
|
});
|
|
56
|
-
test(
|
|
60
|
+
test("show correct url", () => {
|
|
57
61
|
const { container } = renderComponent(data);
|
|
58
62
|
expect(
|
|
59
|
-
container
|
|
60
|
-
|
|
63
|
+
container
|
|
64
|
+
.querySelector(".headerContainer")
|
|
65
|
+
.querySelector("a")
|
|
66
|
+
.innerHTML.split("<svg")[0]
|
|
67
|
+
).toEqual(getExtraField(data?.extra_fields, "link"));
|
|
61
68
|
});
|
|
62
|
-
test(
|
|
69
|
+
test("show correct image", () => {
|
|
63
70
|
const imgObj = data.featured_image_object;
|
|
64
71
|
|
|
65
72
|
// eslint-disable-next-line global-require
|
|
66
|
-
const func = require(
|
|
73
|
+
const func = require("~helpers/device-detect");
|
|
67
74
|
func.isNativeImageLazyLoadingSupported = jest.fn(() => true);
|
|
68
75
|
const { container } = renderComponent(data);
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
expect(container.querySelector(
|
|
72
|
-
|
|
77
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
78
|
+
expect(container.querySelector("img")).toBeTruthy();
|
|
79
|
+
expect(container.querySelector("img")).toHaveAttribute(
|
|
80
|
+
"src",
|
|
73
81
|
imagePrettyUrl(imgObj.filename, 356, 343)
|
|
74
82
|
);
|
|
75
|
-
expect(container.querySelector(
|
|
83
|
+
expect(container.querySelector("img")).toHaveAttribute("loading", "eager");
|
|
76
84
|
});
|
|
77
85
|
});
|
|
78
86
|
afterEach(() => {
|
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { render, cleanup, screen, waitFor } from
|
|
3
|
-
import
|
|
4
|
-
import { imagePrettyUrl } from
|
|
5
|
-
import getPageData from
|
|
6
|
-
import TemplateOne from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render, cleanup, screen, waitFor } from "@testing-library/react";
|
|
3
|
+
import "@testing-library/jest-dom/extend-expect";
|
|
4
|
+
import { imagePrettyUrl } from "~helpers/getters";
|
|
5
|
+
import getPageData from "../../../../../../../tests/factories/pages/slot";
|
|
6
|
+
import TemplateOne from ".";
|
|
7
7
|
|
|
8
|
-
describe(
|
|
9
|
-
test(
|
|
10
|
-
const { container, getByText, getByRole } = render(
|
|
8
|
+
describe("summary component", () => {
|
|
9
|
+
test("render", () => {
|
|
10
|
+
const { container, getByText, getByRole } = render(
|
|
11
|
+
<TemplateOne page={getPageData()} />
|
|
12
|
+
);
|
|
11
13
|
|
|
12
|
-
expect(container.querySelectorAll(
|
|
14
|
+
expect(container.querySelectorAll("div.parentContainer")).toHaveLength(1);
|
|
13
15
|
|
|
14
|
-
const div = getByText(
|
|
16
|
+
const div = getByText("The Slot Title");
|
|
15
17
|
expect(div).toBeInTheDocument();
|
|
16
18
|
|
|
17
|
-
const h1 = getByRole(
|
|
19
|
+
const h1 = getByRole("heading", { level: 1 });
|
|
18
20
|
expect(h1).toBeInTheDocument();
|
|
19
21
|
});
|
|
20
22
|
|
|
21
23
|
const page = {
|
|
22
24
|
relation: {
|
|
23
|
-
name:
|
|
25
|
+
name: "Halloween",
|
|
24
26
|
thumbnail_filename_object: {
|
|
25
|
-
filename:
|
|
26
|
-
alt:
|
|
27
|
+
filename: "image.jpg",
|
|
28
|
+
alt: "Halloween",
|
|
27
29
|
},
|
|
28
30
|
},
|
|
29
31
|
sections: {
|
|
30
32
|
header: {
|
|
31
33
|
modules: [
|
|
32
34
|
{
|
|
33
|
-
name:
|
|
35
|
+
name: "bonus",
|
|
34
36
|
value: {
|
|
35
37
|
bonuses: {
|
|
36
38
|
main: {
|
|
37
|
-
one_liner:
|
|
39
|
+
one_liner:
|
|
40
|
+
"20 Free Spins No Deposit Bonus + 300% & 555 Spins Welcome Bonus",
|
|
38
41
|
},
|
|
39
42
|
},
|
|
40
43
|
logo: {
|
|
41
|
-
filename:
|
|
44
|
+
filename: "1651670485/davincis-gold-casino-logo.png",
|
|
42
45
|
},
|
|
43
|
-
links: { main:
|
|
44
|
-
status:
|
|
46
|
+
links: { main: "test" },
|
|
47
|
+
status: "active",
|
|
45
48
|
},
|
|
46
49
|
},
|
|
47
50
|
],
|
|
@@ -49,29 +52,29 @@ describe('summary component', () => {
|
|
|
49
52
|
},
|
|
50
53
|
};
|
|
51
54
|
|
|
52
|
-
describe(
|
|
53
|
-
it(
|
|
55
|
+
describe("SlotHeader", () => {
|
|
56
|
+
it("should render the image", async () => {
|
|
54
57
|
render(<TemplateOne page={page} />);
|
|
55
|
-
const img = screen.getByAltText(
|
|
58
|
+
const img = screen.getByAltText("Halloween");
|
|
56
59
|
await waitFor(() => expect(img).toBeVisible());
|
|
57
60
|
expect(img).toHaveAttribute(
|
|
58
|
-
|
|
61
|
+
"src",
|
|
59
62
|
imagePrettyUrl(page.relation?.logo?.filename, 170, 170)
|
|
60
63
|
);
|
|
61
|
-
expect(img).toHaveAttribute(
|
|
62
|
-
expect(img).toHaveAttribute(
|
|
64
|
+
expect(img).toHaveAttribute("width", "170");
|
|
65
|
+
expect(img).toHaveAttribute("height", "170");
|
|
63
66
|
});
|
|
64
67
|
|
|
65
|
-
it(
|
|
68
|
+
it("should render the headerBonus logo", async () => {
|
|
66
69
|
render(<TemplateOne page={page} />);
|
|
67
70
|
|
|
68
71
|
await waitFor(() => {
|
|
69
|
-
const bonusText = screen.getByText(
|
|
72
|
+
const bonusText = screen.getByText("Welcome Bonus");
|
|
70
73
|
expect(bonusText).toBeInTheDocument();
|
|
71
74
|
});
|
|
72
75
|
});
|
|
73
76
|
|
|
74
|
-
it(
|
|
77
|
+
it("should render the headerBonus one-liner", () => {
|
|
75
78
|
render(<TemplateOne page={page} />);
|
|
76
79
|
const oneLiner = screen.getByText(/20 Free Spins No Deposit Bonus/);
|
|
77
80
|
expect(oneLiner).toBeInTheDocument();
|
|
@@ -1,94 +1,105 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
2
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3
3
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
4
|
-
import React from
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { commentForm, replyForm } from
|
|
4
|
+
import React from "react";
|
|
5
|
+
import PropTypes from "prop-types";
|
|
6
|
+
import { FaArrowRight } from "@react-icons/all-files/fa/FaArrowRight";
|
|
7
|
+
import Form from "~organisms/form";
|
|
8
|
+
import { commentForm, replyForm } from "../../../constants/forms";
|
|
9
9
|
|
|
10
10
|
const LeaveCommentForm = ({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
page,
|
|
12
|
+
isReply = false,
|
|
13
|
+
parentCommentID = 0,
|
|
14
|
+
showLabels = true,
|
|
15
|
+
showButtonIcon = false,
|
|
16
|
+
buttonLabel = "Add Comment",
|
|
17
|
+
successMessage = "Comment Submitted for Approval",
|
|
18
|
+
failMessage = "Comment Not Added",
|
|
19
|
+
validationMessage = "Fill all required fields",
|
|
20
|
+
buttonIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />,
|
|
21
|
+
titleTag = "h2",
|
|
22
22
|
}) => {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const activeMarket = page?.market;
|
|
24
|
+
const isDev = process.env.NODE_ENV === "development";
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if((cleanedData?.["g-recaptcha-response"] === '' || !cleanedData?.tnc) && !isDev) return;
|
|
40
|
-
|
|
41
|
-
if(parentCommentID) cleanedData.parent_id = parentCommentID;
|
|
26
|
+
const customSubmit = (form, resetForm) => {
|
|
27
|
+
const formData = new FormData(form);
|
|
28
|
+
const data = Object.fromEntries(formData.entries());
|
|
29
|
+
const cleanedData = isReply
|
|
30
|
+
? Object.entries(data).reduce((acc, [key, value]) => {
|
|
31
|
+
if (key.startsWith("post_anonymously_")) acc.post_anonymously = value;
|
|
32
|
+
else if (key.startsWith("tnc_")) acc.tnc = value;
|
|
33
|
+
else acc[key] = value;
|
|
34
|
+
return acc;
|
|
35
|
+
}, {})
|
|
36
|
+
: data;
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
if (
|
|
39
|
+
(cleanedData?.["g-recaptcha-response"] === "" || !cleanedData?.tnc) &&
|
|
40
|
+
!isDev
|
|
41
|
+
)
|
|
42
|
+
return;
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if(!cleanedData?.post_anonymously) cleanedData.author_name = cleanedData?.name;
|
|
50
|
-
if(!cleanedData?.rate) delete cleanedData?.rate;
|
|
44
|
+
if (parentCommentID) cleanedData.parent_id = parentCommentID;
|
|
51
45
|
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
cleanedData.reference_id = page?.id;
|
|
47
|
+
cleanedData.site_id = parseInt(process.env.SITE_ID);
|
|
48
|
+
cleanedData.rate = parseInt(data.rate);
|
|
54
49
|
|
|
55
|
-
|
|
56
|
-
fetch(`${process.env.GATSBY_API_COMMENT_URL}/api/post-comment`, {
|
|
57
|
-
method: 'POST',
|
|
58
|
-
headers: {
|
|
59
|
-
'Content-Type': 'application/json',
|
|
60
|
-
},
|
|
61
|
-
body: JSON.stringify(cleanedData),
|
|
62
|
-
})
|
|
63
|
-
.then(async (response) => {
|
|
64
|
-
if (response.ok) {
|
|
65
|
-
resetForm();
|
|
66
|
-
resolve(response);
|
|
67
|
-
} else {
|
|
68
|
-
const errorData = await response.json().catch(() => ({}));
|
|
69
|
-
reject(errorData?.errors?.join() || response.statusText);
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
.catch((error) => reject(error.message));
|
|
73
|
-
});
|
|
74
|
-
};
|
|
50
|
+
cleanedData.market_short_code = activeMarket;
|
|
75
51
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
52
|
+
if (!cleanedData?.post_anonymously)
|
|
53
|
+
cleanedData.author_name = cleanedData?.name;
|
|
54
|
+
if (!cleanedData?.rate) delete cleanedData?.rate;
|
|
55
|
+
|
|
56
|
+
delete cleanedData?.post_anonymously;
|
|
57
|
+
delete cleanedData?.tnc;
|
|
58
|
+
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
fetch(`${process.env.GATSBY_API_COMMENT_URL}/api/post-comment`, {
|
|
61
|
+
method: "POST",
|
|
62
|
+
headers: {
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
},
|
|
65
|
+
body: JSON.stringify(cleanedData),
|
|
66
|
+
})
|
|
67
|
+
.then(async (response) => {
|
|
68
|
+
if (response.ok) {
|
|
69
|
+
resetForm();
|
|
70
|
+
resolve(response);
|
|
71
|
+
} else {
|
|
72
|
+
const errorData = await response.json().catch(() => ({}));
|
|
73
|
+
reject(errorData?.errors?.join() || response.statusText);
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
.catch((error) => reject(error.message));
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
activeMarket && (
|
|
82
|
+
<Form
|
|
83
|
+
formOptions={
|
|
84
|
+
isReply
|
|
85
|
+
? replyForm[activeMarket] || replyForm.default
|
|
86
|
+
: commentForm[activeMarket] || commentForm.default
|
|
87
|
+
}
|
|
88
|
+
showLabels={showLabels}
|
|
89
|
+
hasButton
|
|
90
|
+
showButtonIcon={showButtonIcon}
|
|
91
|
+
buttonLabel={buttonLabel}
|
|
92
|
+
customeSubmit={customSubmit}
|
|
93
|
+
successMessage={successMessage}
|
|
94
|
+
failMessage={failMessage}
|
|
95
|
+
validationMessage={validationMessage}
|
|
96
|
+
path={page?.path}
|
|
97
|
+
buttonIcon={buttonIcon}
|
|
98
|
+
titleType={titleTag}
|
|
99
|
+
customClass="commentForm"
|
|
100
|
+
/>
|
|
101
|
+
)
|
|
102
|
+
);
|
|
92
103
|
};
|
|
93
104
|
|
|
94
105
|
LeaveCommentForm.propTypes = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { lazy, Suspense } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
-
import { getURLParam } from "
|
|
3
|
+
import { getURLParam } from "~helpers/getters";
|
|
4
4
|
import Module from "~molecules/module";
|
|
5
5
|
import styles from "./main.module.scss";
|
|
6
6
|
import keygen from "~helpers/keygen";
|
|
@@ -29,7 +29,8 @@ const Main = ({
|
|
|
29
29
|
) ||
|
|
30
30
|
exclNewsletter
|
|
31
31
|
) && !process.env?.HIDE_NEWSLETTER;
|
|
32
|
-
const pathPrefixes =
|
|
32
|
+
const pathPrefixes =
|
|
33
|
+
isSearchPath(allMarkets, page.path) || page.template === "search";
|
|
33
34
|
const HtmlSitemap = pageContext.sitemapData
|
|
34
35
|
? lazy(() => import(`~atoms/sitemap`))
|
|
35
36
|
: null;
|
|
@@ -37,7 +38,7 @@ const Main = ({
|
|
|
37
38
|
const NotFound = page?.path?.includes("404")
|
|
38
39
|
? lazy(() => import(`~atoms/not-found`))
|
|
39
40
|
: null;
|
|
40
|
-
|
|
41
|
+
|
|
41
42
|
const Newsletter = showNewsletter
|
|
42
43
|
? lazy(() => import("~molecules/newsletter"))
|
|
43
44
|
: null;
|
|
@@ -83,10 +84,7 @@ const Main = ({
|
|
|
83
84
|
/>
|
|
84
85
|
)}
|
|
85
86
|
{pathPrefixes && (
|
|
86
|
-
<Search
|
|
87
|
-
serverData={serverData}
|
|
88
|
-
pageContext={pageContext}
|
|
89
|
-
/>
|
|
87
|
+
<Search serverData={serverData} pageContext={pageContext} />
|
|
90
88
|
)}
|
|
91
89
|
{Newsletter && (
|
|
92
90
|
<Suspense fallback={<></>}>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable arrow-body-style */
|
|
2
2
|
import React, { useContext, useRef } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import MegaItems from
|
|
5
|
-
import Items from
|
|
4
|
+
import MegaItems from "~atoms/menu/mega-items";
|
|
5
|
+
import Items from "~atoms/menu/items";
|
|
6
6
|
|
|
7
7
|
import MenuIcon from "~atoms/menu/menu-icon";
|
|
8
8
|
import { NavigationContext } from "~organisms/navigation/navigationContext";
|
|
@@ -22,10 +22,10 @@ const Menu = ({
|
|
|
22
22
|
mobileAnimation = "collapseFull",
|
|
23
23
|
stopScrollOnOpen = true,
|
|
24
24
|
canOpenAllSubMenus = true,
|
|
25
|
-
enableMegaMenu = false
|
|
25
|
+
enableMegaMenu = false,
|
|
26
26
|
}) => {
|
|
27
27
|
let menuObject;
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
const currentPagePath = pageContext?.page?.path;
|
|
30
30
|
|
|
31
31
|
const menuListRef = useRef(React.createRef());
|
|
@@ -73,30 +73,28 @@ const Menu = ({
|
|
|
73
73
|
{menuObject &&
|
|
74
74
|
menuObject?.children?.map((child) => {
|
|
75
75
|
const level = 1;
|
|
76
|
-
return (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
/>
|
|
99
|
-
)
|
|
76
|
+
return enableMegaMenu ? (
|
|
77
|
+
<MegaItems
|
|
78
|
+
toplist={toplistModule}
|
|
79
|
+
menuListRef={menuListRef}
|
|
80
|
+
gtmClass={gtmClass}
|
|
81
|
+
key={keygen()}
|
|
82
|
+
item={child}
|
|
83
|
+
canOpenAllSubMenus={canOpenAllSubMenus}
|
|
84
|
+
level={level}
|
|
85
|
+
/>
|
|
86
|
+
) : (
|
|
87
|
+
<Items
|
|
88
|
+
currentPage={currentPagePath}
|
|
89
|
+
toplist={toplistModule}
|
|
90
|
+
menuListRef={menuListRef}
|
|
91
|
+
orientation={orientation}
|
|
92
|
+
gtmClass={gtmClass}
|
|
93
|
+
key={keygen()}
|
|
94
|
+
item={child}
|
|
95
|
+
canOpenAllSubMenus={canOpenAllSubMenus}
|
|
96
|
+
level={level}
|
|
97
|
+
/>
|
|
100
98
|
);
|
|
101
99
|
})}
|
|
102
100
|
</ul>
|
|
@@ -107,8 +105,8 @@ const Menu = ({
|
|
|
107
105
|
Menu.propTypes = {
|
|
108
106
|
pageContext: PropTypes.shape({
|
|
109
107
|
page: PropTypes.shape({
|
|
110
|
-
path: PropTypes.string
|
|
111
|
-
})
|
|
108
|
+
path: PropTypes.string,
|
|
109
|
+
}),
|
|
112
110
|
}),
|
|
113
111
|
section: PropTypes.shape({
|
|
114
112
|
modules: PropTypes.arrayOf(
|
|
@@ -4,7 +4,7 @@ import React, { useState, useEffect } from "react";
|
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import { FaArrowRight } from "@react-icons/all-files/fa/FaArrowRight";
|
|
6
6
|
|
|
7
|
-
import { getUrl } from "
|
|
7
|
+
import { getUrl } from "~helpers/getters";
|
|
8
8
|
import Form from "../../../organisms/form";
|
|
9
9
|
import { newsLetterForm } from "../../../../constants/forms";
|
|
10
10
|
import useTranslate from "~hooks/useTranslate/useTranslate";
|
|
@@ -32,7 +32,7 @@ const NewsletterForm = ({
|
|
|
32
32
|
})
|
|
33
33
|
.then((response) => response.json())
|
|
34
34
|
.then((data) => {
|
|
35
|
-
setIP(data.ip)
|
|
35
|
+
setIP(data.ip);
|
|
36
36
|
})
|
|
37
37
|
.catch((err) => {
|
|
38
38
|
// eslint-disable-next-line no-console
|