gatsby-matrix-theme 6.0.2 → 6.0.5

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 (30) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/gatsby-config.js +17 -33
  3. package/package.json +3 -2
  4. package/src/components/atoms/cards/article-card/index.js +6 -3
  5. package/src/components/atoms/cards/game-card/index.js +19 -6
  6. package/src/components/atoms/cards/operator-card/index.js +15 -10
  7. package/src/components/atoms/newsletter/form/index.js +117 -54
  8. package/src/components/molecules/newsletter/index.js +2 -6
  9. package/src/components/molecules/toplist/row/variant-one.js +2 -1
  10. package/src/gatsby-core-theme/components/atoms/author/author.module.scss +70 -0
  11. package/src/gatsby-core-theme/components/atoms/author/index.js +86 -0
  12. package/src/gatsby-core-theme/components/atoms/module-title/index.js +14 -11
  13. package/src/gatsby-core-theme/components/molecules/main/index.js +2 -1
  14. package/src/gatsby-core-theme/components/organisms/head/index.js +11 -6
  15. package/src/gatsby-core-theme/styles/utils/variables/_main.scss +8 -0
  16. package/src/helpers/sitemap.js +24 -0
  17. package/src/hooks/tabs/index.js +6 -0
  18. package/storybook/public/{145.adc0cfd7.iframe.bundle.js → 152.de91fdc9.iframe.bundle.js} +4 -4
  19. package/storybook/public/{145.adc0cfd7.iframe.bundle.js.LICENSE.txt → 152.de91fdc9.iframe.bundle.js.LICENSE.txt} +0 -0
  20. package/storybook/public/{145.adc0cfd7.iframe.bundle.js.map → 152.de91fdc9.iframe.bundle.js.map} +1 -1
  21. package/storybook/public/252.4c33bb7a.iframe.bundle.js +1 -0
  22. package/storybook/public/331.d887dc00.iframe.bundle.js +1 -0
  23. package/storybook/public/{6.2ffbb4e5.iframe.bundle.js → 6.0b5ed7bf.iframe.bundle.js} +1 -1
  24. package/storybook/public/720.bf033bab.iframe.bundle.js +1 -0
  25. package/storybook/public/iframe.html +1 -1
  26. package/storybook/public/main.e5b5d298.iframe.bundle.js +1 -0
  27. package/storybook/public/runtime~main.3bb61e27.iframe.bundle.js +1 -0
  28. package/storybook/public/859.94495706.iframe.bundle.js +0 -1
  29. package/storybook/public/main.62ff6f3d.iframe.bundle.js +0 -1
  30. package/storybook/public/runtime~main.2f06b328.iframe.bundle.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,75 @@
1
+ ## [6.0.5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v6.0.4...v6.0.5) (2022-04-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * changed img to use the core component ([fa8249a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fa8249adb3e32f3b1f16e7a98e0437be846af468))
7
+ * downgraded sitemap and fixed configurations ([4496968](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/44969687c41e2d5bbd86bce65c5a4e4874d062f4))
8
+
9
+
10
+ ### Config
11
+
12
+ * update core theme version ([82abd8f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/82abd8fc2b165f4caffe0540211d6964439493a0))
13
+
14
+
15
+ * Merge branch 'tm-2799-header-changes' into 'master' ([6c00830](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6c00830f245191869d3e1124bf4d0ec28f1c9665))
16
+ * Merge branch 'tm-2812-sitemap-fixes' into 'master' ([2de799f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2de799f494ff6c3632089ac7b3da1534835ea0cf))
17
+
18
+ ## [6.0.4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v6.0.3...v6.0.4) (2022-04-18)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * add configuration for NSA in demo ([e26004e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e26004e30c1f5b97ab5d0c1719a5a0ca9cca6c04))
24
+ * add configuration for pcsa in demo ([ab34c89](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ab34c891708212b5a6d5e6ead4aa55160612881f))
25
+ * add configuration for pcsa in demo ([0950b5b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0950b5b76f617d884a5bcdd2a885fed03e592f20))
26
+ * add endpoint for bacom ([a231826](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a2318260b1eea50b64f92ed360554e1df019f812))
27
+ * clean up and fix endpoint ([6a94a2f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6a94a2fca9cc743ac34a97e9f6ef706232ae12d8))
28
+ * fix empty h2s ([689c730](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/689c730b8b96501802e4e33bcb17fdc20b567ebd))
29
+ * fix format of timestamp ([e2ac8cc](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e2ac8cce223b7db152127dca319b38404ee99455))
30
+ * fix status ([01b018e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/01b018e6bccac1b634171528056acd9f502ab998))
31
+ * fixed name and url ([b08b07b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b08b07b491f6020bde3c4ce9b9c4a009bfadf40c))
32
+ * handel error ([38726a0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/38726a0d542c79eb2b70c0b3f60aeae43e4e3e06))
33
+ * remove redirect for testing ([29e8d4d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/29e8d4d2fcf6aa1b180eccaa9d1a70039be6e16e))
34
+ * updated to latest core theme ([f092a3d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/f092a3d66c647cdb1913a093a288e79f230e4258))
35
+
36
+
37
+ * Merge branch 'tm-2813-fix-emptyh2s' into 'master' ([f902077](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/f902077693d7e43681bfcbc994716f3ea6fe141b))
38
+ * Merge branch 'tm-2810-singup-form' into 'master' ([dfc9673](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/dfc96738050b6e013bf398a62d04c9967dc7adb9))
39
+
40
+ ## [6.0.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v6.0.2...v6.0.3) (2022-04-13)
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * add endpoint for bacom ([8fb13db](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8fb13dbea8b9863c9586c28000163f176408e179))
46
+ * add onestar design for game, operator card and toplist ([bf53abe](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/bf53abefee45f6d4d73e2b730615b0bfe9e4658d))
47
+ * added default width and height for game cards ([5d5a488](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5d5a488167854b04c7cdfccf221c23e0a6e51c88))
48
+ * added reading time meta tag for twitter ([6e84e86](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6e84e86d2a7f6ab592ddfa3b85936a0118ca8b39))
49
+ * head meta tag and added header extended part ([01808d2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/01808d217d31af35bcec881eea3dced5d3584353))
50
+ * heading sequence hide titles that dont have data ([7a72a8b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7a72a8b9a36655bf625124e371f8c357484cf7a9))
51
+
52
+
53
+ ### Code Refactoring
54
+
55
+ * extended header ([d3674f1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d3674f167e9001b8bb521aa990070fc7d43ba3bb))
56
+ * made changes to new component ([0cec052](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0cec05271de2e888a0bab6c98f644d48943ff68a))
57
+ * made changes to new component ([a1ad73d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a1ad73d0088e30a90894a782464930f6c41dc63e))
58
+ * replace env check with prop ([0d6a7fd](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0d6a7fd8770199d61487821377dc34a489e8a35f))
59
+
60
+
61
+ ### Config
62
+
63
+ * resolve conflicts ([fa897c8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fa897c8dbf240040b5745fd2bf2815feedae4a1d))
64
+ * update theme ([2f90038](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2f90038d19fd30e2bb7f832a5045fd9646263850))
65
+
66
+
67
+ * Merge branch 'extended-page-header' into 'master' ([e81be14](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e81be144dc2139d57436fb84768fe6859202fd49))
68
+ * Merge branch 'tm-2813-heading-sequence' into 'master' ([38c4cd1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/38c4cd134a610ab0aa4720382419993ff429d6d6))
69
+ * Merge branch 'fix-star-ratings' into 'master' ([d0da5b4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d0da5b4709e7cea67c45469460d97f31ae442da3))
70
+ * Merge branch 'revert-8fb13dbe' into 'master' ([b212c7e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b212c7e184d0f942d0a96d82ba9a546d4570ebe7))
71
+ * Revert "fix: add endpoint for bacom" ([6a5880f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6a5880ffd7def8560756c3a3ea961f3e27c7f22e))
72
+
1
73
  ## [6.0.2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v6.0.1...v6.0.2) (2022-04-07)
2
74
 
3
75
 
package/gatsby-config.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const activeEnv = process.env.GATSBY_ACTIVE_ENV || 'development';
2
2
  const siteMapExcludes = process.env.SITEMAP_EXCLUDE.split(',') || [];
3
+ const { getSitemap } = require('./src/helpers/sitemap');
3
4
 
4
5
  // eslint-disable-next-line import/no-extraneous-dependencies
5
6
  require('dotenv').config({
@@ -21,42 +22,25 @@ module.exports = {
21
22
  {
22
23
  resolve: `gatsby-plugin-sitemap`,
23
24
  options: {
24
- output: '/',
25
- excludes: siteMapExcludes,
26
- resolveSiteUrl: () => process.env.GATSBY_SITE_URL,
25
+ output: `/sitemap.xml`,
26
+ sitemapSize: 5000,
27
+ exclude: siteMapExcludes,
27
28
  query: `
28
- {
29
- allSitePage {
30
- nodes {
31
- path
32
- pageContext
33
- }
29
+ {
30
+ site {
31
+ siteMetadata {
32
+ siteUrl
34
33
  }
35
34
  }
36
- `,
37
- resolvePages: ({ allSitePage: { nodes: allPages } }) =>
38
- allPages
39
- .map((edge) => {
40
- try {
41
- if (
42
- edge.pageContext.page &&
43
- edge.pageContext.page.robot_options &&
44
- edge.pageContext.page.robot_options.page_index === 0
45
- ) {
46
- return null;
47
- }
48
- } catch (err) {
49
- // eslint-disable-next-line no-console
50
- console.log(err);
51
- }
52
- return { ...edge };
53
- })
54
- .filter((edge) => edge),
55
- serialize: (page) => ({
56
- url: process.env.GATSBY_SITE_URL + page.pageContext.page.path,
57
- changefreq: `daily`,
58
- priority: 0.7,
59
- }),
35
+ allSitePage {
36
+ nodes {
37
+ path
38
+ pageContext
39
+ }
40
+ }
41
+ }
42
+ `,
43
+ serialize: ({ site, allSitePage }) => getSitemap(site, allSitePage),
60
44
  },
61
45
  },
62
46
  `gatsby-plugin-image`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "6.0.2",
3
+ "version": "6.0.5",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -27,8 +27,9 @@
27
27
  "gatsby-plugin-sharp": "^4.10.2",
28
28
  "gatsby-transformer-sharp": "^4.10.0",
29
29
  "react": "^17.0.2",
30
+ "gatsby-plugin-sitemap": "^3.3.0",
30
31
  "react-dom": "^17.0.2",
31
- "gatsby-core-theme": "^6.1.1"
32
+ "gatsby-core-theme": "^6.1.7"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@babel/core": "^7.13.1",
@@ -24,7 +24,6 @@ const ArticleCard = ({ item, width, height }) => {
24
24
  };
25
25
  const cardBackgroundImage = getSectionExtraField(null, item, 'card_background_image');
26
26
  const featured = !!cardBackgroundImage;
27
- const AuthorProfile = author && author.profile_page_path;
28
27
  const AuthorName = author && author.name;
29
28
  const { translations } = useContext(Context) || {};
30
29
 
@@ -58,7 +57,7 @@ const ArticleCard = ({ item, width, height }) => {
58
57
  gtmClass="article-card-gtm btn-cta"
59
58
  />
60
59
  <div className={styles.cardMeta}>
61
- <Author authorProfile={AuthorProfile} name={AuthorName} date={created_at} />
60
+ <Author prefix="by" name={AuthorName} date={created_at} isCardsAuthor />
62
61
  </div>
63
62
  </div>
64
63
  </BaseCard>
@@ -67,7 +66,11 @@ const ArticleCard = ({ item, width, height }) => {
67
66
 
68
67
  ArticleCard.propTypes = {
69
68
  item: PropTypes.shape({
70
- author: PropTypes.shape({ name: PropTypes.string, profile_page_path: PropTypes.string }),
69
+ author: PropTypes.shape({
70
+ name: PropTypes.string,
71
+ profile_page_path: PropTypes.string,
72
+ twitter_profile: PropTypes.string,
73
+ }),
71
74
  title: PropTypes.string,
72
75
  created_at: PropTypes.string,
73
76
  path: PropTypes.string,
@@ -1,7 +1,7 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
1
2
  import React, { useContext } from 'react';
2
3
  import PropTypes from 'prop-types';
3
- import { FaStar } from 'react-icons/fa';
4
- import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating';
4
+ import loadable from '@loadable/component';
5
5
  import Button from 'gatsby-core-theme/src/components/atoms/button';
6
6
  import GatsbyImg from 'gatsby-core-theme/src/hooks/gatsby-img';
7
7
  import Link from 'gatsby-core-theme/src/hooks/link';
@@ -16,11 +16,20 @@ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
16
16
  import BaseCard from '../base-card';
17
17
  import styles from './game-card.module.scss';
18
18
 
19
- const GameCard = ({ item, button_text = 'play_now', width, height }) => {
19
+ const GameCard = ({
20
+ item,
21
+ button_text = 'play_now',
22
+ width = 300,
23
+ height = 250,
24
+ useOneStarRating = false,
25
+ }) => {
20
26
  const { relation, title, path, banner } = item;
21
27
  const cardBackgroundImage = getSectionExtraField(null, item, 'card_background_image');
22
28
  const featured = !!cardBackgroundImage;
23
29
  const { translations } = useContext(Context) || {};
30
+ const StarRating = useOneStarRating
31
+ ? loadable(() => import('gatsby-core-theme/src/components/molecules/star-rating/one-star'))
32
+ : loadable(() => import('gatsby-core-theme/src/components/molecules/star-rating'));
24
33
 
25
34
  return (
26
35
  <BaseCard item={item} isLinked cardType="game">
@@ -31,7 +40,12 @@ const GameCard = ({ item, button_text = 'play_now', width, height }) => {
31
40
  aria-label={`${title} Link`}
32
41
  >
33
42
  {banner ? (
34
- <LazyImage width={width} height={height} src={imagePrettyUrl(banner)} alt={title} />
43
+ <LazyImage
44
+ width={width}
45
+ height={height}
46
+ src={imagePrettyUrl(banner, width, height)}
47
+ alt={title}
48
+ />
35
49
  ) : (
36
50
  <GatsbyImg filename="default-slot.jpg" alt={title} />
37
51
  )}
@@ -48,8 +62,6 @@ const GameCard = ({ item, button_text = 'play_now', width, height }) => {
48
62
  <StarRating
49
63
  numOfStars={5}
50
64
  halfStars={false}
51
- iconEmpty={<FaStar />}
52
- iconFull={<FaStar />}
53
65
  rating={[
54
66
  relation.first_rating,
55
67
  relation.second_rating,
@@ -88,6 +100,7 @@ GameCard.propTypes = {
88
100
  button_text: PropTypes.string,
89
101
  width: PropTypes.number,
90
102
  height: PropTypes.number,
103
+ useOneStarRating: PropTypes.bool,
91
104
  };
92
105
 
93
106
  export default GameCard;
@@ -1,8 +1,8 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
1
2
  /* eslint-disable camelcase */
2
3
  import React, { useContext } from 'react';
3
4
  import PropTypes from 'prop-types';
4
- import { FaStar } from 'react-icons/fa';
5
- import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating';
5
+ import loadable from '@loadable/component';
6
6
  import { imagePrettyUrl, translate } from 'gatsby-core-theme/src/helpers/getters';
7
7
  import Link from 'gatsby-core-theme/src/hooks/link';
8
8
  import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
@@ -13,13 +13,23 @@ import OperatorCta from 'gatsby-core-theme/src/components/atoms/operator-cta';
13
13
  import BaseCard from '../base-card';
14
14
  import styles from './operator-card.module.scss';
15
15
 
16
- const OperatorCard = ({ item, featured = false, number, width, height }) => {
16
+ const OperatorCard = ({
17
+ item,
18
+ featured = false,
19
+ number,
20
+ width,
21
+ height,
22
+ useOneStarRating = false,
23
+ }) => {
17
24
  const { relation, path } = item;
18
25
  const reviewPath = path || relation.path;
19
26
  const status = relation?.status;
20
27
  const isInactive = status === 'inactive';
21
28
  const backgroundImage = number === 1 ? 'featuredCasino' : null;
22
29
  const { translations } = useContext(Context) || {};
30
+ const StarRating = useOneStarRating
31
+ ? loadable(() => import('gatsby-core-theme/src/components/molecules/star-rating/one-star'))
32
+ : loadable(() => import('gatsby-core-theme/src/components/molecules/star-rating'));
23
33
 
24
34
  return (
25
35
  <BaseCard featured={featured} backgroundImage={backgroundImage} item={item} cardType="operator">
@@ -40,13 +50,7 @@ const OperatorCard = ({ item, featured = false, number, width, height }) => {
40
50
  alt={relation.name}
41
51
  />
42
52
  </Link>
43
- <StarRating
44
- numOfStars={5}
45
- halfStars={false}
46
- iconEmpty={<FaStar />}
47
- iconFull={<FaStar />}
48
- rating={relation.rating}
49
- />
53
+ <StarRating numOfStars={5} halfStars={false} rating={relation.rating} />
50
54
  </div>
51
55
  <div
52
56
  className={`${styles.cardContent} ${featured && styles.featured} ${
@@ -106,6 +110,7 @@ OperatorCard.propTypes = {
106
110
  number: PropTypes.number,
107
111
  width: PropTypes.number,
108
112
  height: PropTypes.number,
113
+ useOneStarRating: PropTypes.bool,
109
114
  };
110
115
 
111
116
  export default OperatorCard;
@@ -1,57 +1,120 @@
1
- import React,{useRef} from 'react';
2
-
3
- import styles from './newsletter-form.module.scss'
4
-
5
- const NewsletterForm =({
6
- placeholderName="Name",
7
- placeholderEmail="Email",
8
- buttonText="Submit",
9
- formAction="",
10
- newsletterListId='',
11
- redirectUrl= ''
12
- })=>{
13
- const form = useRef(null);
14
-
15
- const handelSubmit =(e) =>{
16
- e.preventDefault();
17
- validationForm(e.target.elements) && form.current.submit();
1
+ /* eslint-disable no-unused-expressions */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ import React, { useRef, useState, useEffect, useContext } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
6
+ import { translate } from 'gatsby-core-theme/src/helpers/getters';
7
+ import styles from './newsletter-form.module.scss';
8
+
9
+ const NewsletterForm = ({
10
+ placeholderName = 'Name',
11
+ placeholderEmail = 'Email',
12
+ buttonText = 'Submit',
13
+ redirectUrl,
14
+ }) => {
15
+ const form = useRef(null);
16
+ const [ip, setIP] = useState('');
17
+ const [error, setError] = useState(false);
18
+ const { translations } = useContext(Context) || {};
19
+
20
+ const validationForm = (e) => {
21
+ let nameValidate = false;
22
+ let emailValidate = false;
23
+ if (!e.name.value && e.name.value.trim() === '') {
24
+ nameValidate = false;
25
+ e.name.classList.add(styles.error);
26
+ } else {
27
+ nameValidate = true;
28
+ e.name.classList.remove(styles.error);
29
+ }
30
+
31
+ if (!e.email.value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i)) {
32
+ emailValidate = false;
33
+ e.email.classList.add(styles.error);
34
+ } else {
35
+ emailValidate = true;
36
+ e.email.classList.remove(styles.error);
18
37
  }
19
-
20
- const validationForm =(e)=>{
21
- let nameValidate = false;
22
- let emailValidate = false;
23
- if(!e.name.value && e.name.value.trim() ===''){
24
- nameValidate = false;
25
- e.name.classList.add(styles.error);
26
- }else{
27
- nameValidate = true;
28
- e.name.classList.remove(styles.error);
29
- }
30
-
31
- if(!e.email.value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i)){
32
- emailValidate = false;
33
- e.email.classList.add(styles.error);
34
- }
35
- else{
36
- emailValidate = true;
37
- e.email.classList.remove(styles.error);
38
- }
39
- if(nameValidate && emailValidate){
40
- return true;
41
- }
42
- else{
43
- return false;
44
- }
38
+ if (nameValidate && emailValidate) {
39
+ return true;
45
40
  }
46
- return(
47
- <form action={formAction} method="post" ref={form} onSubmit={handelSubmit}>
48
- <input type="hidden" name="listname" aria-label="listname-hidden" value={newsletterListId} />
49
- <input type="hidden" name="redirect" aria-label="redirect-hidden" value={redirectUrl} />
50
- <input className={styles.input} placeholder={placeholderName} type="text" name="name" />
51
- <input className={styles.input} placeholder={placeholderEmail} type="email" name="email" />
52
- <button className={styles.button} type="submit">{buttonText}</button>
53
- </form>
54
- )
55
- }
41
+ return false;
42
+ };
43
+
44
+ const getData = async () => {
45
+ await fetch('https://geolocation-db.com/json/', {
46
+ method: 'GET',
47
+ })
48
+ .then((response) => response.json())
49
+ .then((data) => setIP(data.IPv4))
50
+ .catch((err) => {
51
+ console.log(`Error ${err}`);
52
+ });
53
+ };
56
54
 
57
- export default NewsletterForm;
55
+ useEffect(() => {
56
+ getData();
57
+ }, []);
58
+
59
+ const bacomApi = async (name, email) => {
60
+ // eslint-disable-next-line no-bitwise
61
+ const timestamp = (Date.now() / 1000) | 0;
62
+
63
+ await fetch(
64
+ `https://bacom.dk/subscribe/gig/?firstname=${name}&user_ip=${ip}&ref_name=${process.env.BACOM_REF_NAME}&ref_url=${process.env.BACOM_REF_URL}&timestamp=${timestamp}&country=${process.env.COUNTRY}&email=${email}`,
65
+ {
66
+ method: 'GET',
67
+ headers: {
68
+ 'Content-Type': 'application/json',
69
+ Accept: 'application/json',
70
+ },
71
+ }
72
+ ).then((res) =>
73
+ res.text().then((text) => {
74
+ text === 'OK' ? (window.location.href = redirectUrl) : setError(true);
75
+ })
76
+ );
77
+ };
78
+
79
+ const handelSubmit = (e) => {
80
+ e.preventDefault();
81
+ const { elements } = e.target;
82
+ if (validationForm(elements)) {
83
+ bacomApi(elements.name.value, elements.email.value);
84
+ }
85
+ };
86
+
87
+ return (
88
+ <>
89
+ {!error ? (
90
+ <form ref={form} onSubmit={handelSubmit}>
91
+ <input className={styles.input} placeholder={placeholderName} type="text" name="name" />
92
+ <input
93
+ className={styles.input}
94
+ placeholder={placeholderEmail}
95
+ type="email"
96
+ name="email"
97
+ />
98
+ <button className={styles.button} type="submit">
99
+ {buttonText}
100
+ </button>
101
+ </form>
102
+ ) : (
103
+ <span>
104
+ {translate(
105
+ translations,
106
+ 'fail_error_newsletter',
107
+ 'Something went wrong. Please try again later!'
108
+ )}{' '}
109
+ </span>
110
+ )}
111
+ </>
112
+ );
113
+ };
114
+ NewsletterForm.propTypes = {
115
+ placeholderName: PropTypes.string,
116
+ placeholderEmail: PropTypes.string,
117
+ buttonText: PropTypes.string,
118
+ redirectUrl: PropTypes.string,
119
+ };
120
+ export default NewsletterForm;
@@ -1,3 +1,4 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
1
2
  /* eslint-disable react/no-danger */
2
3
  /* eslint-disable no-nested-ternary */
3
4
  /* eslint-disable no-unused-expressions */
@@ -20,8 +21,6 @@ const Newsletter = ({
20
21
  privacyText = 'By subscribing, you confirm that you are over 18 years of age and that you accept our',
21
22
  openBtnText = 'FÅ 405 FREE SPINS UMIDDELBART',
22
23
  buttonText = 'Hent dine freespins',
23
- formAction = '',
24
- newsletterListId = '',
25
24
  hideButtonOnScroll = true,
26
25
  footer = false,
27
26
  }) => {
@@ -31,6 +30,7 @@ const Newsletter = ({
31
30
  page?.path === '/'
32
31
  ? `${getUrl(page?.path)}?subscribed=true`
33
32
  : `${getUrl(page?.path)}/?subscribed=true`;
33
+
34
34
  const newsletterFloatingContainer = useRef(React.createRef());
35
35
 
36
36
  const registerScroll = () => {
@@ -84,8 +84,6 @@ const Newsletter = ({
84
84
  placeholderEmail={placeholderEmail}
85
85
  buttonText={buttonText}
86
86
  redirectUrl={redirectUrl}
87
- formAction={formAction}
88
- newsletterListId={newsletterListId}
89
87
  />
90
88
  {privacyText ? (
91
89
  <p className={styles.privacytext} dangerouslySetInnerHTML={{ __html: privacyText }} />
@@ -106,8 +104,6 @@ Newsletter.propTypes = {
106
104
  privacyText: PropTypes.string,
107
105
  openBtnText: PropTypes.string,
108
106
  buttonText: PropTypes.string,
109
- formAction: PropTypes.string,
110
- newsletterListId: PropTypes.string,
111
107
  page: PropTypes.shape({
112
108
  path: PropTypes.string,
113
109
  template: PropTypes.string,
@@ -1,3 +1,4 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
1
2
  import React, { useContext } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { MdCheck } from 'react-icons/md';
@@ -10,7 +11,7 @@ import {
10
11
  import Link from 'gatsby-core-theme/src/hooks/link';
11
12
  import Label from 'gatsby-core-theme/src/components/atoms/label';
12
13
  import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
13
- import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating';
14
+ import StarRating from 'gatsby-core-theme/src/components/molecules/star-rating/one-star';
14
15
  import SellingPoints from 'gatsby-core-theme/src/components/atoms/selling-points';
15
16
  import OperatorCta from 'gatsby-core-theme/src/components/atoms/operator-cta';
16
17
  import Tnc from 'gatsby-core-theme/src/components/molecules/tnc';
@@ -0,0 +1,70 @@
1
+ .authorWraper {
2
+ display: grid;
3
+ grid-template-rows: repeat(2, 1fr);
4
+ align-items: center;
5
+ font-size: var(--author-text-fontSize);
6
+ color: var(--author-primary-text-color);
7
+ .infoContainer {
8
+ display: flex;
9
+ align-items: center;
10
+ white-space: nowrap;
11
+ .prefixStyle {
12
+ margin: 0px;
13
+ }
14
+
15
+ img {
16
+ width: 30px;
17
+ height: 30px;
18
+ border-radius: 50%;
19
+ margin: 0px 8px 0px 6px;
20
+ }
21
+
22
+ > a {
23
+ color: var(--author-link-text-color);
24
+ font-weight: var(--author-fontweight);
25
+ text-decoration: underline;
26
+
27
+ &:before {
28
+ content: '';
29
+ padding: 0px 2px;
30
+ }
31
+
32
+ &:after {
33
+ content: '';
34
+ padding: 0px 2px;
35
+ }
36
+ }
37
+ }
38
+ .dateTimeWrapper {
39
+ display: flex;
40
+ align-items: center;
41
+ white-space: nowrap;
42
+ .readingWithBorder {
43
+ &:before {
44
+ content: '|';
45
+ padding: 0px 3px;
46
+ }
47
+ }
48
+ }
49
+
50
+ @include min(tablet) {
51
+ display: flex;
52
+ }
53
+ }
54
+
55
+ .authorCard {
56
+ display: flex;
57
+ width: 100%;
58
+ justify-content: space-between;
59
+ color: var( --author-card-text-color);
60
+
61
+ @include min(tablet){
62
+ display: flex;
63
+ justify-content: space-between;
64
+
65
+ }
66
+ }
67
+
68
+ .prefixCardText {
69
+ padding-right: 2px;
70
+ }