gatsby-matrix-theme 40.0.19 → 40.0.21
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 +4 -5
- package/CHANGELOG.md +40 -0
- package/jest.config.js +1 -1
- package/package.json +2 -2
- package/src/components/atoms/cards/article-card/template-one/index.js +2 -4
- package/src/components/atoms/cards/article-card/template-one/template-one.testtt.js +51 -0
- package/src/components/atoms/cards/game-cards/template-five/index.js +4 -5
- package/src/components/atoms/cards/game-cards/template-four/index.js +4 -5
- package/src/components/atoms/cards/game-cards/template-one/index.js +1 -6
- package/src/components/atoms/cards/game-cards/template-three/index.js +4 -5
- package/src/components/atoms/cards/game-cards/template-two/index.js +4 -5
- package/src/components/atoms/cards/operator-card/template-four/index.js +2 -4
- package/src/components/atoms/cards/operator-card/template-four/template-four.test.js +31 -31
- package/src/components/atoms/cards/operator-card/template-one/index.js +4 -7
- package/src/components/atoms/cards/operator-card/template-one/template-one.test.js +31 -31
- package/src/components/atoms/cards/operator-card/template-three/index.js +4 -7
- package/src/components/atoms/cards/operator-card/template-three/template-three.test.js +31 -31
- package/src/components/atoms/cards/operator-card/template-two/index.js +4 -8
- package/src/components/atoms/cards/operator-card/template-two/template-two.test.js +31 -31
- package/src/components/atoms/cards/payment-method/template-one/index.js +2 -5
- package/src/components/atoms/cards/payment-method/template-three/index.js +4 -6
- package/src/components/atoms/footer/hotline/index.js +21 -25
- package/src/components/atoms/ratings/index.js +1 -1
- package/src/components/molecules/cookie-modal/index.js +4 -1
- package/src/components/molecules/header/variants/operator/template-five/index.js +1 -1
- package/src/components/molecules/header/variants/operator/template-four/index.js +2 -4
- package/src/components/molecules/header/variants/operator/template-one-two/index.js +2 -4
- package/src/components/molecules/header/variants/operator/template-three/index.js +2 -4
- package/src/components/molecules/operator-details/index.js +3 -21
- package/src/components/molecules/operator-details/operator-details.test.js +16 -16
- package/src/components/molecules/wagering-calculator/index.js +3 -7
- package/src/components/molecules/wagering-calculator/wagering-calculator.test.js +11 -11
- package/src/components/organisms/cards/index.js +4 -5
- package/src/components/organisms/cards/module-introduction/index.js +4 -8
- package/src/components/organisms/cards/template-one/cards.module.scss +24 -0
- package/src/components/organisms/cards/template-one/index.js +59 -12
- package/src/components/organisms/cards/template-two/index.js +2 -2
- package/src/components/organisms/cards/template-two/item/index.js +11 -9
- package/src/constants/ratings-constant.js +2 -1
- package/src/gatsby-core-theme/components/molecules/floating-area/index.js +21 -17
- package/src/gatsby-core-theme/components/molecules/header/header.module.scss +24 -0
- package/src/gatsby-core-theme/components/molecules/header/header.test.js +1 -15
- package/src/gatsby-core-theme/components/molecules/header/index.js +241 -210
- package/src/gatsby-core-theme/components/molecules/main/index.js +68 -38
- package/src/gatsby-core-theme/components/molecules/module/index.js +117 -65
- package/src/gatsby-core-theme/components/molecules/module/module.module.scss +9 -0
- package/src/gatsby-core-theme/components/molecules/search/index.js +3 -8
- package/src/gatsby-core-theme/components/organisms/cookie-consent/cookie-consent.module.scss +5 -0
- package/src/gatsby-core-theme/components/organisms/toplist/index.js +8 -11
- package/src/gatsby-core-theme/components/pages/body/index.js +20 -32
- package/src/gatsby-core-theme/components/pages/search/index.js +1 -8
- package/src/gatsby-core-theme/hooks/tabs/index.js +9 -10
- package/src/helpers/cards.js +8 -8
- package/storybook/public/177.d172c821.iframe.bundle.js +1 -0
- package/storybook/public/179.cf86fb79.iframe.bundle.js +2 -0
- package/storybook/public/232.0187b657.iframe.bundle.js +1 -0
- package/storybook/public/240.bceabc4d.iframe.bundle.js +1 -0
- package/storybook/public/36.6d7d7dac.iframe.bundle.js +1 -0
- package/storybook/public/395.c1efbb64.iframe.bundle.js +2 -0
- package/storybook/public/395.c1efbb64.iframe.bundle.js.LICENSE.txt +19 -0
- package/storybook/public/420.a736e0a4.iframe.bundle.js +1 -0
- package/storybook/public/441.785aac5c.iframe.bundle.js +1 -0
- package/storybook/public/475.d67cc45e.iframe.bundle.js +1 -0
- package/storybook/public/477.9c72cb2c.iframe.bundle.js +1 -0
- package/storybook/public/504.6c39549e.iframe.bundle.js +1 -0
- package/storybook/public/563.10ed9a30.iframe.bundle.js +1 -0
- package/storybook/public/597.76b11f56.iframe.bundle.js +1 -0
- package/storybook/public/604.9bf212fc.iframe.bundle.js +1 -0
- package/storybook/public/61.24d29b3a.iframe.bundle.js +1 -0
- package/storybook/public/620.006a92ae.iframe.bundle.js +2 -0
- package/storybook/public/631.01156847.iframe.bundle.js +1 -0
- package/storybook/public/672.3058d279.iframe.bundle.js +1 -0
- package/storybook/public/679.4b227ee0.iframe.bundle.js +1 -0
- package/storybook/public/728.ae4470e4.iframe.bundle.js +7 -0
- package/storybook/public/{972.46b935fe.iframe.bundle.js.LICENSE.txt → 728.ae4470e4.iframe.bundle.js.LICENSE.txt} +0 -8
- package/storybook/public/{972.46b935fe.iframe.bundle.js.map → 728.ae4470e4.iframe.bundle.js.map} +1 -1
- package/storybook/public/776.44fd86a4.iframe.bundle.js +1 -0
- package/storybook/public/777.54713435.iframe.bundle.js +1 -0
- package/storybook/public/778.65a1be79.iframe.bundle.js +1 -0
- package/storybook/public/780.3a6a2927.iframe.bundle.js +2 -0
- package/storybook/public/794.abd55b25.iframe.bundle.js +1 -0
- package/storybook/public/796.8a8f559c.iframe.bundle.js +1 -0
- package/storybook/public/854.9fc784ba.iframe.bundle.js +1 -0
- package/storybook/public/909.0e3d61f8.iframe.bundle.js +1 -0
- package/storybook/public/943.bb1590d6.iframe.bundle.js +1 -0
- package/storybook/public/964.10c64556.iframe.bundle.js +1 -0
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.845fe2d1.iframe.bundle.js +1 -0
- package/storybook/public/project.json +1 -1
- package/storybook/public/runtime~main.2fdfdc96.iframe.bundle.js +1 -0
- package/src/components/atoms/cards/article-card/template-one/template-one.test.js +0 -51
- package/src/components/organisms/footer-navigation/footer-navigation.module.scss +0 -63
- package/src/components/organisms/footer-navigation/footer-navigation.stories.js +0 -122
- package/src/components/organisms/footer-navigation/index.js +0 -63
- package/storybook/public/113.10a9116f.iframe.bundle.js +0 -1
- package/storybook/public/127.17fc3e0b.iframe.bundle.js +0 -1
- package/storybook/public/162.d30676dc.iframe.bundle.js +0 -1
- package/storybook/public/172.1e3aefdb.iframe.bundle.js +0 -1
- package/storybook/public/183.b66d2a78.iframe.bundle.js +0 -1
- package/storybook/public/200.d678bbe9.iframe.bundle.js +0 -1
- package/storybook/public/203.52d417b8.iframe.bundle.js +0 -1
- package/storybook/public/225.6dca798a.iframe.bundle.js +0 -2
- package/storybook/public/26.e7520637.iframe.bundle.js +0 -1
- package/storybook/public/274.0e5a096a.iframe.bundle.js +0 -1
- package/storybook/public/283.219e438b.iframe.bundle.js +0 -1
- package/storybook/public/313.f14e679f.iframe.bundle.js +0 -1
- package/storybook/public/326.da0ba286.iframe.bundle.js +0 -1
- package/storybook/public/329.31f288b0.iframe.bundle.js +0 -1
- package/storybook/public/347.9b0cc0b2.iframe.bundle.js +0 -1
- package/storybook/public/357.40e0e31a.iframe.bundle.js +0 -1
- package/storybook/public/377.0129ee10.iframe.bundle.js +0 -1
- package/storybook/public/426.5bbf0dd8.iframe.bundle.js +0 -1
- package/storybook/public/43.44dc45b5.iframe.bundle.js +0 -1
- package/storybook/public/487.04548d26.iframe.bundle.js +0 -1
- package/storybook/public/495.b7d9f489.iframe.bundle.js +0 -1
- package/storybook/public/521.cac47219.iframe.bundle.js +0 -1
- package/storybook/public/555.99d9c86b.iframe.bundle.js +0 -1
- package/storybook/public/567.17326796.iframe.bundle.js +0 -1
- package/storybook/public/590.25fcc3e8.iframe.bundle.js +0 -1
- package/storybook/public/625.4e46db89.iframe.bundle.js +0 -1
- package/storybook/public/658.22cfca07.iframe.bundle.js +0 -1
- package/storybook/public/664.a464a442.iframe.bundle.js +0 -1
- package/storybook/public/687.7bbde896.iframe.bundle.js +0 -1
- package/storybook/public/696.209eab94.iframe.bundle.js +0 -1
- package/storybook/public/713.8662e9a0.iframe.bundle.js +0 -1
- package/storybook/public/725.7f876a32.iframe.bundle.js +0 -2
- package/storybook/public/758.dae33e9e.iframe.bundle.js +0 -1
- package/storybook/public/809.7a44a691.iframe.bundle.js +0 -1
- package/storybook/public/864.8d02059a.iframe.bundle.js +0 -1
- package/storybook/public/866.0e255b9d.iframe.bundle.js +0 -1
- package/storybook/public/871.e3a780ba.iframe.bundle.js +0 -1
- package/storybook/public/907.0521c6f4.iframe.bundle.js +0 -2
- package/storybook/public/907.0521c6f4.iframe.bundle.js.LICENSE.txt +0 -1
- package/storybook/public/919.57aed125.iframe.bundle.js +0 -1
- package/storybook/public/933.e56e01a1.iframe.bundle.js +0 -1
- package/storybook/public/938.f1a4065f.iframe.bundle.js +0 -1
- package/storybook/public/952.09d50df1.iframe.bundle.js +0 -1
- package/storybook/public/97.dab9ed43.iframe.bundle.js +0 -1
- package/storybook/public/972.46b935fe.iframe.bundle.js +0 -7
- package/storybook/public/984.5ce87937.iframe.bundle.js +0 -2
- package/storybook/public/main.e89889b3.iframe.bundle.js +0 -2
- package/storybook/public/main.e89889b3.iframe.bundle.js.LICENSE.txt +0 -1
- package/storybook/public/runtime~main.01b9ad37.iframe.bundle.js +0 -1
- /package/src/gatsby-core-theme/components/{pages/body/body.module.scss → molecules/floating-area/floating-area.module.scss} +0 -0
- /package/storybook/public/{725.7f876a32.iframe.bundle.js.LICENSE.txt → 179.cf86fb79.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook/public/{225.6dca798a.iframe.bundle.js.LICENSE.txt → 620.006a92ae.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook/public/{984.5ce87937.iframe.bundle.js.LICENSE.txt → 780.3a6a2927.iframe.bundle.js.LICENSE.txt} +0 -0
|
@@ -1,146 +1,238 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
|
|
2
|
+
/* eslint-disable react/forbid-prop-types */
|
|
3
|
+
import React, { useContext, lazy, Suspense } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
|
-
import loadable from '@loadable/component';
|
|
5
5
|
import Breadcrumbs from 'gatsby-core-theme/src/components/atoms/breadcrumbs';
|
|
6
6
|
import { Context } from 'gatsby-core-theme/src/context/MainProvider';
|
|
7
7
|
import { getSectionExtraField } from 'gatsby-core-theme/src/helpers/getters';
|
|
8
|
+
import DefaulTemplateTwo from '../../../../components/molecules/header/variants/default/template-two';
|
|
9
|
+
import DefaulTemplateOne from '../../../../components/molecules/header/variants/default/template-one';
|
|
10
|
+
import ReviewCredits from '../../../../components/atoms/review-credits';
|
|
11
|
+
import Author from '~atoms/author';
|
|
8
12
|
import styles from './header.module.scss';
|
|
9
13
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
14
|
+
export default function Header({ section, numOfStarsRating = 5, showAuthor }) {
|
|
15
|
+
const { bannerIsActive } = useContext(Context) || {};
|
|
16
|
+
const customStyles = section.page.path === '/' ? 'homepage' : section.page.path.replace('/', '-');
|
|
17
|
+
|
|
18
|
+
const relationContent = (pageSection, starratings) => {
|
|
19
|
+
let ModuleComponent = null;
|
|
20
|
+
switch (pageSection?.page?.relation_type) {
|
|
21
|
+
case 'payment_method': {
|
|
22
|
+
const data = {
|
|
23
|
+
page: pageSection?.page,
|
|
24
|
+
relation: pageSection?.page?.relation || {},
|
|
25
|
+
type: pageSection?.page?.relation_type,
|
|
26
|
+
template: pageSection?.page?.page_styles?.short_name,
|
|
27
|
+
pageTemplate: pageSection?.page?.template,
|
|
28
|
+
pageSections: pageSection?.page?.pageSections,
|
|
29
|
+
name: pageSection?.page?.title || pageSection?.page?.relation?.name,
|
|
30
|
+
ribbons: pageSection?.page?.relation?.ribbons || [],
|
|
31
|
+
image:
|
|
32
|
+
pageSection?.page?.relation?.standardised_logo_filename_object ||
|
|
33
|
+
pageSection?.page?.relation?.logo_filename_object,
|
|
34
|
+
numOfStars: 5,
|
|
35
|
+
description:
|
|
36
|
+
pageSection.page.description ||
|
|
37
|
+
getSectionExtraField(null, pageSection.page.sections.header, 'header_text'),
|
|
38
|
+
};
|
|
39
|
+
switch (pageSection?.page?.page_styles?.short_name) {
|
|
40
|
+
case 'template_two': {
|
|
41
|
+
ModuleComponent = lazy(() =>
|
|
42
|
+
import('../../../../components/molecules/header/variants/payment/template-two/index')
|
|
43
|
+
);
|
|
44
|
+
return <ModuleComponent {...data} />;
|
|
45
|
+
}
|
|
46
|
+
case 'template_four': {
|
|
47
|
+
ModuleComponent = lazy(() =>
|
|
48
|
+
import('../../../../components/molecules/header/variants/payment/template-four/index')
|
|
49
|
+
);
|
|
50
|
+
return <ModuleComponent {...data} />;
|
|
51
|
+
}
|
|
52
|
+
case 'template_five': {
|
|
53
|
+
ModuleComponent = lazy(() =>
|
|
54
|
+
import('../../../../components/molecules/header/variants/payment/template-five/index')
|
|
55
|
+
);
|
|
56
|
+
return <ModuleComponent {...data} />;
|
|
57
|
+
}
|
|
58
|
+
default: {
|
|
59
|
+
ModuleComponent = lazy(() =>
|
|
60
|
+
import(
|
|
61
|
+
'../../../../components/molecules/header/variants/payment/template-one-three/index'
|
|
62
|
+
)
|
|
63
|
+
);
|
|
64
|
+
return <ModuleComponent {...data} />;
|
|
65
|
+
}
|
|
57
66
|
}
|
|
58
67
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
68
|
+
case 'software_provider': {
|
|
69
|
+
ModuleComponent = lazy(() =>
|
|
70
|
+
import('../../../../components/molecules/header/variants/software')
|
|
71
|
+
);
|
|
72
|
+
return <ModuleComponent page={pageSection.page} />;
|
|
73
|
+
}
|
|
74
|
+
case 'article': {
|
|
75
|
+
ModuleComponent = lazy(() =>
|
|
76
|
+
import('../../../../components/molecules/header/variants/article')
|
|
77
|
+
);
|
|
78
|
+
return <ModuleComponent page={pageSection.page} />;
|
|
79
|
+
}
|
|
80
|
+
case 'operator': {
|
|
81
|
+
const data = {
|
|
82
|
+
page: pageSection?.page,
|
|
83
|
+
author: pageSection?.page.author,
|
|
84
|
+
type: pageSection?.page?.relation_type,
|
|
85
|
+
template: pageSection?.page?.page_styles?.short_name,
|
|
86
|
+
pageTemplate: pageSection?.page?.template,
|
|
87
|
+
relation: pageSection?.page?.relation || {},
|
|
88
|
+
name: pageSection?.page?.title || pageSection?.page?.relation?.name,
|
|
89
|
+
ribbons: pageSection?.page?.relation?.ribbons || [],
|
|
90
|
+
image:
|
|
91
|
+
pageSection?.page?.relation?.standardised_logo_url_object ||
|
|
92
|
+
pageSection?.page?.relation?.logo_url_object,
|
|
93
|
+
featureImg: pageSection?.page?.featured_image_object,
|
|
94
|
+
extraFields: pageSection?.page?.extra_fields || {},
|
|
95
|
+
numOfStars: starratings,
|
|
96
|
+
};
|
|
97
|
+
switch (pageSection?.page?.page_styles?.short_name) {
|
|
98
|
+
case 'template_three': {
|
|
99
|
+
ModuleComponent = lazy(() =>
|
|
100
|
+
import('../../../../components/molecules/header/variants/operator/template-three')
|
|
101
|
+
);
|
|
102
|
+
return <ModuleComponent {...data} />;
|
|
103
|
+
}
|
|
104
|
+
case 'template_four': {
|
|
105
|
+
ModuleComponent = lazy(() =>
|
|
106
|
+
import(
|
|
107
|
+
'../../../../components/molecules/header/variants/operator/template-four/index'
|
|
108
|
+
)
|
|
109
|
+
);
|
|
110
|
+
return <ModuleComponent {...data} />;
|
|
111
|
+
}
|
|
112
|
+
case 'template_five': {
|
|
113
|
+
ModuleComponent = lazy(() =>
|
|
114
|
+
import(
|
|
115
|
+
'../../../../components/molecules/header/variants/operator/template-five/index'
|
|
116
|
+
)
|
|
117
|
+
);
|
|
118
|
+
return <ModuleComponent {...data} />;
|
|
119
|
+
}
|
|
120
|
+
default: {
|
|
121
|
+
ModuleComponent = lazy(() =>
|
|
122
|
+
import(
|
|
123
|
+
'../../../../components/molecules/header/variants/operator/template-one-two/index'
|
|
124
|
+
)
|
|
125
|
+
);
|
|
126
|
+
return <ModuleComponent {...data} />;
|
|
127
|
+
}
|
|
107
128
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
|
|
129
|
+
}
|
|
130
|
+
case 'game': {
|
|
131
|
+
switch (pageSection?.page?.page_styles?.short_name) {
|
|
132
|
+
case 'template_two': {
|
|
133
|
+
ModuleComponent = lazy(() =>
|
|
134
|
+
import('../../../../components/molecules/header/variants/slot/template-two')
|
|
135
|
+
);
|
|
136
|
+
return (
|
|
137
|
+
<ModuleComponent page={pageSection.page} image="../../../../images/verify.svg" />
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
default: {
|
|
141
|
+
ModuleComponent = lazy(() =>
|
|
142
|
+
import('../../../../components/molecules/header/variants/slot/template-one')
|
|
143
|
+
);
|
|
144
|
+
return (
|
|
145
|
+
<ModuleComponent page={pageSection.page} image="../../../../images/verify.svg" />
|
|
146
|
+
);
|
|
147
|
+
}
|
|
115
148
|
}
|
|
116
149
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
150
|
+
case 'sport': {
|
|
151
|
+
let props = {
|
|
152
|
+
page: pageSection.page,
|
|
153
|
+
extraFields: pageSection.page.extra_fields,
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
ModuleComponent = lazy(() =>
|
|
157
|
+
import('../../../../components/molecules/header/variants/sport/template-one/index')
|
|
158
|
+
);
|
|
159
|
+
props = {
|
|
160
|
+
...props,
|
|
161
|
+
title: pageSection.page.title,
|
|
162
|
+
description:
|
|
163
|
+
pageSection.page.description ||
|
|
164
|
+
getSectionExtraField(null, pageSection.page.pageSections.header, 'header_text'),
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
return <ModuleComponent {...props} page={pageSection.page} />;
|
|
168
|
+
}
|
|
169
|
+
case 'author': {
|
|
170
|
+
if (!pageSection.page.relation) {
|
|
171
|
+
return <></>;
|
|
125
172
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
173
|
+
|
|
174
|
+
switch (pageSection?.page?.page_styles?.short_name) {
|
|
175
|
+
case 'template_two':
|
|
176
|
+
ModuleComponent = lazy(() =>
|
|
177
|
+
import('../../../../components/molecules/header/variants/author/template-two')
|
|
178
|
+
);
|
|
179
|
+
return (
|
|
180
|
+
<ModuleComponent
|
|
181
|
+
author={pageSection.page.relation}
|
|
182
|
+
authorTitle={pageSection?.page?.title}
|
|
183
|
+
/>
|
|
184
|
+
);
|
|
185
|
+
case 'template_three':
|
|
186
|
+
ModuleComponent = lazy(() =>
|
|
187
|
+
import('../../../../components/molecules/header/variants/author/template-three')
|
|
188
|
+
);
|
|
189
|
+
return (
|
|
190
|
+
<ModuleComponent
|
|
191
|
+
author={pageSection.page.relation}
|
|
192
|
+
authorTitle={pageSection?.page?.title}
|
|
193
|
+
/>
|
|
194
|
+
);
|
|
195
|
+
case 'template_four':
|
|
196
|
+
ModuleComponent = lazy(() =>
|
|
197
|
+
import('../../../../components/molecules/header/variants/author/template-four')
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
<ModuleComponent
|
|
202
|
+
author={pageSection.page.relation}
|
|
203
|
+
authorTitle={pageSection?.page?.title}
|
|
204
|
+
/>
|
|
205
|
+
);
|
|
206
|
+
case 'template_one':
|
|
207
|
+
default:
|
|
208
|
+
ModuleComponent = lazy(() =>
|
|
209
|
+
import('../../../../components/molecules/header/variants/author/template-one')
|
|
210
|
+
);
|
|
211
|
+
return (
|
|
212
|
+
<ModuleComponent
|
|
213
|
+
author={pageSection.page.relation}
|
|
214
|
+
authorTitle={pageSection?.page?.title}
|
|
215
|
+
/>
|
|
216
|
+
);
|
|
131
217
|
}
|
|
132
218
|
}
|
|
219
|
+
default:
|
|
220
|
+
return ModuleComponent;
|
|
133
221
|
}
|
|
222
|
+
};
|
|
134
223
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
224
|
+
const getDefaultHeader = () => {
|
|
225
|
+
let props = {
|
|
226
|
+
page: section.page,
|
|
227
|
+
extraFields: section.page.extra_fields,
|
|
228
|
+
imageObj: section.page.featured_image_object,
|
|
229
|
+
};
|
|
230
|
+
let ModuleComponent = null;
|
|
140
231
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
232
|
+
if (section?.page?.page_styles?.short_name === 'template_two') {
|
|
233
|
+
ModuleComponent = DefaulTemplateTwo;
|
|
234
|
+
} else {
|
|
235
|
+
ModuleComponent = DefaulTemplateOne;
|
|
144
236
|
props = {
|
|
145
237
|
...props,
|
|
146
238
|
title: section.page.title,
|
|
@@ -148,112 +240,39 @@ export const relationContent = (section, numOfStarsRating) => {
|
|
|
148
240
|
section.page.description ||
|
|
149
241
|
getSectionExtraField(null, section.page.sections.header, 'header_text'),
|
|
150
242
|
};
|
|
151
|
-
|
|
152
|
-
return <ModuleComponent {...props} page={section.page} />;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
case 'author': {
|
|
156
|
-
if (!section.page.relation) {
|
|
157
|
-
return <></>;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
switch (section?.page?.page_styles?.short_name) {
|
|
161
|
-
case 'template_two':
|
|
162
|
-
ModuleComponent = loadable(() =>
|
|
163
|
-
import('../../../../components/molecules/header/variants/author/template-two')
|
|
164
|
-
);
|
|
165
|
-
return (
|
|
166
|
-
<ModuleComponent author={section.page.relation} authorTitle={section?.page?.title} />
|
|
167
|
-
);
|
|
168
|
-
case 'template_three':
|
|
169
|
-
ModuleComponent = loadable(() =>
|
|
170
|
-
import('../../../../components/molecules/header/variants/author/template-three')
|
|
171
|
-
);
|
|
172
|
-
return (
|
|
173
|
-
<ModuleComponent author={section.page.relation} authorTitle={section?.page?.title} />
|
|
174
|
-
);
|
|
175
|
-
case 'template_four':
|
|
176
|
-
ModuleComponent = loadable(() =>
|
|
177
|
-
import('../../../../components/molecules/header/variants/author/template-four')
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
return (
|
|
181
|
-
<ModuleComponent author={section.page.relation} authorTitle={section?.page?.title} />
|
|
182
|
-
);
|
|
183
|
-
case 'template_one':
|
|
184
|
-
default:
|
|
185
|
-
ModuleComponent = loadable(() =>
|
|
186
|
-
import('../../../../components/molecules/header/variants/author/template-one')
|
|
187
|
-
);
|
|
188
|
-
return (
|
|
189
|
-
<ModuleComponent author={section.page.relation} authorTitle={section?.page?.title} />
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
243
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
page: section.page,
|
|
196
|
-
extraFields: section.page.extra_fields,
|
|
197
|
-
imageObj: section.page.featured_image_object,
|
|
198
|
-
};
|
|
244
|
+
return <ModuleComponent {...props} />;
|
|
245
|
+
};
|
|
199
246
|
|
|
200
|
-
if (section?.page?.page_styles?.short_name === 'template_two') {
|
|
201
|
-
ModuleComponent = loadable(() =>
|
|
202
|
-
import('../../../../components/molecules/header/variants/default/template-two')
|
|
203
|
-
);
|
|
204
|
-
} else {
|
|
205
|
-
ModuleComponent = loadable(() =>
|
|
206
|
-
import('../../../../components/molecules/header/variants/default/template-one')
|
|
207
|
-
);
|
|
208
|
-
props = {
|
|
209
|
-
...props,
|
|
210
|
-
title: section.page.title,
|
|
211
|
-
description:
|
|
212
|
-
section.page.description ||
|
|
213
|
-
getSectionExtraField(null, section.page.sections.header, 'header_text'),
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
return <ModuleComponent {...props} />;
|
|
217
|
-
}
|
|
218
|
-
default:
|
|
219
|
-
return ModuleComponent;
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
export default function Header({ section, numOfStarsRating = 5, showAuthor = false }) {
|
|
224
|
-
const { bannerIsActive } = useContext(Context) || {};
|
|
225
|
-
const customStyles = section.page.path === '/' ? 'homepage' : section.page.path.replace('/', '-');
|
|
226
247
|
const { page } = section || {};
|
|
227
248
|
const { sections } = page || {};
|
|
228
|
-
|
|
229
249
|
const isContactUsPage = !!sections?.main?.modules?.filter(
|
|
230
250
|
(module) => module.name === 'contact_form'
|
|
231
251
|
).length;
|
|
232
252
|
|
|
233
|
-
const
|
|
253
|
+
const showReviewCredits =
|
|
234
254
|
section.page.path !== '/' &&
|
|
235
255
|
!isContactUsPage &&
|
|
236
256
|
section.page.path !== 'news' &&
|
|
237
257
|
section.page.path !== 'sitemap' &&
|
|
238
258
|
section.page.template !== 'ppc' &&
|
|
239
259
|
section.page.author_id &&
|
|
240
|
-
showAuthor
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
const Author =
|
|
260
|
+
showAuthor;
|
|
261
|
+
|
|
262
|
+
const showAuthorComponent =
|
|
244
263
|
section.page.path !== '/' &&
|
|
245
264
|
!isContactUsPage &&
|
|
246
265
|
section.page.path !== 'news' &&
|
|
247
266
|
section.page.path !== 'sitemap' &&
|
|
248
267
|
section.page.template !== 'ppc' &&
|
|
249
268
|
section.page.author_id &&
|
|
250
|
-
showAuthor
|
|
251
|
-
|
|
252
|
-
: null;
|
|
269
|
+
showAuthor;
|
|
270
|
+
|
|
253
271
|
const useReviewCredits =
|
|
254
272
|
process.env.GATSBY_SITE_NAME === 'irishluck.ie' ||
|
|
255
273
|
process.env.GATSBY_SITE_NAME === 'demosite' ||
|
|
256
274
|
process.env.GATSBY_SITE_NAME === 'playcasino.co.za';
|
|
275
|
+
|
|
257
276
|
const hasAuthorBox = !!(page.author_id && !isContactUsPage);
|
|
258
277
|
|
|
259
278
|
const date =
|
|
@@ -261,6 +280,8 @@ export default function Header({ section, numOfStarsRating = 5, showAuthor = fal
|
|
|
261
280
|
? page.manual_updated_date || page.manual_published_date
|
|
262
281
|
: '';
|
|
263
282
|
|
|
283
|
+
const skeletonClassName = `skeleton${section?.page?.relation_type}`;
|
|
284
|
+
|
|
264
285
|
return (
|
|
265
286
|
<header
|
|
266
287
|
className={`${styles?.header || ''}
|
|
@@ -276,9 +297,16 @@ export default function Header({ section, numOfStarsRating = 5, showAuthor = fal
|
|
|
276
297
|
`}
|
|
277
298
|
>
|
|
278
299
|
{section.page.path && <Breadcrumbs markets={section.allMarkets} page={section.page} />}
|
|
279
|
-
{
|
|
300
|
+
{section?.page?.relation_type === 'page' ? (
|
|
301
|
+
getDefaultHeader()
|
|
302
|
+
) : (
|
|
303
|
+
<Suspense fallback={<div className={`${styles[skeletonClassName]}`} />}>
|
|
304
|
+
{relationContent(section, numOfStarsRating)}
|
|
305
|
+
</Suspense>
|
|
306
|
+
)}
|
|
307
|
+
|
|
280
308
|
{useReviewCredits
|
|
281
|
-
?
|
|
309
|
+
? showReviewCredits && (
|
|
282
310
|
<ReviewCredits
|
|
283
311
|
date={date}
|
|
284
312
|
author={page?.author_id && page?.author}
|
|
@@ -288,7 +316,7 @@ export default function Header({ section, numOfStarsRating = 5, showAuthor = fal
|
|
|
288
316
|
type={page?.template}
|
|
289
317
|
/>
|
|
290
318
|
)
|
|
291
|
-
:
|
|
319
|
+
: showAuthorComponent && (
|
|
292
320
|
<Author
|
|
293
321
|
name={page.author?.name}
|
|
294
322
|
date={date}
|
|
@@ -314,6 +342,9 @@ Header.propTypes = {
|
|
|
314
342
|
path: PropTypes.string,
|
|
315
343
|
updated_at: PropTypes.string,
|
|
316
344
|
created_at: PropTypes.string,
|
|
345
|
+
description: PropTypes.string,
|
|
346
|
+
featured_image_object: PropTypes.object,
|
|
347
|
+
extra_fields: PropTypes.object,
|
|
317
348
|
page_styles: PropTypes.shape({
|
|
318
349
|
short_name: PropTypes.string,
|
|
319
350
|
}),
|