gatsby-core-theme 35.0.10 → 35.1.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ # [35.1.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v35.0.10...v35.1.0) (2024-08-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix order of ratings ([7cd4cb7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7cd4cb738b560101de9d2dfd107cdb9a8783d3cf))
7
+ * fix test ([5b800c0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5b800c033a6192457f96ffb0eda3eee283688232))
8
+ * fixed the translations ([b0b1e60](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b0b1e602f180b0a50d00470459eeb8b7a442d940))
9
+ * fixed the type ([c03470d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c03470d3272d9b4275735e590093ffb68a1f665e))
10
+ * newsletter icon ([69fd2aa](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/69fd2aae507f0350779cfe7eb5bb3c29ab03ed9b))
11
+ * remove eslint comments ([4371f26](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4371f26186e92677e08d37163cc9e2945eeb3513))
12
+
13
+
14
+ * Merge branch 'tm-4639-operator-rating' into 'master' ([f4d0542](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f4d0542662dfc3589e729f3e087256ccb4bb79ca))
15
+ * Merge branch 'tm-4654-multiple-contributor' into 'master' ([9a82e8b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9a82e8be4201186f284f163e722a11a8928252a7))
16
+ * Merge branch 'search-fix' into 'master' ([fffe301](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/fffe301312a24291a9d3a68e414ff68c5ea58447))
17
+ * Merge branch 'tm-4628-newsltter-icon' into 'master' ([0e64dbd](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0e64dbda8685d5bf991972de4f1a64e076c6368a))
18
+
19
+
20
+ ### Features
21
+
22
+ * add author review per page per author ([4a7ea45](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4a7ea455709d3e00fefaf24858fc77e7a9c61d0b))
23
+
1
24
  ## [35.0.10](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v35.0.9...v35.0.10) (2024-07-31)
2
25
 
3
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "35.0.10",
3
+ "version": "35.1.0",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -56,7 +56,7 @@ const AppSSR = ({ pageContext, serverData, data }) => {
56
56
 
57
57
  return (
58
58
  <>
59
- <MainProvider value={{ translations: data.translations }}>
59
+ <MainProvider value={{ translations: data.translations, language: pageContext.page.language }} >
60
60
  <Body pageContext={isPreview ? previewContext : pageContext} serverData={serverData} />
61
61
  </MainProvider>
62
62
  </>
@@ -104,6 +104,7 @@ AppSSR.propTypes = {
104
104
  };
105
105
 
106
106
  export async function getServerData(props) {
107
+ // eslint-disable-next-line no-shadow
107
108
  const { pageContext, url, query, headers } = props;
108
109
  let res = '';
109
110
  res = await getAPIData(pageContext.page, query.s ? url : headers.get('referer'));
@@ -1,39 +1,40 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import Form from 'gatsby-core-theme/src/components/organisms/form';
4
- import useTranslate from '~hooks/useTranslate/useTranslate';
5
- import { contactUsForm } from '../../../constants/forms';
6
- import styles from './contact-form.module.scss';
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import Form from "gatsby-core-theme/src/components/organisms/form";
4
+ import { FaArrowRight } from "@react-icons/all-files/fa/FaArrowRight";
5
+ import useTranslate from "~hooks/useTranslate/useTranslate";
6
+ import { contactUsForm } from "../../../constants/forms";
7
+ import styles from "./contact-form.module.scss";
7
8
 
8
9
  const ContactForm = ({
9
10
  page,
10
- submitUrl = '',
11
- successMessage = 'Message sent successfully.',
12
- failMessage = 'Message failed to send.',
13
- validationMessage = 'Fill all the required fields.',
14
- buttonLabel = 'Send Message',
11
+ submitUrl = "",
12
+ successMessage = "Message sent successfully.",
13
+ failMessage = "Message failed to send.",
14
+ validationMessage = "Fill all the required fields.",
15
+ buttonLabel = "Send Message",
15
16
  showButtonIcon = true,
16
17
  showLabels = true,
17
18
  showHeading = true,
18
19
  showDescription = true,
20
+ buttonIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />,
19
21
  }) => {
20
22
  const activeMarket = page?.market;
21
23
 
22
- return (
23
- <div className={styles.contactForm || ''}>
24
- <div className={styles.contactBox || ''}>
25
- <div className={styles.formWrapper || ''}>
26
- {showHeading && <h1>{useTranslate('contact_us', 'Contact Us')}</h1>}
27
- {showDescription && (
28
- <p>
29
- {useTranslate(
30
- 'contact_us_questions',
31
- `If you have questions about our reviews, games or content, or just want to leave some
24
+ const headingText = useTranslate("contact_us", "Contact Us");
25
+ const descriptionText = useTranslate(
26
+ "contact_us_questions",
27
+ `If you have questions about our reviews, games or content, or just want to leave some
32
28
  feedback, the Irish Luck team would love to hear from you. You can contact us any time
33
29
  using the details below and we'll endeavour to get back to you within 48 hours.`
34
- )}
35
- </p>
36
- )}
30
+ );
31
+
32
+ return (
33
+ <div className={styles.contactForm || ""}>
34
+ <div className={styles.contactBox || ""}>
35
+ <div className={styles.formWrapper || ""}>
36
+ {showHeading && <h1>{headingText}</h1>}
37
+ {showDescription && <p>{descriptionText}</p>}
37
38
  <Form
38
39
  formOptions={contactUsForm[activeMarket]}
39
40
  showLabels={showLabels}
@@ -45,6 +46,7 @@ const ContactForm = ({
45
46
  failMessage={failMessage}
46
47
  validationMessage={validationMessage}
47
48
  path={page?.path}
49
+ buttonIcon={buttonIcon}
48
50
  />
49
51
  </div>
50
52
  </div>
@@ -68,4 +70,5 @@ ContactForm.propTypes = {
68
70
  showLabels: PropTypes.bool,
69
71
  showHeading: PropTypes.bool,
70
72
  showDescription: PropTypes.bool,
73
+ buttonIcon: PropTypes.element,
71
74
  };
@@ -1,20 +1,36 @@
1
+ /* eslint-disable react-hooks/rules-of-hooks */
1
2
  /* eslint-disable camelcase */
2
3
  /* eslint-disable no-nested-ternary */
3
- import React from 'react';
4
- import PropTypes from 'prop-types';
5
- import useTranslate from '~hooks/useTranslate/useTranslate';
6
- import { getObjectValue } from 'gatsby-core-theme/src/helpers/getters';
7
- import keygen from 'gatsby-core-theme/src/helpers/keygen';
8
- import { operatorRatings } from '../../../constants/ratings-constant';
4
+ import React from "react";
5
+ import PropTypes from "prop-types";
6
+ import { getObjectValue } from "gatsby-core-theme/src/helpers/getters";
7
+ import keygen from "gatsby-core-theme/src/helpers/keygen";
8
+ import useTranslate from "~hooks/useTranslate/useTranslate";
9
+ import { operatorRatings } from "../../../constants/ratings-constant";
9
10
 
10
- import styles from './ratings.module.scss';
11
+ import styles from "./ratings.module.scss";
11
12
 
12
- export default function Ratings({ item, type, numOfStars = 5, currency = '€' }) {
13
- const ratings = operatorRatings[type] || [];
14
- const rangeText = { 0: 'Low', 1: 'Medium', 2: 'High' };
13
+ export default function Ratings({
14
+ item,
15
+ type,
16
+ numOfStars = 5,
17
+ currency = "€",
18
+ }) {
19
+ const typeCheck =
20
+ type === "operator"
21
+ ? item?.type === "casino"
22
+ ? "operator"
23
+ : item?.type
24
+ : type;
25
+
26
+ const ratings = operatorRatings[typeCheck] || [];
27
+
28
+ const rangeText = { 0: "Low", 1: "Medium", 2: "High" };
15
29
 
16
30
  // (item?.bonus || item) for the games we don't have ratings in market
17
- const ratingsData = operatorRatings.ratingProperties.some((prop) => item[prop])
31
+ const ratingsData = operatorRatings.ratingProperties.some(
32
+ (prop) => item[prop]
33
+ )
18
34
  ? item
19
35
  : item?.bonus || item;
20
36
 
@@ -24,42 +40,48 @@ export default function Ratings({ item, type, numOfStars = 5, currency = '€' }
24
40
 
25
41
  return (
26
42
  // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
27
- <ul className={`${styles?.ratingList || ''}`} tabIndex={0}>
43
+ <ul className={`${styles?.ratingList || ""}`} tabIndex={0}>
28
44
  {ratings?.map((rating) => {
29
- const { fieldValue, translationKey, fieldLabel, componentToUse } = rating || {};
45
+ const { fieldValue, translationKey, fieldLabel, componentToUse } =
46
+ rating || {};
30
47
  let valueDiplayed;
31
48
  const value = getObjectValue(ratingsData, fieldValue);
32
- const component = componentToUse ? componentToUse(numOfStars, value, currency) : false;
49
+ const component = componentToUse
50
+ ? componentToUse(numOfStars, value, currency)
51
+ : false;
33
52
 
34
53
  if (component && value) {
35
- valueDiplayed = component || '-';
36
- } else if (fieldValue.includes('volatility')) {
37
- valueDiplayed = rangeText[getObjectValue(ratingsData, fieldValue)] || '-';
54
+ valueDiplayed = component || "-";
55
+ } else if (fieldValue.includes("volatility")) {
56
+ valueDiplayed =
57
+ rangeText[getObjectValue(ratingsData, fieldValue)] || "-";
38
58
  } else {
39
- valueDiplayed = value || '-';
59
+ valueDiplayed = value || "-";
40
60
  }
41
61
 
42
- if (['coming_soon', 'inactive'].includes(item?.status)) {
43
- valueDiplayed = 'TBA';
62
+ if (["coming_soon", "inactive"].includes(item?.status)) {
63
+ valueDiplayed = "TBA";
44
64
  }
45
65
 
46
66
  return (
47
67
  <li
48
68
  key={keygen()}
49
- className={`${styles?.item || ''} ${
50
- rating?.showOnlyMobile ? styles?.showOnlyMobile || '' : ''
69
+ className={`${styles?.item || ""} ${
70
+ rating?.showOnlyMobile ? styles?.showOnlyMobile || "" : ""
51
71
  }`}
52
72
  >
53
- <p className={styles?.label || ''}>{useTranslate(translationKey, fieldLabel)}</p>
73
+ <p className={styles?.label || ""}>
74
+ {useTranslate(translationKey, fieldLabel)}
75
+ </p>
54
76
 
55
- {valueDiplayed === 'TBA' ? (
56
- <p className={`${styles?.value || ''} ${styles?.tbaValue}`}>
57
- {useTranslate('tba', 'TBA')}
77
+ {valueDiplayed === "TBA" ? (
78
+ <p className={`${styles?.value || ""} ${styles?.tbaValue}`}>
79
+ {useTranslate("tba", "TBA")}
58
80
  </p>
59
81
  ) : (
60
82
  <>
61
83
  {valueDiplayed}
62
- {fieldValue === 'rtp' && '%'}
84
+ {fieldValue === "rtp" && "%"}
63
85
  </>
64
86
  )}
65
87
  </li>
@@ -84,6 +106,7 @@ Ratings.propTypes = {
84
106
  second_rating: PropTypes.string,
85
107
  third_rating: PropTypes.string,
86
108
  fourth_rating: PropTypes.string,
109
+ type: PropTypes.string,
87
110
  }),
88
111
  type: PropTypes.string,
89
112
  numOfStars: PropTypes.string,
@@ -17,6 +17,7 @@ describe('Rating component', () => {
17
17
  second_rating: '',
18
18
  third_rating: '3',
19
19
  fourth_rating: true,
20
+ type: 'casino',
20
21
  volatility: 1,
21
22
  bonus: {
22
23
  rating: '4',
@@ -1,35 +1,37 @@
1
1
  /* eslint-disable no-unused-expressions */
2
2
 
3
- import React, { useState, useEffect } from 'react';
4
- import PropTypes from 'prop-types';
3
+ import React, { useState, useEffect } from "react";
4
+ import PropTypes from "prop-types";
5
+ import { FaArrowRight } from "@react-icons/all-files/fa/FaArrowRight";
5
6
 
6
- import { getUrl } from 'gatsby-core-theme/src/helpers/getters';
7
- import Form from '../../../organisms/form';
8
- import { newsLetterForm } from '../../../../constants/forms';
9
- import useTranslate from '~hooks/useTranslate/useTranslate';
7
+ import { getUrl } from "gatsby-core-theme/src/helpers/getters";
8
+ import Form from "../../../organisms/form";
9
+ import { newsLetterForm } from "../../../../constants/forms";
10
+ import useTranslate from "~hooks/useTranslate/useTranslate";
10
11
 
11
12
  const NewsletterForm = ({
12
13
  handleApi,
13
14
  redirectUrl,
14
- submitText = 'Submit',
15
+ submitText = "Submit",
15
16
  market,
16
17
  setErr,
17
18
  path,
18
19
  country,
19
20
  showLabels = true,
20
- titleType = 'h2',
21
+ titleType = "h2",
22
+ buttonIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />,
21
23
  }) => {
22
- const [ip, setIP] = useState('');
24
+ const [ip, setIP] = useState("");
23
25
  const [error, setError] = useState(false);
24
26
 
25
27
  const getData = async () => {
26
- await fetch('https://geolocation-db.com/json/', {
27
- method: 'GET',
28
+ await fetch("https://geolocation-db.com/json/", {
29
+ method: "GET",
28
30
  })
29
31
  .then((response) => response.json())
30
32
  .then((data) => setIP(data.IPv4))
31
33
  .catch((err) => {
32
- // console.log(`Error ${err}`);
34
+ console.log(`Error ${err}`);
33
35
  });
34
36
  };
35
37
 
@@ -38,7 +40,7 @@ const NewsletterForm = ({
38
40
  }, []);
39
41
 
40
42
  function removeTrailingSlash(url) {
41
- if (url.endsWith('/')) {
43
+ if (url.endsWith("/")) {
42
44
  return url.slice(0, -1);
43
45
  }
44
46
  return url;
@@ -48,23 +50,24 @@ const NewsletterForm = ({
48
50
  // eslint-disable-next-line no-bitwise
49
51
  const timestamp = (Date.now() / 1000) | 0;
50
52
  const refUrl = removeTrailingSlash(process.env.GATSBY_SITE_URL);
51
- const validatePhoneNr = typeof phomeNumber === 'undefined';
52
- const refName = getUrl(path)?.replace('https://', '') || process.env.GATSBY_SITE_NAME;
53
+ const validatePhoneNr = typeof phomeNumber === "undefined";
54
+ const refName =
55
+ getUrl(path)?.replace("https://", "") || process.env.GATSBY_SITE_NAME;
53
56
 
54
57
  await fetch(
55
58
  `https://bacom.dk/subscribe/gig/?firstname=${name}&user_ip=${ip}&ref_name=${refName}&ref_url=${refUrl}&timestamp=${timestamp}&country=${country}&email=${email}${
56
- !validatePhoneNr ? `&phone_number=${phomeNumber}` : ''
59
+ !validatePhoneNr ? `&phone_number=${phomeNumber}` : ""
57
60
  }`,
58
61
  {
59
- method: 'GET',
62
+ method: "GET",
60
63
  headers: {
61
- 'Content-Type': 'application/json',
62
- Accept: 'application/json',
64
+ "Content-Type": "application/json",
65
+ Accept: "application/json",
63
66
  },
64
67
  }
65
68
  ).then((res) =>
66
69
  res.text().then((text) => {
67
- text === 'OK' ? (window.location.href = redirectUrl) : setError(true);
70
+ text === "OK" ? (window.location.href = redirectUrl) : setError(true);
68
71
  })
69
72
  );
70
73
  };
@@ -74,27 +77,26 @@ const NewsletterForm = ({
74
77
  ? handleApi(e?.name?.value, e?.email?.value, e?.phomeNumber?.value, ip)
75
78
  : bacomApi(e?.name?.value, e?.email?.value, e?.phomeNumber?.value);
76
79
 
77
- if (error || setErr)
78
- return (
79
- <span>
80
- {useTranslate('fail_error_newsletter', 'Something went wrong. Please try again later!')}{' '}
81
- </span>
82
- );
80
+ const failMessage = useTranslate(
81
+ "fail_error_newsletter",
82
+ "Something went wrong. Please try again later!"
83
+ );
84
+ const successMessage = useTranslate("newsletter_form_thanks", "");
85
+
86
+ if (error || setErr) return <span>{failMessage}</span>;
83
87
 
84
88
  return (
85
89
  <Form
86
90
  formOptions={newsLetterForm[market] || newsLetterForm.default}
87
- successMessage={useTranslate('newsletter_form_thanks', '')}
88
- failMessage={useTranslate(
89
- 'fail_error_newsletter',
90
- 'Something went wrong. Please try again later!'
91
- )}
91
+ successMessage={successMessage}
92
+ failMessage={failMessage}
92
93
  customeSubmit={handelSubmit}
93
94
  customError
94
95
  buttonLabel={submitText}
95
96
  path={path}
96
97
  showLabels={showLabels}
97
98
  titleType={titleType}
99
+ buttonIcon={buttonIcon}
98
100
  />
99
101
  );
100
102
  };
@@ -108,6 +110,7 @@ NewsletterForm.propTypes = {
108
110
  country: PropTypes.string,
109
111
  showLabels: PropTypes.bool,
110
112
  titleType: PropTypes.string,
113
+ buttonIcon: PropTypes.element,
111
114
  };
112
115
 
113
116
  export default NewsletterForm;
@@ -1,8 +1,9 @@
1
- import React, { useState, useContext } from 'react';
1
+ /* eslint-disable react/no-unknown-property */
2
+ /* eslint-disable react-hooks/rules-of-hooks */
3
+ import React, { useState } from 'react';
2
4
  import PropTypes from 'prop-types';
3
5
  import { FaSearch } from '@react-icons/all-files/fa/FaSearch';
4
- import { Context } from 'gatsby-core-theme/src/context/MainProvider';
5
- import { translate } from '~helpers/getters';
6
+ import useTranslate from '~hooks/useTranslate/useTranslate';
6
7
  import styles from './search.module.scss';
7
8
  import ModuleTitle from '~atoms/module-title';
8
9
  import Archive from '~organisms/archive';
@@ -18,7 +19,6 @@ const Search = ({
18
19
  showNumberOfResults = true,
19
20
  allMarkets,
20
21
  }) => {
21
- const { translations } = useContext(Context) || {};
22
22
  const { data, searchParam } = serverData;
23
23
  const [sortQuery] = useState(pageSearchOptions.sort[0]);
24
24
  const [searchData, setSearchData] = useState(data);
@@ -28,6 +28,7 @@ const Search = ({
28
28
  const marketPrefix = activeMarket?.path_prefix || '/';
29
29
 
30
30
  const sortHandle = (field, name, type) => {
31
+ // eslint-disable-next-line array-callback-return
31
32
  Object.keys(searchData).map((item) => {
32
33
  switch (type) {
33
34
  case 'date':
@@ -52,7 +53,7 @@ const Search = ({
52
53
  const items = {
53
54
  items: searchData[item],
54
55
  model_type: item,
55
- title: titleObj ? translate(translations, titleObj.title, titleObj.title) : '',
56
+ title: titleObj ? useTranslate(titleObj.title, titleObj.title) : '',
56
57
  pagination_type: 'load_more',
57
58
  ...pageSearchOptions.archiveOptions.includeOptions,
58
59
  };
@@ -60,13 +61,13 @@ const Search = ({
60
61
  return (
61
62
  <div
62
63
  results={items.items.length}
63
- label={translate(translations, item, item)}
64
+ label={useTranslate(item, item)}
64
65
  tabId={item}
65
66
  key={keygen()}
66
67
  >
67
68
  <ModuleTitle
68
69
  module={{
69
- module_title: translate(translations, item, item),
70
+ module_title: useTranslate(item, item),
70
71
  module_title_tag: 'h2',
71
72
  }}
72
73
  />
@@ -83,7 +84,7 @@ const Search = ({
83
84
  return (
84
85
  <div className={styles.container}>
85
86
  <h1>
86
- {translate(translations, 'search_for', 'Search For:')} {searchParam}
87
+ {useTranslate('search_for', 'Search For:')} {searchParam}
87
88
  </h1>
88
89
  <form>
89
90
  <input
@@ -140,8 +141,7 @@ const Search = ({
140
141
  </div>
141
142
  ) : (
142
143
  <div className={styles.noData}>
143
- {translate(
144
- translations,
144
+ {useTranslate(
145
145
  'no_search_data',
146
146
  'No data, please type keyword in textbox above'
147
147
  )}
@@ -153,7 +153,7 @@ const Search = ({
153
153
 
154
154
  Search.propTypes = {
155
155
  serverData: PropTypes.shape({
156
- data: PropTypes.shape({}),
156
+ data: PropTypes.arrayOf(),
157
157
  searchParam: PropTypes.string,
158
158
  }),
159
159
  allMarkets: PropTypes.shape({}),
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react-hooks/rules-of-hooks */
1
2
  import React, { useState, useRef } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import ReCAPTCHA from 'react-google-recaptcha';
@@ -22,6 +23,7 @@ const FormComponent = ({
22
23
  customError = false,
23
24
  path = '',
24
25
  titleType = 'h2',
26
+ buttonIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />
25
27
  }) => {
26
28
  const recaptchaRef = useRef();
27
29
  const formRef = useRef();
@@ -190,7 +192,7 @@ const FormComponent = ({
190
192
  ? useTranslate('loading_btn', 'sending...')
191
193
  : useTranslate('send_button', buttonLabel)}
192
194
  {showButtonIcon ? (
193
- <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />
195
+ buttonIcon
194
196
  ) : null}
195
197
  </button>
196
198
  )}
@@ -224,5 +226,6 @@ FormComponent.propTypes = {
224
226
  customeSubmit: PropTypes.func,
225
227
  path: PropTypes.string,
226
228
  titleType: PropTypes.string,
229
+ buttonIcon: PropTypes.element,
227
230
  };
228
231
  export default FormComponent;
@@ -60,6 +60,7 @@ export const pickRelationKeys = {
60
60
  'rating_games',
61
61
  'rating_bonuses',
62
62
  'rating_customer',
63
+ 'rating_payout',
63
64
  'type',
64
65
  'types',
65
66
  'path',
@@ -1,166 +1,228 @@
1
1
  /* eslint-disable react/react-in-jsx-scope */
2
2
  /* eslint-disable import/prefer-default-export */
3
- import React from 'react';
4
- import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
5
- import { FaStar } from '@react-icons/all-files/fa/FaStar';
3
+ import React from "react";
4
+ import StarRating from "gatsby-core-theme/src/components/molecules/star-rating/one-star";
5
+ import { FaStar } from "@react-icons/all-files/fa/FaStar";
6
6
 
7
7
  export const operatorRatings = {
8
8
  operator: [
9
9
  {
10
- fieldLabel: 'Overall',
11
- translationKey: 'rating',
12
- fieldValue: 'rating',
10
+ fieldLabel: "Overall",
11
+ translationKey: "rating",
12
+ fieldValue: "rating",
13
13
  componentToUse: (numOfStars, value) => (
14
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
14
+ <StarRating
15
+ numOfStars={numOfStars}
16
+ rating={value}
17
+ icon={<FaStar title="Star Icon" />}
18
+ />
15
19
  ),
16
20
  showOnlyMobile: true,
17
21
  },
18
22
  {
19
- fieldLabel: 'Bonus',
20
- translationKey: 'bonus_offers',
21
- fieldValue: 'rating_bonuses',
23
+ fieldLabel: "Casino",
24
+ translationKey: "rating_casino",
25
+ fieldValue: "rating_casino",
22
26
  componentToUse: (numOfStars, value) => (
23
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
27
+ <StarRating
28
+ numOfStars={numOfStars}
29
+ rating={value}
30
+ icon={<FaStar title="Star Icon" />}
31
+ />
24
32
  ),
25
33
  },
26
34
  {
27
- fieldLabel: 'Payment',
28
- translationKey: 'payment_method',
29
- fieldValue: 'rating_payout',
35
+ fieldLabel: "Games",
36
+ translationKey: "rating_games",
37
+ fieldValue: "rating_games",
30
38
  componentToUse: (numOfStars, value) => (
31
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
39
+ <StarRating
40
+ numOfStars={numOfStars}
41
+ rating={value}
42
+ icon={<FaStar title="Star Icon" />}
43
+ />
32
44
  ),
33
45
  },
34
46
  {
35
- fieldLabel: 'Support',
36
- translationKey: 'customer_service',
37
- fieldValue: 'rating_games',
47
+ fieldLabel: "Bonuses",
48
+ translationKey: "bonus_offers",
49
+ fieldValue: "rating_bonuses",
38
50
  componentToUse: (numOfStars, value) => (
39
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
51
+ <StarRating
52
+ numOfStars={numOfStars}
53
+ rating={value}
54
+ icon={<FaStar title="Star Icon" />}
55
+ />
40
56
  ),
41
57
  },
42
58
  {
43
- fieldLabel: 'Usability',
44
- translationKey: 'site_usability',
45
- fieldValue: 'rating_customer',
59
+ fieldLabel: "Customer",
60
+ translationKey: "rating_customer",
61
+ fieldValue: "rating_customer",
46
62
  componentToUse: (numOfStars, value) => (
47
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
63
+ <StarRating
64
+ numOfStars={numOfStars}
65
+ rating={value}
66
+ icon={<FaStar title="Star Icon" />}
67
+ />
48
68
  ),
49
69
  },
50
70
  {
51
- fieldLabel: 'Games',
52
- translationKey: 'games',
53
- fieldValue: 'rating_casino',
71
+ fieldLabel: "Payout",
72
+ translationKey: "rating_payout",
73
+ fieldValue: "rating_payout",
54
74
  componentToUse: (numOfStars, value) => (
55
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
75
+ <StarRating
76
+ numOfStars={numOfStars}
77
+ rating={value}
78
+ icon={<FaStar title="Star Icon" />}
79
+ />
56
80
  ),
57
81
  },
58
82
  ],
59
83
  sportsbook: [
60
84
  {
61
- fieldLabel: 'Bonus',
62
- translationKey: 'bonus_offers',
63
- fieldValue: 'rating_bonuses',
85
+ fieldLabel: "Sportsbook",
86
+ translationKey: "rating_sportsbook",
87
+ fieldValue: "rating_casino",
64
88
  componentToUse: (numOfStars, value) => (
65
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
89
+ <StarRating
90
+ numOfStars={numOfStars}
91
+ rating={value}
92
+ icon={<FaStar title="Star Icon" />}
93
+ />
66
94
  ),
67
- showOnlyMobile: true,
68
95
  },
69
96
  {
70
- fieldLabel: 'Payment',
71
- translationKey: 'payment_method',
72
- fieldValue: 'rating_payout',
97
+ fieldLabel: "Games",
98
+ translationKey: "rating_games",
99
+ fieldValue: "rating_games",
73
100
  componentToUse: (numOfStars, value) => (
74
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
101
+ <StarRating
102
+ numOfStars={numOfStars}
103
+ rating={value}
104
+ icon={<FaStar title="Star Icon" />}
105
+ />
75
106
  ),
76
107
  },
77
108
  {
78
- fieldLabel: 'Support',
79
- translationKey: 'customer_service',
80
- fieldValue: 'rating_games',
109
+ fieldLabel: "Bonuses",
110
+ translationKey: "rating_bonuses",
111
+ fieldValue: "rating_bonuses",
81
112
  componentToUse: (numOfStars, value) => (
82
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
113
+ <StarRating
114
+ numOfStars={numOfStars}
115
+ rating={value}
116
+ icon={<FaStar title="Star Icon" />}
117
+ />
83
118
  ),
119
+ showOnlyMobile: true,
84
120
  },
85
121
  {
86
- fieldLabel: 'Usability',
87
- translationKey: 'site_usability',
88
- fieldValue: 'rating_customer',
122
+ fieldLabel: "Customer",
123
+ translationKey: "rating_customer",
124
+ fieldValue: "rating_customer",
89
125
  componentToUse: (numOfStars, value) => (
90
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
126
+ <StarRating
127
+ numOfStars={numOfStars}
128
+ rating={value}
129
+ icon={<FaStar title="Star Icon" />}
130
+ />
91
131
  ),
92
132
  },
93
133
  {
94
- fieldLabel: 'Games',
95
- translationKey: 'games',
96
- fieldValue: 'rating_casino',
134
+ fieldLabel: "Payout",
135
+ translationKey: "rating_payout",
136
+ fieldValue: "rating_payout",
97
137
  componentToUse: (numOfStars, value) => (
98
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
138
+ <StarRating
139
+ numOfStars={numOfStars}
140
+ rating={value}
141
+ icon={<FaStar title="Star Icon" />}
142
+ />
99
143
  ),
100
144
  },
101
145
  ],
102
146
  game: [
103
147
  {
104
- fieldLabel: 'Overall',
105
- translationKey: 'rating',
106
- fieldValue: 'average_rating',
148
+ fieldLabel: "Overall",
149
+ translationKey: "rating",
150
+ fieldValue: "average_rating",
107
151
  componentToUse: (numOfStars, value) => (
108
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
152
+ <StarRating
153
+ numOfStars={numOfStars}
154
+ rating={value}
155
+ icon={<FaStar title="Star Icon" />}
156
+ />
109
157
  ),
110
158
  showOnlyMobile: true,
111
159
  },
112
160
  {
113
- fieldLabel: 'Graphics',
114
- translationKey: 'graphics',
115
- fieldValue: 'first_rating',
161
+ fieldLabel: "Graphics",
162
+ translationKey: "graphics",
163
+ fieldValue: "first_rating",
116
164
  componentToUse: (numOfStars, value) => (
117
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
165
+ <StarRating
166
+ numOfStars={numOfStars}
167
+ rating={value}
168
+ icon={<FaStar title="Star Icon" />}
169
+ />
118
170
  ),
119
171
  },
120
172
  {
121
- fieldLabel: 'Bonuses',
122
- translationKey: 'bonuses',
123
- fieldValue: 'third_rating',
173
+ fieldLabel: "Bonuses",
174
+ translationKey: "bonuses",
175
+ fieldValue: "third_rating",
124
176
  componentToUse: (numOfStars, value) => (
125
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
177
+ <StarRating
178
+ numOfStars={numOfStars}
179
+ rating={value}
180
+ icon={<FaStar title="Star Icon" />}
181
+ />
126
182
  ),
127
183
  },
128
184
  {
129
- fieldLabel: 'RTP',
130
- translationKey: 'rtp',
131
- fieldValue: 'rtp',
185
+ fieldLabel: "RTP",
186
+ translationKey: "rtp",
187
+ fieldValue: "rtp",
132
188
  },
133
189
  {
134
- fieldLabel: 'Volatility',
135
- translationKey: 'volatility',
136
- fieldValue: 'volatility',
190
+ fieldLabel: "Volatility",
191
+ translationKey: "volatility",
192
+ fieldValue: "volatility",
137
193
  },
138
194
  ],
139
195
  payment_method: [
140
196
  {
141
- fieldLabel: 'Overall',
142
- translationKey: 'rating',
143
- fieldValue: 'rating',
197
+ fieldLabel: "Overall",
198
+ translationKey: "rating",
199
+ fieldValue: "rating",
144
200
  componentToUse: (numOfStars, value) => (
145
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
201
+ <StarRating
202
+ numOfStars={numOfStars}
203
+ rating={value}
204
+ icon={<FaStar title="Star Icon" />}
205
+ />
146
206
  ),
147
207
  showOnlyMobile: true,
148
208
  },
149
209
  {
150
- fieldLabel: 'Payout',
151
- translationKey: 'payout',
152
- fieldValue: 'payout_time',
210
+ fieldLabel: "Payout",
211
+ translationKey: "payout",
212
+ fieldValue: "payout_time",
153
213
  },
154
214
  {
155
- fieldLabel: 'Min. Deposit',
156
- translationKey: 'min_deposit',
157
- fieldValue: 'min_deposit',
158
- componentToUse: (numOfStars, value, currency) => <>{value ? `${currency}${value}` : '-'}</>,
215
+ fieldLabel: "Min. Deposit",
216
+ translationKey: "min_deposit",
217
+ fieldValue: "min_deposit",
218
+ componentToUse: (numOfStars, value, currency) => (
219
+ <>{value ? `${currency}${value}` : "-"}</>
220
+ ),
159
221
  },
160
222
  {
161
- fieldLabel: 'Email',
162
- translationKey: 'email',
163
- fieldValue: 'support_types',
223
+ fieldLabel: "Email",
224
+ translationKey: "email",
225
+ fieldValue: "support_types",
164
226
  componentToUse: (numOfStars, value) => {
165
227
  if (value && value?.length > 0) {
166
228
  return (
@@ -206,39 +268,51 @@ export const operatorRatings = {
206
268
  ],
207
269
  operatorCards: [
208
270
  {
209
- fieldLabel: 'Games',
210
- translationKey: 'games',
211
- fieldValue: 'rating_casino',
271
+ fieldLabel: "Games",
272
+ translationKey: "games",
273
+ fieldValue: "rating_casino",
212
274
  componentToUse: (numOfStars, value) => (
213
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
275
+ <StarRating
276
+ numOfStars={numOfStars}
277
+ rating={value}
278
+ icon={<FaStar title="Star Icon" />}
279
+ />
214
280
  ),
215
281
  },
216
282
  {
217
- fieldLabel: 'Bonuses',
218
- translationKey: 'bonus_offers',
219
- fieldValue: 'rating_bonuses',
283
+ fieldLabel: "Bonuses",
284
+ translationKey: "bonus_offers",
285
+ fieldValue: "rating_bonuses",
220
286
  componentToUse: (numOfStars, value) => (
221
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
287
+ <StarRating
288
+ numOfStars={numOfStars}
289
+ rating={value}
290
+ icon={<FaStar title="Star Icon" />}
291
+ />
222
292
  ),
223
293
  },
224
294
  {
225
- fieldLabel: 'Support',
226
- translationKey: 'customer_service',
227
- fieldValue: 'rating_games',
295
+ fieldLabel: "Support",
296
+ translationKey: "customer_service",
297
+ fieldValue: "rating_games",
228
298
  componentToUse: (numOfStars, value) => (
229
- <StarRating numOfStars={numOfStars} rating={value} icon={<FaStar title="Star Icon" />} />
299
+ <StarRating
300
+ numOfStars={numOfStars}
301
+ rating={value}
302
+ icon={<FaStar title="Star Icon" />}
303
+ />
230
304
  ),
231
305
  },
232
306
  ],
233
307
  ratingProperties: [
234
- 'rating_bonuses',
235
- 'rating_casino',
236
- 'rating_customer',
237
- 'rating_games',
238
- 'rating_payout',
239
- 'first_rating',
240
- 'second_rating',
241
- 'third_rating',
242
- 'fourth_rating',
308
+ "rating_bonuses",
309
+ "rating_casino",
310
+ "rating_customer",
311
+ "rating_games",
312
+ "rating_payout",
313
+ "first_rating",
314
+ "second_rating",
315
+ "third_rating",
316
+ "fourth_rating",
243
317
  ],
244
318
  };
@@ -320,7 +320,14 @@ export default {
320
320
  allAuthors = page.authors.map(author_id => {
321
321
  if (data.authors[author_id] === null) return;
322
322
 
323
- return data.authors[author_id]
323
+ const author = data.authors[author_id];
324
+
325
+ // check if author review per page per author is available
326
+ if (page.author_reviews[author_id].length) {
327
+ author.author_review = page.author_reviews[author_id]
328
+ }
329
+
330
+ return author;
324
331
  });
325
332
 
326
333
  transformedPages[market][pageType][index].allAuthors = allAuthors;
@@ -13,7 +13,6 @@ export default function getOperatorData(
13
13
  ) {
14
14
  const operator = {
15
15
  name: operatorName,
16
- type: 'operator',
17
16
  logo_url: 'rizk-logopng7ed316ac19-original.png',
18
17
  url: 'https://rizk.com',
19
18
  status: statusValue,
@@ -73,6 +72,7 @@ export default function getOperatorData(
73
72
  rating_customer: '4.6',
74
73
  rating_games: '3.8',
75
74
  rating_payout: '4.9',
75
+ type: "casino",
76
76
  status: statusValue,
77
77
  links: {
78
78
  main: mainValue,