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.
Files changed (147) hide show
  1. package/.ci.yml +4 -5
  2. package/CHANGELOG.md +40 -0
  3. package/jest.config.js +1 -1
  4. package/package.json +2 -2
  5. package/src/components/atoms/cards/article-card/template-one/index.js +2 -4
  6. package/src/components/atoms/cards/article-card/template-one/template-one.testtt.js +51 -0
  7. package/src/components/atoms/cards/game-cards/template-five/index.js +4 -5
  8. package/src/components/atoms/cards/game-cards/template-four/index.js +4 -5
  9. package/src/components/atoms/cards/game-cards/template-one/index.js +1 -6
  10. package/src/components/atoms/cards/game-cards/template-three/index.js +4 -5
  11. package/src/components/atoms/cards/game-cards/template-two/index.js +4 -5
  12. package/src/components/atoms/cards/operator-card/template-four/index.js +2 -4
  13. package/src/components/atoms/cards/operator-card/template-four/template-four.test.js +31 -31
  14. package/src/components/atoms/cards/operator-card/template-one/index.js +4 -7
  15. package/src/components/atoms/cards/operator-card/template-one/template-one.test.js +31 -31
  16. package/src/components/atoms/cards/operator-card/template-three/index.js +4 -7
  17. package/src/components/atoms/cards/operator-card/template-three/template-three.test.js +31 -31
  18. package/src/components/atoms/cards/operator-card/template-two/index.js +4 -8
  19. package/src/components/atoms/cards/operator-card/template-two/template-two.test.js +31 -31
  20. package/src/components/atoms/cards/payment-method/template-one/index.js +2 -5
  21. package/src/components/atoms/cards/payment-method/template-three/index.js +4 -6
  22. package/src/components/atoms/footer/hotline/index.js +21 -25
  23. package/src/components/atoms/ratings/index.js +1 -1
  24. package/src/components/molecules/cookie-modal/index.js +4 -1
  25. package/src/components/molecules/header/variants/operator/template-five/index.js +1 -1
  26. package/src/components/molecules/header/variants/operator/template-four/index.js +2 -4
  27. package/src/components/molecules/header/variants/operator/template-one-two/index.js +2 -4
  28. package/src/components/molecules/header/variants/operator/template-three/index.js +2 -4
  29. package/src/components/molecules/operator-details/index.js +3 -21
  30. package/src/components/molecules/operator-details/operator-details.test.js +16 -16
  31. package/src/components/molecules/wagering-calculator/index.js +3 -7
  32. package/src/components/molecules/wagering-calculator/wagering-calculator.test.js +11 -11
  33. package/src/components/organisms/cards/index.js +4 -5
  34. package/src/components/organisms/cards/module-introduction/index.js +4 -8
  35. package/src/components/organisms/cards/template-one/cards.module.scss +24 -0
  36. package/src/components/organisms/cards/template-one/index.js +59 -12
  37. package/src/components/organisms/cards/template-two/index.js +2 -2
  38. package/src/components/organisms/cards/template-two/item/index.js +11 -9
  39. package/src/constants/ratings-constant.js +2 -1
  40. package/src/gatsby-core-theme/components/molecules/floating-area/index.js +21 -17
  41. package/src/gatsby-core-theme/components/molecules/header/header.module.scss +24 -0
  42. package/src/gatsby-core-theme/components/molecules/header/header.test.js +1 -15
  43. package/src/gatsby-core-theme/components/molecules/header/index.js +241 -210
  44. package/src/gatsby-core-theme/components/molecules/main/index.js +68 -38
  45. package/src/gatsby-core-theme/components/molecules/module/index.js +117 -65
  46. package/src/gatsby-core-theme/components/molecules/module/module.module.scss +9 -0
  47. package/src/gatsby-core-theme/components/molecules/search/index.js +3 -8
  48. package/src/gatsby-core-theme/components/organisms/cookie-consent/cookie-consent.module.scss +5 -0
  49. package/src/gatsby-core-theme/components/organisms/toplist/index.js +8 -11
  50. package/src/gatsby-core-theme/components/pages/body/index.js +20 -32
  51. package/src/gatsby-core-theme/components/pages/search/index.js +1 -8
  52. package/src/gatsby-core-theme/hooks/tabs/index.js +9 -10
  53. package/src/helpers/cards.js +8 -8
  54. package/storybook/public/177.d172c821.iframe.bundle.js +1 -0
  55. package/storybook/public/179.cf86fb79.iframe.bundle.js +2 -0
  56. package/storybook/public/232.0187b657.iframe.bundle.js +1 -0
  57. package/storybook/public/240.bceabc4d.iframe.bundle.js +1 -0
  58. package/storybook/public/36.6d7d7dac.iframe.bundle.js +1 -0
  59. package/storybook/public/395.c1efbb64.iframe.bundle.js +2 -0
  60. package/storybook/public/395.c1efbb64.iframe.bundle.js.LICENSE.txt +19 -0
  61. package/storybook/public/420.a736e0a4.iframe.bundle.js +1 -0
  62. package/storybook/public/441.785aac5c.iframe.bundle.js +1 -0
  63. package/storybook/public/475.d67cc45e.iframe.bundle.js +1 -0
  64. package/storybook/public/477.9c72cb2c.iframe.bundle.js +1 -0
  65. package/storybook/public/504.6c39549e.iframe.bundle.js +1 -0
  66. package/storybook/public/563.10ed9a30.iframe.bundle.js +1 -0
  67. package/storybook/public/597.76b11f56.iframe.bundle.js +1 -0
  68. package/storybook/public/604.9bf212fc.iframe.bundle.js +1 -0
  69. package/storybook/public/61.24d29b3a.iframe.bundle.js +1 -0
  70. package/storybook/public/620.006a92ae.iframe.bundle.js +2 -0
  71. package/storybook/public/631.01156847.iframe.bundle.js +1 -0
  72. package/storybook/public/672.3058d279.iframe.bundle.js +1 -0
  73. package/storybook/public/679.4b227ee0.iframe.bundle.js +1 -0
  74. package/storybook/public/728.ae4470e4.iframe.bundle.js +7 -0
  75. package/storybook/public/{972.46b935fe.iframe.bundle.js.LICENSE.txt → 728.ae4470e4.iframe.bundle.js.LICENSE.txt} +0 -8
  76. package/storybook/public/{972.46b935fe.iframe.bundle.js.map → 728.ae4470e4.iframe.bundle.js.map} +1 -1
  77. package/storybook/public/776.44fd86a4.iframe.bundle.js +1 -0
  78. package/storybook/public/777.54713435.iframe.bundle.js +1 -0
  79. package/storybook/public/778.65a1be79.iframe.bundle.js +1 -0
  80. package/storybook/public/780.3a6a2927.iframe.bundle.js +2 -0
  81. package/storybook/public/794.abd55b25.iframe.bundle.js +1 -0
  82. package/storybook/public/796.8a8f559c.iframe.bundle.js +1 -0
  83. package/storybook/public/854.9fc784ba.iframe.bundle.js +1 -0
  84. package/storybook/public/909.0e3d61f8.iframe.bundle.js +1 -0
  85. package/storybook/public/943.bb1590d6.iframe.bundle.js +1 -0
  86. package/storybook/public/964.10c64556.iframe.bundle.js +1 -0
  87. package/storybook/public/iframe.html +1 -1
  88. package/storybook/public/main.845fe2d1.iframe.bundle.js +1 -0
  89. package/storybook/public/project.json +1 -1
  90. package/storybook/public/runtime~main.2fdfdc96.iframe.bundle.js +1 -0
  91. package/src/components/atoms/cards/article-card/template-one/template-one.test.js +0 -51
  92. package/src/components/organisms/footer-navigation/footer-navigation.module.scss +0 -63
  93. package/src/components/organisms/footer-navigation/footer-navigation.stories.js +0 -122
  94. package/src/components/organisms/footer-navigation/index.js +0 -63
  95. package/storybook/public/113.10a9116f.iframe.bundle.js +0 -1
  96. package/storybook/public/127.17fc3e0b.iframe.bundle.js +0 -1
  97. package/storybook/public/162.d30676dc.iframe.bundle.js +0 -1
  98. package/storybook/public/172.1e3aefdb.iframe.bundle.js +0 -1
  99. package/storybook/public/183.b66d2a78.iframe.bundle.js +0 -1
  100. package/storybook/public/200.d678bbe9.iframe.bundle.js +0 -1
  101. package/storybook/public/203.52d417b8.iframe.bundle.js +0 -1
  102. package/storybook/public/225.6dca798a.iframe.bundle.js +0 -2
  103. package/storybook/public/26.e7520637.iframe.bundle.js +0 -1
  104. package/storybook/public/274.0e5a096a.iframe.bundle.js +0 -1
  105. package/storybook/public/283.219e438b.iframe.bundle.js +0 -1
  106. package/storybook/public/313.f14e679f.iframe.bundle.js +0 -1
  107. package/storybook/public/326.da0ba286.iframe.bundle.js +0 -1
  108. package/storybook/public/329.31f288b0.iframe.bundle.js +0 -1
  109. package/storybook/public/347.9b0cc0b2.iframe.bundle.js +0 -1
  110. package/storybook/public/357.40e0e31a.iframe.bundle.js +0 -1
  111. package/storybook/public/377.0129ee10.iframe.bundle.js +0 -1
  112. package/storybook/public/426.5bbf0dd8.iframe.bundle.js +0 -1
  113. package/storybook/public/43.44dc45b5.iframe.bundle.js +0 -1
  114. package/storybook/public/487.04548d26.iframe.bundle.js +0 -1
  115. package/storybook/public/495.b7d9f489.iframe.bundle.js +0 -1
  116. package/storybook/public/521.cac47219.iframe.bundle.js +0 -1
  117. package/storybook/public/555.99d9c86b.iframe.bundle.js +0 -1
  118. package/storybook/public/567.17326796.iframe.bundle.js +0 -1
  119. package/storybook/public/590.25fcc3e8.iframe.bundle.js +0 -1
  120. package/storybook/public/625.4e46db89.iframe.bundle.js +0 -1
  121. package/storybook/public/658.22cfca07.iframe.bundle.js +0 -1
  122. package/storybook/public/664.a464a442.iframe.bundle.js +0 -1
  123. package/storybook/public/687.7bbde896.iframe.bundle.js +0 -1
  124. package/storybook/public/696.209eab94.iframe.bundle.js +0 -1
  125. package/storybook/public/713.8662e9a0.iframe.bundle.js +0 -1
  126. package/storybook/public/725.7f876a32.iframe.bundle.js +0 -2
  127. package/storybook/public/758.dae33e9e.iframe.bundle.js +0 -1
  128. package/storybook/public/809.7a44a691.iframe.bundle.js +0 -1
  129. package/storybook/public/864.8d02059a.iframe.bundle.js +0 -1
  130. package/storybook/public/866.0e255b9d.iframe.bundle.js +0 -1
  131. package/storybook/public/871.e3a780ba.iframe.bundle.js +0 -1
  132. package/storybook/public/907.0521c6f4.iframe.bundle.js +0 -2
  133. package/storybook/public/907.0521c6f4.iframe.bundle.js.LICENSE.txt +0 -1
  134. package/storybook/public/919.57aed125.iframe.bundle.js +0 -1
  135. package/storybook/public/933.e56e01a1.iframe.bundle.js +0 -1
  136. package/storybook/public/938.f1a4065f.iframe.bundle.js +0 -1
  137. package/storybook/public/952.09d50df1.iframe.bundle.js +0 -1
  138. package/storybook/public/97.dab9ed43.iframe.bundle.js +0 -1
  139. package/storybook/public/972.46b935fe.iframe.bundle.js +0 -7
  140. package/storybook/public/984.5ce87937.iframe.bundle.js +0 -2
  141. package/storybook/public/main.e89889b3.iframe.bundle.js +0 -2
  142. package/storybook/public/main.e89889b3.iframe.bundle.js.LICENSE.txt +0 -1
  143. package/storybook/public/runtime~main.01b9ad37.iframe.bundle.js +0 -1
  144. /package/src/gatsby-core-theme/components/{pages/body/body.module.scss → molecules/floating-area/floating-area.module.scss} +0 -0
  145. /package/storybook/public/{725.7f876a32.iframe.bundle.js.LICENSE.txt → 179.cf86fb79.iframe.bundle.js.LICENSE.txt} +0 -0
  146. /package/storybook/public/{225.6dca798a.iframe.bundle.js.LICENSE.txt → 620.006a92ae.iframe.bundle.js.LICENSE.txt} +0 -0
  147. /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
- import React, { useContext } from 'react';
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 const relationContent = (section, numOfStarsRating) => {
11
- let ModuleComponent = null;
12
- switch (section?.page?.relation_type) {
13
- case 'payment_method': {
14
- const data = {
15
- page: section?.page,
16
- relation: section?.page?.relation || {},
17
- type: section?.page?.relation_type,
18
- template: section?.page?.page_styles?.short_name,
19
- pageTemplate: section?.page?.template,
20
- sections: section?.page?.sections,
21
- name: section?.page?.title || section?.page?.relation?.name,
22
- ribbons: section?.page?.relation?.ribbons || [],
23
- image:
24
- section?.page?.relation?.standardised_logo_filename_object ||
25
- section?.page?.relation?.logo_filename_object,
26
- numOfStars: 5,
27
- description:
28
- section.page.description ||
29
- getSectionExtraField(null, section.page.sections.header, 'header_text'),
30
- };
31
- switch (section?.page?.page_styles?.short_name) {
32
- case 'template_two': {
33
- ModuleComponent = loadable(() =>
34
- import('../../../../components/molecules/header/variants/payment/template-two/index')
35
- );
36
- return <ModuleComponent {...data} />;
37
- }
38
- case 'template_four': {
39
- ModuleComponent = loadable(() =>
40
- import('../../../../components/molecules/header/variants/payment/template-four/index')
41
- );
42
- return <ModuleComponent {...data} />;
43
- }
44
- case 'template_five': {
45
- ModuleComponent = loadable(() =>
46
- import('../../../../components/molecules/header/variants/payment/template-five/index')
47
- );
48
- return <ModuleComponent {...data} />;
49
- }
50
- default: {
51
- ModuleComponent = loadable(() =>
52
- import(
53
- '../../../../components/molecules/header/variants/payment/template-one-three/index'
54
- )
55
- );
56
- return <ModuleComponent {...data} />;
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
- case 'software_provider': {
61
- ModuleComponent = loadable(() =>
62
- import('../../../../components/molecules/header/variants/software')
63
- );
64
- return <ModuleComponent page={section.page} />;
65
- }
66
- case 'article': {
67
- ModuleComponent = loadable(() =>
68
- import('../../../../components/molecules/header/variants/article')
69
- );
70
- return <ModuleComponent page={section.page} />;
71
- }
72
- case 'operator': {
73
- const data = {
74
- page: section?.page,
75
- author: section?.page.author,
76
- type: section?.page?.relation_type,
77
- template: section?.page?.page_styles?.short_name,
78
- pageTemplate: section?.page?.template,
79
- relation: section?.page?.relation || {},
80
- name: section?.page?.title || section?.page?.relation?.name,
81
- ribbons: section?.page?.relation?.ribbons || [],
82
- image:
83
- section?.page?.relation?.standardised_logo_url_object ||
84
- section?.page?.relation?.logo_url_object,
85
- featureImg: section?.page?.featured_image_object,
86
- extraFields: section?.page?.extra_fields || {},
87
- numOfStars: numOfStarsRating,
88
- };
89
- switch (section?.page?.page_styles?.short_name) {
90
- case 'template_three': {
91
- ModuleComponent = loadable(() =>
92
- import('../../../../components/molecules/header/variants/operator/template-three')
93
- );
94
- return <ModuleComponent {...data} />;
95
- }
96
- case 'template_four': {
97
- ModuleComponent = loadable(() =>
98
- import('../../../../components/molecules/header/variants/operator/template-four/index')
99
- );
100
- return <ModuleComponent {...data} />;
101
- }
102
- case 'template_five': {
103
- ModuleComponent = loadable(() =>
104
- import('../../../../components/molecules/header/variants/operator/template-five/index')
105
- );
106
- return <ModuleComponent {...data} />;
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
- default: {
109
- ModuleComponent = loadable(() =>
110
- import(
111
- '../../../../components/molecules/header/variants/operator/template-one-two/index'
112
- )
113
- );
114
- return <ModuleComponent {...data} />;
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
- case 'game': {
119
- switch (section?.page?.page_styles?.short_name) {
120
- case 'template_two': {
121
- ModuleComponent = loadable(() =>
122
- import('../../../../components/molecules/header/variants/slot/template-two')
123
- );
124
- return <ModuleComponent page={section.page} image="../../../../images/verify.svg" />;
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
- default: {
127
- ModuleComponent = loadable(() =>
128
- import('../../../../components/molecules/header/variants/slot/template-one')
129
- );
130
- return <ModuleComponent page={section.page} image="../../../../images/verify.svg" />;
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
- case 'sport': {
136
- let props = {
137
- page: section.page,
138
- extraFields: section.page.extra_fields,
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
- ModuleComponent = loadable(() =>
142
- import('../../../../components/molecules/header/variants/sport/template-one/index')
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
- case 'page': {
194
- let props = {
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 ReviewCredits =
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
- ? loadable(() => import('../../../../components/atoms/review-credits'))
242
- : null;
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
- ? loadable(() => import('~atoms/author'))
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
- {relationContent(section, numOfStarsRating)}
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
- ? ReviewCredits && (
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
- : Author && (
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
  }),