gatsby-core-theme 44.10.0 → 44.10.11
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 +97 -0
- package/gatsby-config.js +3 -3
- package/gatsby-node.mjs +1 -0
- package/package.json +1 -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/index.js +12 -19
- 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
|
@@ -95,7 +95,13 @@ export default function TemplateOne({
|
|
|
95
95
|
)}
|
|
96
96
|
|
|
97
97
|
<BonusBox moduleName={moduleName} item={operator} tracker={module?.type || "main"} pageTemplate={pageTemplate} />
|
|
98
|
-
{!tncFixed &&
|
|
98
|
+
{!tncFixed && (
|
|
99
|
+
<Tnc
|
|
100
|
+
isFixed={tncFixed}
|
|
101
|
+
operator={operator}
|
|
102
|
+
tracker={module?.type || "main"}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
99
105
|
</div>
|
|
100
106
|
</div>
|
|
101
107
|
|
|
@@ -4,7 +4,7 @@ import React, { useState, useRef, useEffect } from "react";
|
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
|
|
6
6
|
import { MdClose } from "@react-icons/all-files/md/MdClose";
|
|
7
|
-
import Link from "
|
|
7
|
+
import Link from "~hooks/link";
|
|
8
8
|
import useTranslate from "~hooks/useTranslate/useTranslate";
|
|
9
9
|
import LazyImage from "~hooks/lazy-image";
|
|
10
10
|
|
|
@@ -23,8 +23,8 @@ export default function FloatingArea({
|
|
|
23
23
|
pageContext,
|
|
24
24
|
template,
|
|
25
25
|
offsetTop = 400,
|
|
26
|
-
showCookies=true,
|
|
27
|
-
customCookieContent
|
|
26
|
+
showCookies = true,
|
|
27
|
+
customCookieContent,
|
|
28
28
|
}) {
|
|
29
29
|
const showScroll = isSticky(offsetTop);
|
|
30
30
|
const [closedBanner, setClosedBanner] = useState(false);
|
|
@@ -52,21 +52,15 @@ export default function FloatingArea({
|
|
|
52
52
|
|
|
53
53
|
const OperatorBanner =
|
|
54
54
|
operatorData && showOperatorBanner(operatorData, pageTemplate)
|
|
55
|
-
? lazy(() =>
|
|
56
|
-
import(
|
|
57
|
-
`gatsby-core-theme/src/components/molecules/bonus/template-two`
|
|
58
|
-
)
|
|
59
|
-
)
|
|
55
|
+
? lazy(() => import(`~molecules/bonus/template-two`))
|
|
60
56
|
: null;
|
|
61
57
|
|
|
62
58
|
const FooterNavigation =
|
|
63
59
|
(pageTypes?.[pageTemplate]?.footerNavigation ||
|
|
64
|
-
|
|
60
|
+
pageTypes.default?.footerNavigation) &&
|
|
65
61
|
footerNavigationData &&
|
|
66
62
|
footerNavigationData?.modules?.length > 0
|
|
67
|
-
? lazy(() =>
|
|
68
|
-
import(`gatsby-core-theme/src/components/organisms/footer-navigation`)
|
|
69
|
-
)
|
|
63
|
+
? lazy(() => import(`~organisms/footer-navigation`))
|
|
70
64
|
: null;
|
|
71
65
|
|
|
72
66
|
return (
|
|
@@ -148,5 +142,5 @@ FloatingArea.propTypes = {
|
|
|
148
142
|
offsetTop: PropTypes.number,
|
|
149
143
|
template: PropTypes.string,
|
|
150
144
|
showCookies: PropTypes.bool,
|
|
151
|
-
customCookieContent: PropTypes.node
|
|
145
|
+
customCookieContent: PropTypes.node,
|
|
152
146
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import React, { lazy, Suspense } from
|
|
1
|
+
import React, { lazy, Suspense } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
-
import { getExtraField } from
|
|
4
|
-
import { generatePlaceholderString } from
|
|
5
|
-
import Security from
|
|
3
|
+
import { getExtraField } from "~helpers/getters";
|
|
4
|
+
import { generatePlaceholderString } from "~helpers/generators.mjs";
|
|
5
|
+
import Security from "~images/icons/security";
|
|
6
6
|
|
|
7
7
|
export const footerContent = (props) => {
|
|
8
8
|
let ModuleComponent = null;
|
|
9
9
|
|
|
10
10
|
switch (props.footerTemplate) {
|
|
11
|
-
case
|
|
12
|
-
ModuleComponent = lazy(() => import(
|
|
11
|
+
case "template_one":
|
|
12
|
+
ModuleComponent = lazy(() => import("./variants/template-one"));
|
|
13
13
|
return <ModuleComponent {...props} />;
|
|
14
|
-
case
|
|
15
|
-
ModuleComponent = lazy(() => import(
|
|
14
|
+
case "template_two":
|
|
15
|
+
ModuleComponent = lazy(() => import("./variants/template-two"));
|
|
16
16
|
return <ModuleComponent {...props} />;
|
|
17
|
-
case
|
|
18
|
-
ModuleComponent = lazy(() => import(
|
|
17
|
+
case "template_three":
|
|
18
|
+
ModuleComponent = lazy(() => import("./variants/template-three"));
|
|
19
19
|
return <ModuleComponent {...props} />;
|
|
20
20
|
default:
|
|
21
|
-
ModuleComponent = lazy(() => import(
|
|
21
|
+
ModuleComponent = lazy(() => import("./variants/template-one"));
|
|
22
22
|
return <ModuleComponent {...props} />;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const Footer = (props) => {
|
|
27
|
-
const { template
|
|
27
|
+
const { template, page, section } = props;
|
|
28
28
|
|
|
29
29
|
const helpText = `
|
|
30
30
|
<p>
|
|
@@ -42,7 +42,7 @@ const Footer = (props) => {
|
|
|
42
42
|
in order to get help.
|
|
43
43
|
</p>`;
|
|
44
44
|
|
|
45
|
-
const footerLogos = getExtraField(section?.extra_fields,
|
|
45
|
+
const footerLogos = getExtraField(section?.extra_fields, "logos");
|
|
46
46
|
|
|
47
47
|
const getFooterLogos = () => {
|
|
48
48
|
let refactoredFooterLogos = { children: [] };
|
|
@@ -62,31 +62,38 @@ const Footer = (props) => {
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
const helpline = () => {
|
|
65
|
-
if (getExtraField(section?.extra_fields,
|
|
66
|
-
return generatePlaceholderString(
|
|
65
|
+
if (getExtraField(section?.extra_fields, "helpline")) {
|
|
66
|
+
return generatePlaceholderString(
|
|
67
|
+
getExtraField(section?.extra_fields, "helpline")
|
|
68
|
+
);
|
|
67
69
|
}
|
|
68
70
|
return null;
|
|
69
71
|
};
|
|
70
72
|
|
|
71
73
|
props = {
|
|
72
74
|
...props,
|
|
73
|
-
showLinks: template !==
|
|
74
|
-
copyrightDisclaimer: getExtraField(
|
|
75
|
-
|
|
75
|
+
showLinks: template !== "ppc",
|
|
76
|
+
copyrightDisclaimer: getExtraField(
|
|
77
|
+
section?.extra_fields,
|
|
78
|
+
"copyright_disclaimer"
|
|
79
|
+
),
|
|
80
|
+
footerLogos: page?.page?.responsibleGaming?.length
|
|
81
|
+
? getFooterLogos()
|
|
82
|
+
: footerLogos,
|
|
76
83
|
hasDisclaimer: true,
|
|
77
84
|
showCopyright: true,
|
|
78
|
-
footerMenu: getExtraField(section?.extra_fields,
|
|
79
|
-
asSeenOn: getExtraField(section?.extra_fields,
|
|
80
|
-
gamblingText: getExtraField(section?.extra_fields,
|
|
81
|
-
socialIcons: getExtraField(section?.extra_fields,
|
|
82
|
-
logo:
|
|
83
|
-
dmcaImage:
|
|
85
|
+
footerMenu: getExtraField(section?.extra_fields, "links"),
|
|
86
|
+
asSeenOn: getExtraField(section?.extra_fields, "as_seen_on"),
|
|
87
|
+
gamblingText: getExtraField(section?.extra_fields, "gambling_text"),
|
|
88
|
+
socialIcons: getExtraField(section?.extra_fields, "social_icons"),
|
|
89
|
+
logo: "/images/logo.svg",
|
|
90
|
+
dmcaImage: "/images/dmca.png",
|
|
84
91
|
dmcaWidth: 100,
|
|
85
92
|
dmcaHeight: 30,
|
|
86
93
|
securityIcon: <Security />,
|
|
87
94
|
helpText,
|
|
88
95
|
phoneNum: helpline(),
|
|
89
|
-
copyrightCustomText: getExtraField(section?.extra_fields,
|
|
96
|
+
copyrightCustomText: getExtraField(section?.extra_fields, "copyright_text"),
|
|
90
97
|
};
|
|
91
98
|
|
|
92
99
|
return <Suspense fallback={<></>}>{footerContent(props)}</Suspense>;
|
|
@@ -102,6 +109,7 @@ Footer.propTypes = {
|
|
|
102
109
|
page: PropTypes.shape({
|
|
103
110
|
page: PropTypes.shape({
|
|
104
111
|
responsibleGaming: PropTypes.arrayOf(PropTypes.shape({})),
|
|
105
|
-
})
|
|
112
|
+
}),
|
|
106
113
|
}),
|
|
107
|
-
}
|
|
114
|
+
};
|
|
115
|
+
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
import React from
|
|
2
|
+
import React from "react";
|
|
3
3
|
import {
|
|
4
4
|
Title,
|
|
5
5
|
Description,
|
|
6
6
|
Primary,
|
|
7
7
|
PRIMARY_STORY,
|
|
8
8
|
ArgsTable,
|
|
9
|
-
} from
|
|
10
|
-
import { getExtraField } from
|
|
11
|
-
import getFooterData from
|
|
12
|
-
import Security from
|
|
9
|
+
} from "@storybook/addon-docs/blocks";
|
|
10
|
+
import { getExtraField } from "~helpers/getters";
|
|
11
|
+
import getFooterData from "../../../../../../tests/factories/modules/footer.factory";
|
|
12
|
+
import Security from "~images/icons/security";
|
|
13
13
|
import logo from "../../../../../../static/images/logo.svg";
|
|
14
|
-
import dmca from
|
|
15
|
-
import TemplateThree from
|
|
14
|
+
import dmca from "../../../../../../static/images/dmca.png";
|
|
15
|
+
import TemplateThree from ".";
|
|
16
16
|
|
|
17
17
|
const footerData = getFooterData();
|
|
18
18
|
const helpText = `
|
|
@@ -31,119 +31,122 @@ const helpText = `
|
|
|
31
31
|
in order to get help.
|
|
32
32
|
</p>`;
|
|
33
33
|
|
|
34
|
-
const phoneNum =
|
|
34
|
+
const phoneNum = "- 89 241 5401";
|
|
35
35
|
|
|
36
36
|
export default {
|
|
37
|
-
title:
|
|
37
|
+
title: "Theme/Layout/Footer/Template One",
|
|
38
38
|
component: TemplateThree,
|
|
39
39
|
argTypes: {
|
|
40
40
|
footerLogos: {
|
|
41
|
-
name:
|
|
42
|
-
type: { name:
|
|
43
|
-
defaultValue: getExtraField(footerData?.extra_fields,
|
|
44
|
-
description:
|
|
41
|
+
name: "footerLogos",
|
|
42
|
+
type: { name: "object", required: true },
|
|
43
|
+
defaultValue: getExtraField(footerData?.extra_fields, "logos"),
|
|
44
|
+
description: "footer logos",
|
|
45
45
|
},
|
|
46
46
|
footerMenu: {
|
|
47
|
-
name:
|
|
48
|
-
type: { name:
|
|
49
|
-
defaultValue: getExtraField(footerData?.extra_fields,
|
|
50
|
-
description:
|
|
47
|
+
name: "footerMenu",
|
|
48
|
+
type: { name: "object", required: true },
|
|
49
|
+
defaultValue: getExtraField(footerData?.extra_fields, "links"),
|
|
50
|
+
description: "footer menu",
|
|
51
51
|
},
|
|
52
52
|
copyrightDisclaimer: {
|
|
53
|
-
name:
|
|
54
|
-
type: { name:
|
|
55
|
-
defaultValue: getExtraField(
|
|
56
|
-
|
|
53
|
+
name: "copyrightDisclaimer",
|
|
54
|
+
type: { name: "string", required: true },
|
|
55
|
+
defaultValue: getExtraField(
|
|
56
|
+
footerData?.extra_fields,
|
|
57
|
+
"copyright_disclaimer"
|
|
58
|
+
),
|
|
59
|
+
description: "copyright disclaimer",
|
|
57
60
|
},
|
|
58
61
|
showLinks: {
|
|
59
|
-
name:
|
|
60
|
-
type: { name:
|
|
62
|
+
name: "showLinks",
|
|
63
|
+
type: { name: "boolean", required: true },
|
|
61
64
|
defaultValue: true,
|
|
62
|
-
description:
|
|
65
|
+
description: "show footer links?",
|
|
63
66
|
},
|
|
64
67
|
asSeenOn: {
|
|
65
|
-
name:
|
|
66
|
-
type: { name:
|
|
67
|
-
defaultValue: getExtraField(footerData?.extra_fields,
|
|
68
|
-
description:
|
|
68
|
+
name: "asSeenOn",
|
|
69
|
+
type: { name: "object", required: true },
|
|
70
|
+
defaultValue: getExtraField(footerData?.extra_fields, "as_seen_on"),
|
|
71
|
+
description: "footer as seen on logos",
|
|
69
72
|
},
|
|
70
73
|
gamblingText: {
|
|
71
|
-
name:
|
|
72
|
-
type: { name:
|
|
73
|
-
defaultValue: getExtraField(footerData?.extra_fields,
|
|
74
|
-
description:
|
|
74
|
+
name: "gamblingText",
|
|
75
|
+
type: { name: "object", required: true },
|
|
76
|
+
defaultValue: getExtraField(footerData?.extra_fields, "gambling_text"),
|
|
77
|
+
description: "Gambling Text",
|
|
75
78
|
},
|
|
76
79
|
socialIcons: {
|
|
77
|
-
name:
|
|
78
|
-
type: { name:
|
|
79
|
-
defaultValue: getExtraField(footerData?.extra_fields,
|
|
80
|
-
description:
|
|
80
|
+
name: "socialIcons",
|
|
81
|
+
type: { name: "object", required: true },
|
|
82
|
+
defaultValue: getExtraField(footerData?.extra_fields, "social_icons"),
|
|
83
|
+
description: "footer logos",
|
|
81
84
|
},
|
|
82
85
|
hasFooterLinks: {
|
|
83
|
-
name:
|
|
84
|
-
type: { name:
|
|
86
|
+
name: "hasFooterLinks",
|
|
87
|
+
type: { name: "boolean", required: true },
|
|
85
88
|
defaultValue: false,
|
|
86
|
-
description:
|
|
89
|
+
description: "has footer links on mobile?",
|
|
87
90
|
},
|
|
88
91
|
hasDisclaimer: {
|
|
89
|
-
name:
|
|
90
|
-
type: { name:
|
|
92
|
+
name: "hasDisclaimer",
|
|
93
|
+
type: { name: "boolean", required: true },
|
|
91
94
|
defaultValue: true,
|
|
92
|
-
description:
|
|
95
|
+
description: "has Disclaimer?",
|
|
93
96
|
},
|
|
94
97
|
showCopyright: {
|
|
95
|
-
name:
|
|
96
|
-
type: { name:
|
|
98
|
+
name: "showCopyright",
|
|
99
|
+
type: { name: "boolean", required: true },
|
|
97
100
|
defaultValue: true,
|
|
98
|
-
description:
|
|
101
|
+
description: "show Copyright?",
|
|
99
102
|
},
|
|
100
103
|
helpText: {
|
|
101
|
-
name:
|
|
102
|
-
type: { name:
|
|
104
|
+
name: "helpText",
|
|
105
|
+
type: { name: "string", required: true },
|
|
103
106
|
defaultValue: helpText,
|
|
104
|
-
description:
|
|
107
|
+
description: "helpText",
|
|
105
108
|
},
|
|
106
109
|
phoneNum: {
|
|
107
|
-
name:
|
|
108
|
-
type: { name:
|
|
110
|
+
name: "phoneNum",
|
|
111
|
+
type: { name: "string", required: true },
|
|
109
112
|
defaultValue: phoneNum,
|
|
110
|
-
description:
|
|
113
|
+
description: "phone number",
|
|
111
114
|
},
|
|
112
115
|
logo: {
|
|
113
|
-
name:
|
|
114
|
-
type: { name:
|
|
116
|
+
name: "logo",
|
|
117
|
+
type: { name: "string", required: true },
|
|
115
118
|
defaultValue: logo,
|
|
116
|
-
description:
|
|
119
|
+
description: "site logo",
|
|
117
120
|
},
|
|
118
121
|
dmcaImage: {
|
|
119
|
-
name:
|
|
120
|
-
type: { name:
|
|
122
|
+
name: "dmcaImage",
|
|
123
|
+
type: { name: "string", required: true },
|
|
121
124
|
defaultValue: dmca,
|
|
122
|
-
description:
|
|
125
|
+
description: "site dmca image path",
|
|
123
126
|
},
|
|
124
127
|
dmcaWidth: {
|
|
125
|
-
name:
|
|
126
|
-
type: { name:
|
|
128
|
+
name: "dmcaWidth",
|
|
129
|
+
type: { name: "number", required: true },
|
|
127
130
|
defaultValue: 100,
|
|
128
|
-
description:
|
|
131
|
+
description: "site dmca image width",
|
|
129
132
|
},
|
|
130
133
|
dmcaHeight: {
|
|
131
|
-
name:
|
|
132
|
-
type: { name:
|
|
134
|
+
name: "dmcaImage",
|
|
135
|
+
type: { name: "number", required: true },
|
|
133
136
|
defaultValue: 33,
|
|
134
|
-
description:
|
|
137
|
+
description: "site dmca image height",
|
|
135
138
|
},
|
|
136
139
|
securityIcon: {
|
|
137
|
-
name:
|
|
138
|
-
type: { name:
|
|
140
|
+
name: "securityIcon",
|
|
141
|
+
type: { name: "element", required: true },
|
|
139
142
|
defaultValue: <Security />,
|
|
140
|
-
description:
|
|
143
|
+
description: "site security icon",
|
|
141
144
|
},
|
|
142
145
|
},
|
|
143
146
|
parameters: {
|
|
144
147
|
docs: {
|
|
145
148
|
description: {
|
|
146
|
-
component:
|
|
149
|
+
component: "A Default Footer Component - Template One",
|
|
147
150
|
},
|
|
148
151
|
page: () => (
|
|
149
152
|
<>
|