gatsby-core-theme 1.3.0 → 1.4.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/.storybook/main.js +2 -3
- package/.storybook/preview.js +1 -4
- package/CHANGELOG.md +94 -0
- package/gatsby-node.esm.js +59 -19
- package/jest.config.js +1 -0
- package/package.json +1 -1
- package/src/components/app.js +12 -7
- package/src/components/atoms/archive/items/index.js +1 -1
- package/src/components/atoms/author/index.js +3 -2
- package/src/components/atoms/author-box/author-box.test.js +1 -5
- package/src/components/atoms/author-box/index.js +42 -13
- package/src/components/atoms/breadcrumbs/index.js +8 -4
- package/src/components/atoms/button/button.test.js +7 -0
- package/src/components/atoms/button/index.js +10 -3
- package/src/components/atoms/carousel/arrow/index.js +3 -2
- package/src/components/atoms/carousel/pagination-item/index.js +3 -2
- package/src/components/atoms/collapse/index.js +3 -1
- package/src/components/atoms/custom-select/index.js +2 -1
- package/src/components/atoms/logo/index.js +2 -2
- package/src/components/atoms/menu/items/index.js +6 -0
- package/src/components/atoms/menu/items/item/index.js +5 -4
- package/src/components/atoms/menu/menu-icon/index.js +4 -4
- package/src/components/atoms/module-title/index.js +2 -1
- package/src/components/atoms/not-found/index.js +14 -0
- package/src/components/atoms/not-found/not-found.module.scss +16 -0
- package/src/components/atoms/open-graph/index.js +5 -5
- package/src/components/atoms/operator-cta/index.js +15 -5
- package/src/components/atoms/operator-cta/{operator-cta.test.disabled.js → operator-cta.test.js} +12 -1
- package/src/components/atoms/operator-info-block/index.js +8 -1
- package/src/components/atoms/search/autocomplete/operator.js +1 -1
- package/src/components/atoms/spotlights/index.js +15 -4
- package/src/components/molecules/carousel/default-slide/index.js +4 -0
- package/src/components/molecules/counter/index.js +2 -2
- package/src/components/molecules/footer/index.js +6 -2
- package/src/components/molecules/header/header.test.js +0 -1
- package/src/components/molecules/link-list/index.js +9 -1
- package/src/components/molecules/main/index.js +3 -1
- package/src/components/molecules/menu/index.js +5 -1
- package/src/components/molecules/operator-banner/index.js +17 -7
- package/src/components/molecules/operator-banner/operator-banner.test.js +1 -1
- package/src/components/molecules/pagination/index.js +16 -5
- package/src/components/molecules/pagination/pagination.test.js +3 -3
- package/src/components/molecules/pagination/with-midpoints.js +41 -17
- package/src/components/molecules/pagination/with-midpoints.test.js +7 -8
- package/src/components/molecules/search/index.js +14 -3
- package/src/components/molecules/slider/index.js +27 -3
- package/src/components/molecules/toplist/default-row/index.js +27 -4
- package/src/components/organisms/accordion/accordion.test.js +3 -3
- package/src/components/organisms/accordion/index.js +1 -1
- package/src/components/organisms/anchor/index.js +2 -1
- package/src/components/organisms/archive/archive.test.js +8 -1
- package/src/components/organisms/archive/index.js +12 -12
- package/src/components/organisms/cards/cards.stories.js +1 -0
- package/src/components/organisms/cards/index.js +1 -1
- package/src/components/organisms/carousel/index.js +16 -17
- package/src/components/organisms/cookie-consent/cookie-consent.stories.js +6 -1
- package/src/components/organisms/cookie-consent/index.js +2 -0
- package/src/components/organisms/form/index.js +1 -0
- package/src/components/organisms/navigation/index.js +4 -4
- package/src/components/organisms/search/index.js +1 -1
- package/src/components/organisms/toplist/index.js +15 -19
- package/src/components/organisms/toplist/list/index.js +22 -29
- package/src/components/pages/body/index.js +9 -5
- package/src/components/pages/search/index.js +36 -1
- package/src/components/pages/tracker/index.js +8 -4
- package/src/constants/pick-keys.js +2 -0
- package/src/context/TranslationsProvider.js +9 -0
- package/src/helpers/processor/index.js +20 -3
- package/src/helpers/processor/processor.test.js +14 -0
- package/src/hooks/lazy-image/lazy-image.stories.js +1 -0
- package/src/hooks/link/index.js +2 -0
- package/src/hooks/link/link.test.js +9 -0
- package/src/hooks/modal/modal-content.js +7 -3
- package/src/hooks/modal/modal.test.js +3 -2
- package/src/hooks/tabs/index.js +4 -1
- package/src/hooks/tabs/tab/tab-list.js +4 -1
- package/src/hooks/tabs/tab/tab.js +11 -2
- package/src/pages/sitemap/index.js +77 -0
- package/src/pages/sitemap/sitemap.module.scss +21 -0
- package/tests/factories/relations/operator.factory.js +33 -0
|
@@ -2,7 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styles from './tab.module.scss';
|
|
4
4
|
|
|
5
|
-
const Tab = ({
|
|
5
|
+
const Tab = ({
|
|
6
|
+
label,
|
|
7
|
+
onClick,
|
|
8
|
+
activeTab,
|
|
9
|
+
activeTabClass = '',
|
|
10
|
+
tabId,
|
|
11
|
+
toggleDropdown,
|
|
12
|
+
gtmClass = '',
|
|
13
|
+
}) => {
|
|
6
14
|
let className = '';
|
|
7
15
|
|
|
8
16
|
if (activeTab === tabId) {
|
|
@@ -16,7 +24,7 @@ const Tab = ({ label, onClick, activeTab, activeTabClass = '', tabId, toggleDrop
|
|
|
16
24
|
return (
|
|
17
25
|
<li className={styles.tabListItem}>
|
|
18
26
|
<button
|
|
19
|
-
className={className}
|
|
27
|
+
className={`${className} ${gtmClass} tabs-menu-gtm btn-cta`}
|
|
20
28
|
type="button"
|
|
21
29
|
onClick={() => {
|
|
22
30
|
onClick(tabId);
|
|
@@ -35,6 +43,7 @@ Tab.propTypes = {
|
|
|
35
43
|
activeTabClass: PropTypes.string,
|
|
36
44
|
tabId: PropTypes.string,
|
|
37
45
|
label: PropTypes.string,
|
|
46
|
+
gtmClass: PropTypes.string,
|
|
38
47
|
};
|
|
39
48
|
|
|
40
49
|
export default Tab;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* eslint-disable array-callback-return */
|
|
2
|
+
/* eslint-disable react/forbid-prop-types */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import styles from './sitemap.module.scss';
|
|
6
|
+
import Body from '~pages/body';
|
|
7
|
+
import Head from '~organisms/head';
|
|
8
|
+
import Link from '~hooks/link';
|
|
9
|
+
|
|
10
|
+
const Sitemap = ({ pageContext, templateIcon, linkIcon }) => {
|
|
11
|
+
const { templates, sitemapData } = pageContext;
|
|
12
|
+
const market = Object.keys(sitemapData)[0];
|
|
13
|
+
|
|
14
|
+
const getTemplateName = (template) => {
|
|
15
|
+
const templateName = templates[template].short_name;
|
|
16
|
+
const templatePages = sitemapData[market][template];
|
|
17
|
+
const templatePagesCount = templatePages && templatePages.length;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
templatePagesCount !== undefined && (
|
|
21
|
+
<div>
|
|
22
|
+
{templateIcon && templateIcon}
|
|
23
|
+
<span>{templateName}</span>
|
|
24
|
+
<span>{templatePagesCount}</span>
|
|
25
|
+
</div>
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getTemplatePages = (template) => {
|
|
31
|
+
if (sitemapData[market][template]) {
|
|
32
|
+
const pageList = Object.keys(sitemapData[market][template]).map((page) => {
|
|
33
|
+
if (page !== undefined) {
|
|
34
|
+
const pageObj = sitemapData[market][template][page];
|
|
35
|
+
return (
|
|
36
|
+
<li>
|
|
37
|
+
{linkIcon && linkIcon}
|
|
38
|
+
<Link to={pageObj.path} title={pageObj.title}>
|
|
39
|
+
{pageObj.title}
|
|
40
|
+
</Link>
|
|
41
|
+
</li>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return <ul>{pageList}</ul>;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<Head page={pageContext.page} siteInfo={pageContext.siteInfo} />
|
|
52
|
+
<Body pageContext={pageContext}>
|
|
53
|
+
<div className={styles.container}>
|
|
54
|
+
{Object.keys(templates).map((template) => (
|
|
55
|
+
<ul key={template} className={styles.list}>
|
|
56
|
+
{getTemplateName(template)}
|
|
57
|
+
{getTemplatePages(template)}
|
|
58
|
+
</ul>
|
|
59
|
+
))}
|
|
60
|
+
</div>
|
|
61
|
+
</Body>
|
|
62
|
+
</>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
Sitemap.propTypes = {
|
|
67
|
+
pageContext: PropTypes.shape({
|
|
68
|
+
sitemapData: PropTypes.object,
|
|
69
|
+
templates: PropTypes.object,
|
|
70
|
+
siteInfo: PropTypes.object,
|
|
71
|
+
page: PropTypes.object,
|
|
72
|
+
}),
|
|
73
|
+
templateIcon: PropTypes.element,
|
|
74
|
+
linkIcon: PropTypes.element,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default Sitemap;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name getOperatorData
|
|
3
|
+
* @description Mock data related to the operator
|
|
4
|
+
* @return {Object} operator mock data
|
|
5
|
+
*/
|
|
6
|
+
export default function getOperatorData(status = 'active') {
|
|
7
|
+
const operator = {
|
|
8
|
+
name: 'Rizk Casino',
|
|
9
|
+
logo_url: 'rizk-logopng7ed316ac19-original.png',
|
|
10
|
+
url: 'https://rizk.com',
|
|
11
|
+
status,
|
|
12
|
+
short_name: 'rizk',
|
|
13
|
+
type: 'casino',
|
|
14
|
+
iframe: 'https://www.youtube.com/embed/DU1Pio4n_N0',
|
|
15
|
+
bonus: {
|
|
16
|
+
one_liners: {
|
|
17
|
+
main: {
|
|
18
|
+
one_liner: 'Oneliner',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
extra_fields: {
|
|
23
|
+
summary_background: 'fe63f69ca1618cf2e7ff810197001dec.png',
|
|
24
|
+
summary: 'Summary',
|
|
25
|
+
},
|
|
26
|
+
one_liners: {
|
|
27
|
+
main: {
|
|
28
|
+
one_liner: '100% Bonus + 50 free spins',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
return operator;
|
|
33
|
+
}
|