gatsby-core-theme 31.0.0 → 31.0.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/package.json +1 -1
  3. package/src/components/app-ssr.js +1 -3
  4. package/src/components/atoms/author/index.js +2 -2
  5. package/src/components/atoms/author-box/details/index.js +1 -1
  6. package/src/components/atoms/author-box/template-one/fact-check/index.js +1 -1
  7. package/src/components/atoms/author-box/template-one/index.js +2 -2
  8. package/src/components/atoms/author-box/template-three/fact-check/index.js +1 -1
  9. package/src/components/atoms/author-box/template-three/index.js +1 -1
  10. package/src/components/atoms/author-box/template-two/fact-check/index.js +1 -1
  11. package/src/components/atoms/author-box/template-two/index.js +1 -1
  12. package/src/components/atoms/breadcrumbs/index.js +0 -3
  13. package/src/components/atoms/footer/license/index.js +1 -1
  14. package/src/components/atoms/menu/items/item/index.js +2 -2
  15. package/src/components/molecules/floating-area/index.js +1 -1
  16. package/src/components/molecules/footer/variants/template-one/index.js +7 -4
  17. package/src/components/molecules/footer/variants/template-three/index.js +6 -2
  18. package/src/components/molecules/footer/variants/template-three/template-three.test.js +1 -2
  19. package/src/components/molecules/header/index.js +3 -7
  20. package/src/components/molecules/link-list/index.js +2 -2
  21. package/src/components/molecules/main/index.js +2 -2
  22. package/src/components/molecules/menu/index.js +1 -1
  23. package/src/components/molecules/module/index.js +1 -1
  24. package/src/components/molecules/newsletter/form/index.js +5 -3
  25. package/src/components/molecules/newsletter/index.js +8 -3
  26. package/src/components/molecules/newsletter/newsletter.module.scss +15 -22
  27. package/src/components/molecules/search/index.js +1 -1
  28. package/src/components/organisms/anchor/template-one/index.js +2 -2
  29. package/src/components/organisms/anchor/template-two/index.js +1 -1
  30. package/src/components/organisms/form/fields/index.js +2 -0
  31. package/src/components/organisms/form/index.js +1 -1
  32. package/src/components/organisms/navigation/index.js +3 -3
  33. package/src/components/organisms/toplist/list/index.js +1 -1
  34. package/src/components/pages/body/index.js +1 -1
  35. package/src/components/pages/search/index.js +1 -3
  36. package/src/components/pages/tracker/index-ssr.js +3 -8
  37. package/src/components/pages/tracker/index.js +2 -2
  38. package/src/components/pages/tracker-geo/index-ssr.js +2 -2
  39. package/src/components/pages/tracker-geo/index.js +2 -2
  40. package/src/helpers/schema.js +49 -25
  41. package/src/helpers/schema.test.js +102 -4
  42. package/src/components/molecules/newsletter/form/newsletter-form.module.scss +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,33 @@
1
+ ## [31.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v31.0.1...v31.0.2) (2024-05-22)
2
+
3
+
4
+ ### Code Refactoring
5
+
6
+ * add author data to schema ([1fb10aa](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/1fb10aae770de676ec84fbba2db317aa4e9aa1ec))
7
+ * correction to knows about ([a019d7a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a019d7a706041f5dcc142bb50b2e767cc22c92b1))
8
+
9
+
10
+ * Merge branch 'tm-4271-multiple-contributors' into 'master' ([7bc03c4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7bc03c425ebc85b583324ddac976a56c9b17569e))
11
+
12
+
13
+ ### Tests
14
+
15
+ * fix test ([0bcbf37](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0bcbf3784962944ebb5b85d77043bd9895116cbc))
16
+
17
+ ## [31.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v31.0.0...v31.0.1) (2024-05-20)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * add autocomplete and replace country value with dynamic value in newsletter ([19be5d4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/19be5d45fc47640f251a5d6df190e4775118aef0))
23
+ * as seen on ([75cfed3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/75cfed3de4398d87af7253b3dcde8c749545f842))
24
+ * proptypes warnings ([df30a5e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/df30a5e8bdc60a9d90b27d43d6da86c832edf400))
25
+ * test ([c5ee8a3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c5ee8a330dc68d6eb9169a80c484cdc3301269a1))
26
+
27
+
28
+ * Merge branch 'tm-4317-footer-asseen' into 'master' ([cf9fbcc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cf9fbcc99a526c647dbaae5c59173e12ed257104))
29
+ * Merge branch 'tm-4395-newsletter' into 'master' ([53c3dd8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/53c3dd8231febbf4d019241529b2797da1a9138a))
30
+
1
31
  # [31.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.1.3...v31.0.0) (2024-05-15)
2
32
 
3
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "31.0.0",
3
+ "version": "31.0.2",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -85,9 +85,7 @@ AppSSR.propTypes = {
85
85
  site_name: PropTypes.string,
86
86
  }),
87
87
  }),
88
- serverData: PropTypes.shape({
89
- props: PropTypes.string,
90
- }),
88
+ serverData: PropTypes.any,
91
89
  };
92
90
 
93
91
  export async function getServerData({ pageContext, url }) {
@@ -122,13 +122,13 @@ const Author = ({
122
122
 
123
123
  Author.propTypes = {
124
124
  prefix: PropTypes.string,
125
- name: PropTypes.string.isRequired,
125
+ name: PropTypes.string,
126
126
  date: PropTypes.string,
127
127
  dateFormat: PropTypes.string,
128
128
  type: PropTypes.string,
129
129
  link: PropTypes.string,
130
130
  authorImg: PropTypes.string,
131
- readingTime: PropTypes.string,
131
+ readingTime: PropTypes.number,
132
132
  icon: PropTypes.string,
133
133
  splitDateFormat: PropTypes.string,
134
134
  isCardsAuthor: PropTypes.bool,
@@ -87,7 +87,7 @@ AuthorDetails.propTypes = {
87
87
  author_title: PropTypes.string,
88
88
  ribbon_label: PropTypes.string,
89
89
  experience: PropTypes.string,
90
- pages_count: PropTypes.string,
90
+ pages_count: PropTypes.number,
91
91
  profile_page_path: PropTypes.string,
92
92
  }),
93
93
  width: PropTypes.number,
@@ -65,7 +65,7 @@ FactCheck.propTypes = {
65
65
  date: PropTypes.string,
66
66
  dateFormat: PropTypes.string,
67
67
  dateSeparator: PropTypes.string,
68
- readingTime: PropTypes.string,
68
+ readingTime: PropTypes.number,
69
69
  reviewer: PropTypes.shape({
70
70
  name: PropTypes.string,
71
71
  profile_page_path: PropTypes.string,
@@ -20,7 +20,7 @@ AuthorBox.propTypes = {
20
20
  author: PropTypes.shape({
21
21
  ribbon_label: PropTypes.string,
22
22
  }),
23
- reviewer: PropTypes.string,
24
- readingTime: PropTypes.string,
23
+ reviewer: PropTypes.shape({}),
24
+ readingTime: PropTypes.number,
25
25
  date: PropTypes.string,
26
26
  };
@@ -65,7 +65,7 @@ FactCheck.propTypes = {
65
65
  date: PropTypes.string,
66
66
  dateFormat: PropTypes.string,
67
67
  dateSeparator: PropTypes.string,
68
- readingTime: PropTypes.string,
68
+ readingTime: PropTypes.number,
69
69
  reviewer: PropTypes.shape({
70
70
  name: PropTypes.string,
71
71
  profile_page_path: PropTypes.string,
@@ -24,6 +24,6 @@ AuthorBox.propTypes = {
24
24
  expertise: PropTypes.shape({}),
25
25
  }),
26
26
  reviewer: PropTypes.string,
27
- readingTime: PropTypes.string,
27
+ readingTime: PropTypes.number,
28
28
  date: PropTypes.string,
29
29
  };
@@ -65,7 +65,7 @@ FactCheck.propTypes = {
65
65
  date: PropTypes.string,
66
66
  dateFormat: PropTypes.string,
67
67
  dateSeparator: PropTypes.string,
68
- readingTime: PropTypes.string,
68
+ readingTime: PropTypes.number,
69
69
  reviewer: PropTypes.shape({
70
70
  name: PropTypes.string,
71
71
  profile_page_path: PropTypes.string,
@@ -18,6 +18,6 @@ export default function AuthorBox({ author, reviewer = {}, readingTime = '', dat
18
18
  AuthorBox.propTypes = {
19
19
  author: PropTypes.shape({}),
20
20
  reviewer: PropTypes.string,
21
- readingTime: PropTypes.string,
21
+ readingTime: PropTypes.number,
22
22
  date: PropTypes.string,
23
23
  };
@@ -73,9 +73,6 @@ Breadcrumbs.propTypes = {
73
73
  translations: PropTypes.shape({}),
74
74
  template: PropTypes.string,
75
75
  type: PropTypes.string,
76
- categories: PropTypes.arrayOf({
77
- short_name: PropTypes.string,
78
- }),
79
76
  }).isRequired,
80
77
  separator: PropTypes.element,
81
78
  };
@@ -29,7 +29,7 @@ const FooterLicense = ({
29
29
  />
30
30
  </div>
31
31
  <div className={styles?.security || ''}>
32
- <LazyImage alt="Security icon" width="26" height="20" src={securityIcon} />
32
+ <LazyImage alt="Security icon" width={26} height={20} src={securityIcon} />
33
33
  <span className={styles?.securityText || ''}>
34
34
  {translate(translations, 'licensed_casinos', 'We only list licensed casinos')}
35
35
  </span>
@@ -26,7 +26,7 @@ export default function Item({ item, gtmClass = '' }) {
26
26
  aria-label={`${item?.title} link`}
27
27
  href={item.value ? item.value : '#'}
28
28
  title={item.title}
29
- rel={`noreferrer ${item.nofollow && 'nofollow'}`}
29
+ rel={`noreferrer ${item.nofollow ? 'nofollow' : ''}`}
30
30
  target="_blank"
31
31
  className={`${styles.item || ''} ${gtmClass || ''}`}
32
32
  onClick={() => handleClose()}
@@ -39,7 +39,7 @@ export default function Item({ item, gtmClass = '' }) {
39
39
  disabled={item.value === null}
40
40
  to={item.value}
41
41
  title={item.title}
42
- rel={item.nofollow && 'nofollow'}
42
+ rel={item.nofollow ? 'nofollow' : ''}
43
43
  aria-label={`${item?.title} link`}
44
44
  className={`${styles.item || ''} ${gtmClass || ''}`}
45
45
  onClick={() => handleClose()}
@@ -75,7 +75,7 @@ FloatingArea.propTypes = {
75
75
  }),
76
76
  }),
77
77
  }).isRequired,
78
- customStyles: PropTypes.string,
78
+ customStyles: PropTypes.shape({}),
79
79
  offsetTop: PropTypes.number,
80
80
  hideOperatorBanner: PropTypes.bool,
81
81
  template: PropTypes.string,
@@ -32,8 +32,9 @@ const TemplateOne = ({
32
32
  }) => {
33
33
  return (
34
34
  <footer>
35
- <AsSeenOn asSeenOn={asSeenOn} template="templateOne" />
36
-
35
+ {asSeenOn && asSeenOn?.children?.length > 0 && (
36
+ <AsSeenOn asSeenOn={asSeenOn} template="templateOne" />
37
+ )}
37
38
  <div
38
39
  className={`${styles?.footer || ''} ${styles?.templateOne || ''}
39
40
  ${hasFooterLinks && styles[hasFooterLinks] ? styles.hasFooterLinks || '' : ''}`}
@@ -109,11 +110,13 @@ export default TemplateOne;
109
110
  TemplateOne.propTypes = {
110
111
  footerLogos: PropTypes.shape({}),
111
112
  footerMenu: PropTypes.shape({
112
- children: PropTypes.shape([]),
113
+ children: PropTypes.any,
113
114
  }),
114
115
  copyrightDisclaimer: PropTypes.string,
115
116
  showLinks: PropTypes.bool,
116
- asSeenOn: PropTypes.shape({}),
117
+ asSeenOn: PropTypes.shape({
118
+ children: PropTypes.shape({}),
119
+ }),
117
120
  gamblingText: PropTypes.string,
118
121
  socialIcons: PropTypes.shape({}),
119
122
  hasFooterLinks: PropTypes.bool,
@@ -37,7 +37,9 @@ const TemplateThree = ({
37
37
 
38
38
  return (
39
39
  <footer>
40
- <AsSeenOn asSeenOn={asSeenOn} template="templateThree" />
40
+ {asSeenOn && asSeenOn?.children?.length > 0 && (
41
+ <AsSeenOn asSeenOn={asSeenOn} template="templateThree" />
42
+ )}
41
43
  <div
42
44
  className={`${styles?.footer || ''} ${styles?.templateThree || ''}
43
45
  ${hasFooterLinks && styles[hasFooterLinks] ? styles.hasFooterLinks || '' : ''}`}
@@ -119,7 +121,9 @@ TemplateThree.propTypes = {
119
121
  }),
120
122
  copyrightDisclaimer: PropTypes.string,
121
123
  showLinks: PropTypes.bool,
122
- asSeenOn: PropTypes.shape({}),
124
+ asSeenOn: PropTypes.shape({
125
+ children: PropTypes.shape({}),
126
+ }),
123
127
  gamblingText: PropTypes.string,
124
128
  socialIcons: PropTypes.shape({}),
125
129
  hasFooterLinks: PropTypes.bool,
@@ -114,8 +114,7 @@ describe('Show template one', () => {
114
114
  };
115
115
  const { container } = renderComponent(props);
116
116
  await waitFor(() => {
117
- expect(container.querySelectorAll('footer > div')).toHaveLength(2);
118
- expect(container.querySelectorAll('.asSeenOn')).toHaveLength(1);
117
+ expect(container.querySelectorAll('footer > div')).toHaveLength(1);
119
118
  });
120
119
  });
121
120
  test('render menu list', async () => {
@@ -97,18 +97,14 @@ Header.propTypes = {
97
97
  updated_at: PropTypes.string,
98
98
  created_at: PropTypes.string,
99
99
  reading_time: PropTypes.number,
100
- reviewer: PropTypes.string,
100
+ reviewer: PropTypes.shape({}),
101
101
  reviewer_id: PropTypes.number,
102
- author: PropTypes.shape({
103
- name: PropTypes.string,
104
- profile_page_path: PropTypes.string,
105
- image: PropTypes.string,
106
- }),
102
+ author: PropTypes.shape({}),
107
103
  relation: PropTypes.shape({
108
104
  url: PropTypes.string,
109
105
  email: PropTypes.string,
110
106
  }),
111
- authors: PropTypes.shape([PropTypes.shape({})]),
107
+ authors: PropTypes.any,
112
108
  sections: PropTypes.shape({
113
109
  header: PropTypes.shape({
114
110
  extra_fields: PropTypes.shape({
@@ -64,7 +64,7 @@ const LinkList = ({
64
64
  <a
65
65
  href={link}
66
66
  title={item.title || item.name}
67
- rel={`noreferrer ${item.nofollow && 'nofollow'}`}
67
+ rel={`noreferrer ${item.nofollow ? 'nofollow' : ''}`}
68
68
  target="_blank"
69
69
  className={gtmClass || ''}
70
70
  aria-label={`${item.title || item.name} Link`}
@@ -76,7 +76,7 @@ const LinkList = ({
76
76
  to={link}
77
77
  title={item.title || item.name}
78
78
  className={gtmClass || ''}
79
- rel={item.nofollow && 'nofollow'}
79
+ rel={item.nofollow ? 'nofollow' : ''}
80
80
  aria-label={`${item.title || item.url} Link`}
81
81
  >
82
82
  {renderLinkContent(item, index)}
@@ -72,7 +72,7 @@ const Main = ({
72
72
  )}
73
73
  {SearchPage && (
74
74
  <Suspense fallback={<></>}>
75
- <SearchPage page={page} />
75
+ <SearchPage page={page} serverData={serverData} />
76
76
  </Suspense>
77
77
  )}
78
78
  {Newsletter && (
@@ -101,7 +101,7 @@ Main.propTypes = {
101
101
  path: PropTypes.string,
102
102
  }),
103
103
  pageContext: PropTypes.shape({}),
104
- serverData: PropTypes.shape({}),
104
+ serverData: PropTypes.any,
105
105
  exclOperator: PropTypes.bool,
106
106
  exclNewsletter: PropTypes.bool,
107
107
  };
@@ -94,7 +94,7 @@ Menu.propTypes = {
94
94
  }).isRequired,
95
95
  menu: PropTypes.string,
96
96
  gtmClass: PropTypes.string,
97
- customStyles: PropTypes.string,
97
+ customStyles: PropTypes.shape({}),
98
98
  orientation: PropTypes.oneOf(['horizontal']),
99
99
  mobileAnimation: PropTypes.oneOf(['collapseFull', 'collapse', 'slideLeft', 'slideTop']),
100
100
  stopScrollOnOpen: PropTypes.bool,
@@ -130,7 +130,7 @@ const Modules = ({ module, page, pageContext }) => {
130
130
  module.name || ''
131
131
  } ${styles.module || ''} ${module?.style ? styles[module.style] || '' : ''} module`}
132
132
  >
133
- <ModuleTitle module={module} anchorLabel={module.name === 'archive' && anchorLabel} />
133
+ <ModuleTitle module={module} anchorLabel={module.name === 'archive' ? anchorLabel : ''} />
134
134
  {module.module_introduction && <Content module={{ value: module.module_introduction }} />}
135
135
 
136
136
  {module.name === 'accordion' ||
@@ -14,6 +14,7 @@ const NewsletterForm = ({
14
14
  market,
15
15
  setErr,
16
16
  path,
17
+ country,
17
18
  }) => {
18
19
  const [ip, setIP] = useState('');
19
20
  const [error, setError] = useState(false);
@@ -42,9 +43,9 @@ const NewsletterForm = ({
42
43
  const refName = getUrl(path)?.replace('https://', '') || process.env.BACOM_REF_NAME;
43
44
 
44
45
  await fetch(
45
- `https://bacom.dk/subscribe/gig/?firstname=${name}&user_ip=${ip}&ref_name=${refName}&ref_url=${refUrl}&timestamp=${timestamp}&country=${
46
- process.env.COUNTRY
47
- }&email=${email}${!validatePhoneNr ? `&phone_number=${phomeNumber}` : ''}`,
46
+ `https://bacom.dk/subscribe/gig/?firstname=${name}&user_ip=${ip}&ref_name=${refName}&ref_url=${refUrl}&timestamp=${timestamp}&country=${country}&email=${email}${
47
+ !validatePhoneNr ? `&phone_number=${phomeNumber}` : ''
48
+ }`,
48
49
  {
49
50
  method: 'GET',
50
51
  headers: {
@@ -98,6 +99,7 @@ NewsletterForm.propTypes = {
98
99
  market: PropTypes.string,
99
100
  setErr: PropTypes.bool,
100
101
  path: PropTypes.string,
102
+ country: PropTypes.string,
101
103
  };
102
104
 
103
105
  export default NewsletterForm;
@@ -7,10 +7,10 @@ import Button from './toggle-button/index';
7
7
  import NewsletterForm from './form/index';
8
8
  import styles from './newsletter.module.scss';
9
9
 
10
- const Newsletter = ({ page, openBtnText = 'Unlock Bonuses', isSticky = true }) => {
10
+ const Newsletter = ({ page, openBtnText = 'Unlock Bonuses', isSticky = false }) => {
11
11
  const [toggleNewsetter, setToggleNewsletter] = useState(false);
12
12
  const [isClicked, setIsClicked] = useState(false);
13
-
13
+ const country = page?.market?.split('_')[0].toUpperCase();
14
14
  const { translations } = useContext(Context) || {};
15
15
  const redirectUrl =
16
16
  page?.path === '/'
@@ -48,7 +48,12 @@ const Newsletter = ({ page, openBtnText = 'Unlock Bonuses', isSticky = true }) =
48
48
  : `${styles?.form || ''} ${toggleNewsetter ? styles?.active || '' : ''}`
49
49
  }
50
50
  >
51
- <NewsletterForm market={page?.market} path={page?.path} redirectUrl={redirectUrl} />
51
+ <NewsletterForm
52
+ country={country}
53
+ market={page?.market}
54
+ path={page?.path}
55
+ redirectUrl={redirectUrl}
56
+ />
52
57
  {isSticky && (
53
58
  <MdClose
54
59
  className={styles?.closeBtn || ''}
@@ -56,27 +56,20 @@
56
56
  z-index: var(--scroll-to-top-index);
57
57
  max-width: 100rem;
58
58
  margin: 0 auto;
59
- }
60
-
61
- .form{
62
- // form style
63
- >div{
64
- background: transparent;
65
- box-shadow: none;
66
- h2{
67
-
68
- }
69
- p{
70
-
71
- }
72
- form{
73
-
74
- label{
75
-
76
- }
77
- input{
78
-
79
- }
59
+ form {
60
+ button {
61
+ display: inline-flex;
62
+ align-items: center;
63
+ justify-content: center;
64
+ text-align: center;
65
+ background-color: var(--primary-button-color, #6e33e5);
66
+ color: var(--primary-button-color-text, #ffffff);
67
+ padding: 0.9rem 3rem;
68
+ font-weight: 700;
69
+ font-size: 1.8rem;
70
+ border-radius: var(--border-radius);
71
+ white-space: nowrap;
72
+ border-radius: 100px;
80
73
  }
81
74
  }
82
- }
75
+ }
@@ -450,7 +450,7 @@ Search.propTypes = {
450
450
  children: PropTypes.element,
451
451
  showAll: PropTypes.string,
452
452
  tabsAlign: PropTypes.string,
453
- HeaderComp: PropTypes.elementType,
453
+ HeaderComp: PropTypes.any,
454
454
  }),
455
455
  sort: PropTypes.arrayOf(
456
456
  PropTypes.shape({
@@ -122,7 +122,7 @@ function Anchor({
122
122
  const sticky = isFixed && isSticky(stickyOffset, setActiveAnchor, anchorContainerRef);
123
123
 
124
124
  const anchorItems = anchorList?.map((item, index) => (
125
- <li className={styles.anchorItem || ''}>
125
+ <li key={index} className={styles.anchorItem || ''}>
126
126
  <a
127
127
  className={`${styles.link || ''} anchor-carousel-gtm anchor-menu-gtm`}
128
128
  key={keygen()}
@@ -185,7 +185,7 @@ Anchor.propTypes = {
185
185
  })
186
186
  ),
187
187
  }).isRequired,
188
- headerOffset: PropTypes.number.isRequired,
188
+ headerOffset: PropTypes.number,
189
189
  styles: PropTypes.shape({}),
190
190
  isFixed: PropTypes.bool,
191
191
  icon: PropTypes.element,
@@ -74,7 +74,7 @@ Anchor.propTypes = {
74
74
  })
75
75
  ),
76
76
  }).isRequired,
77
- headerOffset: PropTypes.number.isRequired,
77
+ headerOffset: PropTypes.number,
78
78
  styles: PropTypes.shape({}),
79
79
  icon: PropTypes.element,
80
80
  showTitle: PropTypes.string,
@@ -72,6 +72,7 @@ const getField = (field, handleChange, elements, state) => {
72
72
  type={type}
73
73
  checked={elements[id] === option.label}
74
74
  onChange={(e) => handleChange(e.target.name, option.label)}
75
+ autoComplete="on"
75
76
  />
76
77
  <label
77
78
  key={option.id}
@@ -139,6 +140,7 @@ const getField = (field, handleChange, elements, state) => {
139
140
  value={elements[id]}
140
141
  onChange={(e) => handleChange(e.target.name, e.target.value)}
141
142
  className={`${(!state.isValid && elements[id] === '' && styles.invalid) || ''}`}
143
+ autoComplete={id}
142
144
  />
143
145
  );
144
146
  }
@@ -218,7 +218,7 @@ FormComponent.propTypes = {
218
218
  successMessage: PropTypes.string,
219
219
  failMessage: PropTypes.string,
220
220
  validationMessage: PropTypes.string,
221
- submitUrl: PropTypes.string.isRequired,
221
+ submitUrl: PropTypes.string,
222
222
  hasButton: PropTypes.bool,
223
223
  buttonLabel: PropTypes.string,
224
224
  disabled: PropTypes.bool,
@@ -96,7 +96,7 @@ const Navigation = ({
96
96
  canOpenAllSubMenus={canOpenAllSubMenus}
97
97
  customStyles={customStyles}
98
98
  gtmClass="main-menu-gtm"
99
- menu={template === 'responsible_gambling_guide' && 'rg_menu'}
99
+ menu={template === 'responsible_gambling_guide' ? 'rg_menu' : ''}
100
100
  />
101
101
 
102
102
  {hasSearch && (
@@ -137,7 +137,7 @@ Navigation.propTypes = {
137
137
  pageContext: PropTypes.shape({
138
138
  allMarkets: PropTypes.shape({}),
139
139
  page: PropTypes.shape({
140
- market: PropTypes.shape({}),
140
+ market: PropTypes.string,
141
141
  }),
142
142
  }),
143
143
  hasSearch: PropTypes.bool,
@@ -152,7 +152,7 @@ Navigation.propTypes = {
152
152
  logoHeight: PropTypes.number,
153
153
  searchIcon: PropTypes.string,
154
154
  children: PropTypes.node,
155
- customStyles: PropTypes.string,
155
+ customStyles: PropTypes.shape({}),
156
156
  hasCustomComponent: PropTypes.bool,
157
157
  };
158
158
 
@@ -78,7 +78,7 @@ List.propTypes = {
78
78
  tracker: PropTypes.string,
79
79
  one_liner: PropTypes.string,
80
80
  }),
81
- hasLoadMoreButton: PropTypes.string,
81
+ hasLoadMoreButton: PropTypes.number,
82
82
  initItemsCount: PropTypes.string,
83
83
  loadItemsCount: PropTypes.string,
84
84
  pageTemplate: PropTypes.string,
@@ -57,7 +57,7 @@ function Body({ pageContext, children, serverData }) {
57
57
  Body.propTypes = {
58
58
  children: PropTypes.element,
59
59
  // eslint-disable-next-line react/forbid-prop-types
60
- serverData: PropTypes.shape({}),
60
+ serverData: PropTypes.any,
61
61
  pageContext: PropTypes.shape({
62
62
  page: PropTypes.shape({
63
63
  id: PropTypes.number,
@@ -67,9 +67,7 @@ SearchContent.propTypes = {
67
67
  path: PropTypes.string,
68
68
  updated_at: PropTypes.string,
69
69
  created_at: PropTypes.string,
70
- author: PropTypes.shape({
71
- name: PropTypes.string,
72
- }),
70
+ author: PropTypes.any,
73
71
  translations: PropTypes.shape({}),
74
72
  }),
75
73
  };
@@ -22,8 +22,8 @@ const Tracker = ({
22
22
  counter = false,
23
23
  isStory = false,
24
24
  operatorLogo = false,
25
- operatorLogoWidth = '80',
26
- operatorLogoHeight = '80',
25
+ operatorLogoWidth = 80,
26
+ operatorLogoHeight = 80,
27
27
  serverData,
28
28
  }) => {
29
29
  const { operator, page, translations } = pageContext;
@@ -171,12 +171,7 @@ Tracker.propTypes = {
171
171
  translations: PropTypes.shape({}),
172
172
  }),
173
173
  }),
174
- serverData: PropTypes.shape({
175
- success: PropTypes.bool,
176
- result: PropTypes.shape({
177
- link: PropTypes.string,
178
- }),
179
- }),
174
+ serverData: PropTypes.any,
180
175
  styles: PropTypes.shape({}),
181
176
  };
182
177
 
@@ -22,8 +22,8 @@ const Tracker = ({
22
22
  counter = false,
23
23
  isStory = false,
24
24
  operatorLogo = false,
25
- operatorLogoWidth = '80',
26
- operatorLogoHeight = '80',
25
+ operatorLogoWidth = 80,
26
+ operatorLogoHeight = 80,
27
27
  }) => {
28
28
  const { operator, page, translations } = pageContext;
29
29
 
@@ -20,8 +20,8 @@ export default function TrackerGeo({
20
20
  logo = '../../../../../images/logo.svg',
21
21
  counter = false,
22
22
  operatorLogo = false,
23
- operatorLogoWidth = '80',
24
- operatorLogoHeight = '80',
23
+ operatorLogoWidth = 80,
24
+ operatorLogoHeight = 80,
25
25
  }) {
26
26
  const { page, operatorsByMarket } = pageContext;
27
27
  const operator = operatorsByMarket[Object.keys(operatorsByMarket)[0]][0];
@@ -20,8 +20,8 @@ export default function TrackerGeo({
20
20
  logo = '../../../../../images/logo.svg',
21
21
  counter = false,
22
22
  operatorLogo = false,
23
- operatorLogoWidth = '80',
24
- operatorLogoHeight = '80',
23
+ operatorLogoWidth = 80,
24
+ operatorLogoHeight = 80,
25
25
  }) {
26
26
  const { page, operatorsByMarket } = pageContext;
27
27
  const operator = operatorsByMarket[Object.keys(operatorsByMarket)[0]][0];
@@ -1,4 +1,4 @@
1
- import { getGameRating, getUrl, getLanguage } from './getters';
1
+ import { getGameRating, getUrl, getLanguage, imagePrettyUrl } from './getters';
2
2
  import { cleanHTML } from './strings';
3
3
 
4
4
  /* HardCoded Start */
@@ -31,7 +31,53 @@ const socialLinks = [
31
31
  'wikipedia',
32
32
  'youtube',
33
33
  ];
34
+ const socialAuthorLinks = [
35
+ 'facebook_profile',
36
+ 'twitter_profile',
37
+ 'instagram_profile',
38
+ 'linkedin_profile',
39
+ ];
40
+
34
41
  /* HardCoded End */
42
+ const authorObj = (page, author, webSiteImage) => ({
43
+ '@context': 'https://schema.org',
44
+ '@type': 'Person',
45
+ name: author?.name || '',
46
+ image: author?.image ? imagePrettyUrl(author?.image) : '',
47
+ url: getUrl(author?.profile_page_path),
48
+ jobTitle: author?.author_title,
49
+ email: author?.email_address,
50
+ description: author?.biography,
51
+ sameAs: socialAuthorLinks
52
+ .map((socialLink) => author?.[socialLink])
53
+ .filter((socialLink) => socialLink),
54
+ knowsLanguage: getLanguage(page?.language),
55
+ nationality: {
56
+ '@type': 'Country',
57
+ name: author?.country?.name || '',
58
+ },
59
+ worksFor: {
60
+ '@type': 'Organization',
61
+ name: page?.siteSchema?.site_name,
62
+ logo: webSiteImage,
63
+ url: getUrl('/'),
64
+ sameAs: socialLinks
65
+ .map((socialLink) => page.siteSchema?.[socialLink])
66
+ .filter((socialLink) => socialLink),
67
+ },
68
+ knowsAbout: author?.knows_abouts?.map((item) => ({
69
+ '@type': item?.type,
70
+ name: item?.name,
71
+ sameAs: item?.links.map((link) => link?.link).filter((link) => link),
72
+ })),
73
+ });
74
+
75
+ const getAuthors = (page, webSiteImage) => {
76
+ if (page?.allAuthors?.length) {
77
+ return page?.allAuthors?.map((author) => authorObj(page, author, webSiteImage)) || [];
78
+ }
79
+ return page?.author_id ? authorObj(page, page?.author, webSiteImage) : '';
80
+ };
35
81
 
36
82
  function checkSchemaProp(prop) {
37
83
  return (
@@ -196,7 +242,6 @@ export function webPageSchema(page, pageImage) {
196
242
  '@type': 'Country',
197
243
  name: page?.reviewer?.country?.name,
198
244
  },
199
-
200
245
  knowsAbout: page?.reviewer?.knows_abouts?.map((item) => ({
201
246
  '@type': item?.type,
202
247
  name: item?.name,
@@ -226,23 +271,7 @@ export function webPageSchema(page, pageImage) {
226
271
  .filter((socialLink) => socialLink),
227
272
  ...(page?.knowsAbout ? { knowsAbout: page?.knowsAbout } : {}),
228
273
  },
229
- author: {
230
- '@type': 'Person',
231
- name: page?.author?.name,
232
- jobTitle: page?.author?.author_title,
233
- image: page?.author?.image_object?.url,
234
- email: page?.author?.email_address,
235
- nationality: {
236
- '@type': 'Country',
237
- name: page?.author?.country?.name,
238
- },
239
-
240
- knowsAbout: page?.author?.knows_abouts?.map((item) => ({
241
- '@type': item?.type,
242
- name: item?.name,
243
- sameAs: item?.links.map((link) => link?.link).filter((link) => link),
244
- })),
245
- },
274
+ author: getAuthors(page),
246
275
  };
247
276
  if (speakAbleModules.length > 0) {
248
277
  schema['@speakAbleModules'] = speakAbleModules.map((module) => JSON.parse(module));
@@ -359,12 +388,7 @@ export function moduleSchemas(modules, path, page, pageImage) {
359
388
 
360
389
  export function templateSchemas(page, pageImage) {
361
390
  const sharedProps = {
362
- author: {
363
- '@type': 'Person',
364
- name: page.author?.name?.substring(0, 100),
365
- url: getUrl(page.author?.profile_page_path || '/'),
366
- ...(page?.author?.knowsAbout ? { knowsAbout: page?.author?.knowsAbout } : {}),
367
- },
391
+ author: getAuthors(page),
368
392
  publisher: {
369
393
  '@type': 'Organization',
370
394
  name:
@@ -118,9 +118,11 @@ describe('Schema Helper', () => {
118
118
  created_at: '01/01/01',
119
119
  updated_at: '02/02/02',
120
120
  seo_keywords: ['keyword_a', 'keyword_b'],
121
+ author_id: 112,
121
122
  author: {
122
123
  profile_page_path: 'author_a/author_page',
123
124
  email_address: 'email_a@email.com',
125
+ image: 'author_image.jpg',
124
126
  name: 'Author_A',
125
127
  image_object: {
126
128
  url: 'author_image.jpg',
@@ -220,7 +222,7 @@ describe('Schema Helper', () => {
220
222
  expect(json.primaryImageOfPage.inLanguage).toEqual('site_lang');
221
223
  expect(Object.prototype.toString.call(json.author)).toEqual('[object Object]');
222
224
  expect(json.author['@type']).toEqual('Person');
223
- expect(json.author.image).toEqual('author_image.jpg');
225
+ expect(json.author.image).toEqual('https://cdn.images.com/author_image.jpg');
224
226
  expect(Object.prototype.toString.call(json.author.knowsAbout)).toEqual('[object Array]');
225
227
  expect(json.author.knowsAbout).toHaveLength(2);
226
228
  expect(Object.prototype.toString.call(json.reviewedBy)).toEqual('[object Object]');
@@ -330,9 +332,41 @@ describe('Schema Helper', () => {
330
332
  featured_image_object: {
331
333
  url: 'featured_image/image.jpg',
332
334
  },
335
+ author_id: 112,
333
336
  author: {
334
- name: 'Very long name for the 100 characters Article Author test - ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ',
335
337
  profile_page_path: 'article_author/author_page',
338
+ email_address: 'email_a@email.com',
339
+ image: 'author_image.jpg',
340
+ name: 'Very long name for the 100 characters Article Author test - ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMN',
341
+ image_object: {
342
+ url: 'author_image.jpg',
343
+ },
344
+ knows_abouts: [
345
+ {
346
+ '@type': 'Thing',
347
+ name: 'Ireland',
348
+ links: [
349
+ {
350
+ link: 'www.test.com',
351
+ },
352
+ {
353
+ link: 'www.test2.com',
354
+ },
355
+ ],
356
+ },
357
+ {
358
+ '@type': 'Thing',
359
+ name: 'South Africa',
360
+ links: [
361
+ {
362
+ link: 'www.test.com',
363
+ },
364
+ {
365
+ link: 'www.test2.com',
366
+ },
367
+ ],
368
+ },
369
+ ],
336
370
  },
337
371
  siteInfo: {
338
372
  site_logo: 'logo.jpg',
@@ -379,9 +413,41 @@ describe('Schema Helper', () => {
379
413
  featured_image_object: {
380
414
  url: 'featured_image/image.jpg',
381
415
  },
416
+ author_id: 112,
382
417
  author: {
383
- name: 'Very long name for the 100 characters Article Author test - ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ',
418
+ name: 'Very long name for the 100 characters Article Author test - ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMN',
384
419
  profile_page_path: 'operator_review_author/author_page',
420
+ email_address: 'email_a@email.com',
421
+ image: 'author_image.jpg',
422
+ image_object: {
423
+ url: 'author_image.jpg',
424
+ },
425
+ knows_abouts: [
426
+ {
427
+ '@type': 'Thing',
428
+ name: 'Ireland',
429
+ links: [
430
+ {
431
+ link: 'www.test.com',
432
+ },
433
+ {
434
+ link: 'www.test2.com',
435
+ },
436
+ ],
437
+ },
438
+ {
439
+ '@type': 'Thing',
440
+ name: 'South Africa',
441
+ links: [
442
+ {
443
+ link: 'www.test.com',
444
+ },
445
+ {
446
+ link: 'www.test2.com',
447
+ },
448
+ ],
449
+ },
450
+ ],
385
451
  },
386
452
  siteInfo: {
387
453
  site_logo: 'logo.jpg',
@@ -434,9 +500,41 @@ describe('Schema Helper', () => {
434
500
  featured_image_object: {
435
501
  url: 'featured_image/image.jpg',
436
502
  },
503
+ author_id: 112,
437
504
  author: {
438
- name: 'Very long name for the 100 characters Article Author test - ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ',
505
+ name: 'Very long name for the 100 characters Article Author test - ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMN',
439
506
  profile_page_path: 'operator_review_author/author_page',
507
+ email_address: 'email_a@email.com',
508
+ image: 'author_image.jpg',
509
+ image_object: {
510
+ url: 'author_image.jpg',
511
+ },
512
+ knows_abouts: [
513
+ {
514
+ '@type': 'Thing',
515
+ name: 'Ireland',
516
+ links: [
517
+ {
518
+ link: 'www.test.com',
519
+ },
520
+ {
521
+ link: 'www.test2.com',
522
+ },
523
+ ],
524
+ },
525
+ {
526
+ '@type': 'Thing',
527
+ name: 'South Africa',
528
+ links: [
529
+ {
530
+ link: 'www.test.com',
531
+ },
532
+ {
533
+ link: 'www.test2.com',
534
+ },
535
+ ],
536
+ },
537
+ ],
440
538
  },
441
539
  siteInfo: {
442
540
  site_logo: 'logo.jpg',