gatsby-matrix-theme 2.1.2 → 2.2.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.
Files changed (88) hide show
  1. package/.storybook/main.js +1 -0
  2. package/CHANGELOG.md +46 -0
  3. package/jest.config.js +1 -0
  4. package/package.json +2 -2
  5. package/src/components/atoms/cards/article-card/index.js +9 -6
  6. package/src/components/atoms/cards/author-card/index.js +6 -1
  7. package/src/components/atoms/cards/base-card/index.js +1 -1
  8. package/src/components/atoms/cards/game-card/index.js +9 -6
  9. package/src/components/atoms/cards/operator-card/index.js +14 -8
  10. package/src/components/atoms/cards/payment-method-card/index.js +11 -9
  11. package/src/components/atoms/cards/popup-card/index.js +2 -3
  12. package/src/components/atoms/cards/popup-card/popup-card.stories.js +0 -10
  13. package/src/components/atoms/cards/software-provider-card/index.js +10 -9
  14. package/src/components/atoms/link-menu/index.js +1 -1
  15. package/src/components/atoms/operator-bonuses/index.js +10 -7
  16. package/src/components/atoms/search/autocomplete/article.js +1 -1
  17. package/src/components/atoms/search/autocomplete/game.js +1 -1
  18. package/src/components/atoms/search/autocomplete/operator.js +1 -1
  19. package/src/components/atoms/search/autocomplete/payment_methods.js +1 -1
  20. package/src/components/atoms/search/autocomplete/software_provider.js +1 -1
  21. package/src/components/atoms/table/banking/index.js +24 -20
  22. package/src/components/atoms/table/column/index.js +2 -5
  23. package/src/components/atoms/table/staticColumn/index.js +28 -33
  24. package/src/components/molecules/faq/index.js +1 -1
  25. package/src/components/molecules/game-iframe/index.js +6 -1
  26. package/src/components/molecules/game-score-gauge/game-score-gauge.stories.js +7 -12
  27. package/src/components/molecules/game-score-gauge/index.js +4 -2
  28. package/src/components/molecules/info-grid/index.js +1 -0
  29. package/src/components/molecules/newsletter/index.js +1 -0
  30. package/src/components/molecules/newsletter/newsletter.stories.js +106 -112
  31. package/src/components/molecules/newsletter-optin/index.js +7 -7
  32. package/src/components/molecules/newsletter-optin/newsletter-optin.stories.js +79 -80
  33. package/src/components/molecules/operator-summary/index.js +8 -2
  34. package/src/components/molecules/small-welcome-bonus/index.js +19 -6
  35. package/src/components/molecules/small-welcome-bonus/small-welcome-bonus.stories.js +49 -53
  36. package/src/components/molecules/toplist/row/variant-one.js +26 -10
  37. package/src/components/organisms/footer-navigation/index.js +9 -1
  38. package/src/components/organisms/popup/index.js +6 -5
  39. package/src/components/organisms/popup/popup.stories.js +0 -10
  40. package/src/components/organisms/toplist/comparison-table/index.js +11 -13
  41. package/src/components/organisms/toplist/index.js +2 -4
  42. package/src/components/organisms/toplist/list/index.js +4 -5
  43. package/src/gatsby-core-theme/components/atoms/module-title/index.js +5 -8
  44. package/src/gatsby-core-theme/components/atoms/not-found/index.js +24 -0
  45. package/src/gatsby-core-theme/components/atoms/not-found/not-found.module.scss +17 -0
  46. package/src/gatsby-core-theme/components/atoms/spotlights/index.js +25 -8
  47. package/src/gatsby-core-theme/components/molecules/content/content.module.scss +73 -16
  48. package/src/gatsby-core-theme/components/molecules/content/index.js +2 -0
  49. package/src/gatsby-core-theme/components/molecules/footer/index.js +5 -1
  50. package/src/gatsby-core-theme/components/molecules/main/index.js +6 -1
  51. package/src/gatsby-core-theme/components/molecules/module/index.js +1 -3
  52. package/src/gatsby-core-theme/components/molecules/search/index.js +26 -3
  53. package/src/gatsby-core-theme/components/organisms/anchor/anchor.module.scss +5 -1
  54. package/src/gatsby-core-theme/components/organisms/anchor/index.js +11 -2
  55. package/src/gatsby-core-theme/components/organisms/carousel/index.js +17 -6
  56. package/src/gatsby-core-theme/components/organisms/navigation/index.js +2 -2
  57. package/src/gatsby-core-theme/components/organisms/search/index.js +2 -1
  58. package/src/gatsby-core-theme/components/pages/body/index.js +14 -9
  59. package/src/gatsby-core-theme/components/pages/search/index.js +79 -74
  60. package/src/hooks/tabs/index.js +6 -4
  61. package/src/hooks/tabs/tab/tab-list.js +4 -1
  62. package/src/hooks/tabs/tab/tab.js +37 -28
  63. package/storybook/public/{0.a9b647e1.iframe.bundle.js → 0.a5c4cf9f.iframe.bundle.js} +1 -1
  64. package/storybook/public/{1.94c59b7e.iframe.bundle.js → 1.b2b72c50.iframe.bundle.js} +1 -1
  65. package/storybook/public/{10.727dd594.iframe.bundle.js → 10.502b5ac2.iframe.bundle.js} +1 -1
  66. package/storybook/public/{11.2e850035.iframe.bundle.js → 11.30535586.iframe.bundle.js} +1 -1
  67. package/storybook/public/{5.fed35abd.iframe.bundle.js → 5.66b5b921.iframe.bundle.js} +3 -3
  68. package/storybook/public/{5.fed35abd.iframe.bundle.js.LICENSE.txt → 5.66b5b921.iframe.bundle.js.LICENSE.txt} +0 -0
  69. package/storybook/public/5.66b5b921.iframe.bundle.js.map +1 -0
  70. package/storybook/public/{6.a63e093c.iframe.bundle.js → 6.89431426.iframe.bundle.js} +1 -1
  71. package/storybook/public/{7.4996d626.iframe.bundle.js → 7.a53e817b.iframe.bundle.js} +1 -1
  72. package/storybook/public/8.e043e6dc.iframe.bundle.js +3 -0
  73. package/storybook/public/{8.f4491507.iframe.bundle.js.LICENSE.txt → 8.e043e6dc.iframe.bundle.js.LICENSE.txt} +0 -0
  74. package/storybook/public/8.e043e6dc.iframe.bundle.js.map +1 -0
  75. package/storybook/public/{9.3097c14c.iframe.bundle.js → 9.eba0e7c0.iframe.bundle.js} +1 -1
  76. package/storybook/public/iframe.html +1 -1
  77. package/storybook/public/main.c07025f4.iframe.bundle.js +1 -0
  78. package/storybook/public/{runtime~main.941ed6de.iframe.bundle.js → runtime~main.c4f3a4d6.iframe.bundle.js} +1 -1
  79. package/storybook/public/vendors~main.8050786b.iframe.bundle.js +7 -0
  80. package/storybook/public/{vendors~main.f3d8ec5b.iframe.bundle.js.LICENSE.txt → vendors~main.8050786b.iframe.bundle.js.LICENSE.txt} +0 -0
  81. package/storybook/public/vendors~main.8050786b.iframe.bundle.js.map +1 -0
  82. package/src/gatsby-core-theme/pages/404/index.js +0 -66
  83. package/storybook/public/5.fed35abd.iframe.bundle.js.map +0 -1
  84. package/storybook/public/8.f4491507.iframe.bundle.js +0 -3
  85. package/storybook/public/8.f4491507.iframe.bundle.js.map +0 -1
  86. package/storybook/public/main.920f3ab1.iframe.bundle.js +0 -1
  87. package/storybook/public/vendors~main.f3d8ec5b.iframe.bundle.js +0 -7
  88. package/storybook/public/vendors~main.f3d8ec5b.iframe.bundle.js.map +0 -1
@@ -1,32 +1,36 @@
1
1
  /* eslint-disable react/forbid-prop-types */
2
2
  /* eslint-disable camelcase */
3
- import React from 'react';
3
+ import React, { useContext } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { translate } from 'gatsby-core-theme/src/helpers/getters';
6
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
6
7
  import styles from './banking.module.scss';
7
8
 
8
- const Index = ({ min_deposit, max_withdrawal, currency, translations }) => (
9
- <div className={styles.contain}>
10
- <div className={styles.row}>
11
- <p>{translate(translations, 'min_deposit', 'Min Deposit')}:</p>
12
- <strong>{min_deposit}</strong>
13
- </div>
14
- {max_withdrawal && (
15
- <div className={styles.row}>
16
- <p>{translate(translations, 'max_withdrawal', 'Max Withdrawal')}:</p>
17
- <strong>{max_withdrawal}</strong>
18
- </div>
19
- )}
20
- {currency && (
9
+ const Index = ({ min_deposit, max_withdrawal, currency }) => {
10
+ const { translations } = useContext(Context) || {};
11
+
12
+ return (
13
+ <div className={styles.contain}>
21
14
  <div className={styles.row}>
22
- <p>{translate(translations, 'currency_support', 'Currency Support')}:</p>
23
- <strong>{currency}</strong>
15
+ <p>{translate(translations, 'min_deposit', 'Min Deposit')}:</p>
16
+ <strong>{min_deposit}</strong>
24
17
  </div>
25
- )}
26
- </div>
27
- );
18
+ {max_withdrawal && (
19
+ <div className={styles.row}>
20
+ <p>{translate(translations, 'max_withdrawal', 'Max Withdrawal')}:</p>
21
+ <strong>{max_withdrawal}</strong>
22
+ </div>
23
+ )}
24
+ {currency && (
25
+ <div className={styles.row}>
26
+ <p>{translate(translations, 'currency_support', 'Currency Support')}:</p>
27
+ <strong>{currency}</strong>
28
+ </div>
29
+ )}
30
+ </div>
31
+ );
32
+ };
28
33
  Index.propTypes = {
29
- translations: PropTypes.object,
30
34
  currency: PropTypes.string,
31
35
  max_withdrawal: PropTypes.string,
32
36
  min_deposit: PropTypes.string,
@@ -24,8 +24,6 @@ const Index = ({
24
24
  licenses,
25
25
  index,
26
26
  hideRow,
27
- // eslint-disable-next-line react/prop-types
28
- translations,
29
27
  chnageHeights,
30
28
  licensesMore,
31
29
  layout = 'list',
@@ -57,14 +55,14 @@ const Index = ({
57
55
  <td>
58
56
  <div className={styles.details}>
59
57
  <div className={styles.logo}>
60
- <Link to={item.review_link}>
58
+ <Link to={item.review_link} className="table-column-gtm">
61
59
  <LazyImage src={imagePrettyUrl(item.logo_url, 120, 45)} />
62
60
  </Link>
63
61
 
64
62
  <p>{item.name}</p>
65
63
  </div>
66
64
  <div className={styles.cta}>
67
- <OperatorCta operator={item} />
65
+ <OperatorCta operator={item} gtmClass="table-operator-cta-gtm" />
68
66
  </div>
69
67
  </div>
70
68
  </td>
@@ -114,7 +112,6 @@ const Index = ({
114
112
  min_deposit={min_deposit}
115
113
  max_withdrawal={max_withdrawal}
116
114
  currency={currency}
117
- translations={translations}
118
115
  />
119
116
  </div>
120
117
  </td>
@@ -1,43 +1,38 @@
1
1
  /* eslint-disable react/forbid-prop-types */
2
- import React from 'react';
2
+ import React, { useContext } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { translate } from 'gatsby-core-theme/src/helpers/getters';
5
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
5
6
  import styles from './staticColumn.module.scss';
6
7
 
7
- const Index = ({
8
- details,
9
- rating,
10
- bonus,
11
- topFeatures,
12
- banking,
13
- licenses,
14
- hideRow,
15
- translations,
16
- }) => (
17
- <div className={styles.columStatic}>
18
- <tr style={{ height: details + 1 }} id="details">
19
- <td>{translate(translations, 'casino_name', 'Casino Name')}</td>
20
- </tr>
21
- <tr style={{ height: rating }} id="rating">
22
- <td>{translate(translations, 'rating', 'Rating')}</td>
23
- </tr>
24
- <tr style={{ height: bonus }} id="bonus">
25
- <td>{translate(translations, 'bonus', 'Bonus')}</td>
26
- </tr>
8
+ const Index = ({ details, rating, bonus, topFeatures, banking, licenses, hideRow }) => {
9
+ const { translations } = useContext(Context) || {};
27
10
 
28
- <tr style={{ height: topFeatures, display: hideRow ? 'none' : null }} id="topFeatures">
29
- <td>{translate(translations, 'top_features', 'Top Features')}</td>
30
- </tr>
31
- <tr style={{ height: banking, display: hideRow ? 'none' : null }} id="banking">
32
- <td>{translate(translations, 'banking', 'Banking')}</td>
33
- </tr>
34
- <tr style={{ height: licenses, display: hideRow ? 'none' : null }} id="licenses">
35
- <td>{translate(translations, 'licenses', 'Licenses')}</td>
36
- </tr>
37
- </div>
38
- );
11
+ return (
12
+ <div className={styles.columStatic}>
13
+ <tr style={{ height: details + 1 }} id="details">
14
+ <td>{translate(translations, 'casino_name', 'Casino Name')}</td>
15
+ </tr>
16
+ <tr style={{ height: rating }} id="rating">
17
+ <td>{translate(translations, 'rating', 'Rating')}</td>
18
+ </tr>
19
+ <tr style={{ height: bonus }} id="bonus">
20
+ <td>{translate(translations, 'bonus', 'Bonus')}</td>
21
+ </tr>
22
+
23
+ <tr style={{ height: topFeatures, display: hideRow ? 'none' : null }} id="topFeatures">
24
+ <td>{translate(translations, 'top_features', 'Top Features')}</td>
25
+ </tr>
26
+ <tr style={{ height: banking, display: hideRow ? 'none' : null }} id="banking">
27
+ <td>{translate(translations, 'banking', 'Banking')}</td>
28
+ </tr>
29
+ <tr style={{ height: licenses, display: hideRow ? 'none' : null }} id="licenses">
30
+ <td>{translate(translations, 'licenses', 'Licenses')}</td>
31
+ </tr>
32
+ </div>
33
+ );
34
+ };
39
35
  Index.propTypes = {
40
- translations: PropTypes.object,
41
36
  details: PropTypes.number,
42
37
  rating: PropTypes.number,
43
38
  bonus: PropTypes.number,
@@ -62,7 +62,7 @@ const Faq = ({ module, openAll = true, openItem, closeOthers = false, icon = ''
62
62
  <div key={keygen()} className={styles.faqItem}>
63
63
  <button
64
64
  onClick={() => toggle(index)}
65
- className={styles.title}
65
+ className={`${styles.title} faq-gtm`}
66
66
  type="button"
67
67
  ref={(el) => (btnRefs.current[index] = el)}
68
68
  >
@@ -43,7 +43,12 @@ const GameIframe = ({ page }) => {
43
43
  <div className={styles.thumbnailContainer}>
44
44
  <div className={`${styles.thumbnail} ${showIframe ? styles.hide : ''}`}>
45
45
  <LazyImage src={imagePrettyUrl(page.banner)} />
46
- <Button isInternalLink={false} onClick={clickHandler} isButton />
46
+ <Button
47
+ isInternalLink={false}
48
+ onClick={clickHandler}
49
+ isButton
50
+ gtmClass="game-ifram-gtm btn-cta"
51
+ />
47
52
  </div>
48
53
  {showIframe && (
49
54
  <Iframe
@@ -1,3 +1,4 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
1
2
  import React from 'react';
2
3
  import {
3
4
  Title,
@@ -23,8 +24,7 @@ export default {
23
24
  parameters: {
24
25
  docs: {
25
26
  description: {
26
- component:
27
- 'A component for rating',
27
+ component: 'A component for rating',
28
28
  },
29
29
  page: () => (
30
30
  <>
@@ -43,16 +43,11 @@ const Template = (args) => <ScoreGauge {...args} />;
43
43
  export const Default = Template.bind({});
44
44
  Default.args = {
45
45
  page: {
46
- translations:{
47
- grafikk: 'Grafikk',
48
- bonuser: 'Bonuser',
49
- spillopplevelse: 'Spillopplevelse'
46
+ relation: {
47
+ second_rating: 3,
48
+ third_rating: 5,
49
+ fourth_rating: 4,
50
+ max: 10,
50
51
  },
51
- relation:{
52
- second_rating:3,
53
- third_rating:5,
54
- fourth_rating:4,
55
- max:10
56
- }
57
52
  },
58
53
  };
@@ -1,8 +1,9 @@
1
1
  /* eslint-disable react/prop-types */
2
2
  import { GiGamepad, GiPresent } from 'react-icons/gi';
3
- import React from 'react';
3
+ import React, { useContext } from 'react';
4
4
  import { TiImage } from 'react-icons/ti';
5
5
  import { translate } from 'gatsby-core-theme/src/helpers/getters';
6
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
6
7
  import styles from './game-score-gauge.module.scss';
7
8
 
8
9
  const ScoreGaugeColumn = ({ Icon, label, rating, max }) => (
@@ -21,7 +22,8 @@ const ScoreGaugeColumn = ({ Icon, label, rating, max }) => (
21
22
  </div>
22
23
  );
23
24
 
24
- const ScoreGauge = ({ page, translations }) => {
25
+ const ScoreGauge = ({ page }) => {
26
+ const { translations } = useContext(Context) || {};
25
27
  const { relation } = page;
26
28
  return (
27
29
  <div className={styles.scoreGauge}>
@@ -95,6 +95,7 @@ const InfoGrid = ({
95
95
  sliderGap: 25,
96
96
  }}
97
97
  useArrows={false}
98
+ gtmClass="info-grid-carousel"
98
99
  >
99
100
  <div className={styles.verticalGrid}>
100
101
  {first.map((item) => {
@@ -64,6 +64,7 @@ const Newsletter = ({
64
64
  active={!!(!toggleNewsetter && !toggleOnScroll)}
65
65
  text={openBtnText}
66
66
  toggleNewsLetter={() => setToggleNewsletter(true)}
67
+ gtmClass="newletter-gtm btn-cta"
67
68
  />
68
69
  )}
69
70
  <div
@@ -1,123 +1,117 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
1
2
  import React from 'react';
2
3
  import {
3
- Title,
4
- Description,
5
- Primary,
6
- PRIMARY_STORY,
7
- ArgsTable,
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ PRIMARY_STORY,
8
+ ArgsTable,
8
9
  } from '@storybook/addon-docs/blocks';
9
10
 
10
11
  import Newsletter from '.';
11
12
 
12
13
  export default {
13
- title: 'Matrix-Theme/Molecules/Newsletter',
14
- component: Newsletter,
15
- argTypes: {
16
- page: {
17
- name: 'page',
18
- type: { name: 'object', required: true },
19
- defaultValue: null,
20
- description: 'The page object.',
21
- },
22
- mainText: {
23
- name: 'mainText',
24
- type: { name: 'String', required: false },
25
- defaultValue: '',
26
- description: 'Main text',
27
- },
28
- subscribeText: {
29
- name: 'subscribeText',
30
- type: { name: 'String', required: false },
31
- defaultValue: '',
32
- description: 'Subscribe Text',
33
- },
34
- placeholderName: {
35
- name: 'placeholderName',
36
- type: { name: 'String', required: false },
37
- defaultValue: '',
38
- description: 'Placeholder Name',
39
- },
40
- placeholderEmail: {
41
- name: 'placeholderEmail',
42
- type: { name: 'String', required: false },
43
- defaultValue: '',
44
- description: 'Placeholder Email',
45
- },
46
- privacyText: {
47
- name: 'privacyText',
48
- type: { name: 'String', required: false },
49
- defaultValue: '',
50
- description: 'Privacy Text',
51
- },
52
- openBtnText: {
53
- name: 'openBtnText',
54
- type: { name: 'String', required: false },
55
- defaultValue: '',
56
- description: 'Open Button Text',
57
- },
58
- buttonText: {
59
- name: 'buttonText',
60
- type: { name: 'String', required: false },
61
- defaultValue: '',
62
- description: 'Button Text',
63
- },
64
- formAction: {
65
- name: 'formAction',
66
- type: { name: 'String', required: false },
67
- defaultValue: '',
68
- description: 'Form Action',
69
- },
70
- newsletterListId: {
71
- name: 'newsletterListId',
72
- type: { name: 'String', required: false },
73
- defaultValue: '',
74
- description: 'Newsletter List Id',
75
- },
76
- footer: {
77
- name: 'footer',
78
- type: { name: 'boolean', required: true },
79
- defaultValue: false,
80
- description: 'Footer Newsletter',
81
- },
14
+ title: 'Matrix-Theme/Molecules/Newsletter',
15
+ component: Newsletter,
16
+ argTypes: {
17
+ page: {
18
+ name: 'page',
19
+ type: { name: 'object', required: true },
20
+ defaultValue: null,
21
+ description: 'The page object.',
82
22
  },
83
- parameters: {
84
- docs: {
85
- description: {
86
- component:
87
- 'Newsletter component',
88
- },
89
- page: () => (
90
- <>
91
- <Title />
92
- <Description />
93
- <Primary />
94
- <ArgsTable story={PRIMARY_STORY} />
95
- </>
96
- ),
97
- },
23
+ mainText: {
24
+ name: 'mainText',
25
+ type: { name: 'String', required: false },
26
+ defaultValue: '',
27
+ description: 'Main text',
98
28
  },
99
- };
100
-
101
- const Template = (args) => <Newsletter {...args} />;
102
-
103
- export const Default = Template.bind({});
104
- Default.args = {
105
- page: {
106
- translations:{
107
- grafikk: 'Grafikk',
108
- bonuser: 'Bonuser',
109
- spillopplevelse: 'Spillopplevelse'
29
+ subscribeText: {
30
+ name: 'subscribeText',
31
+ type: { name: 'String', required: false },
32
+ defaultValue: '',
33
+ description: 'Subscribe Text',
34
+ },
35
+ placeholderName: {
36
+ name: 'placeholderName',
37
+ type: { name: 'String', required: false },
38
+ defaultValue: '',
39
+ description: 'Placeholder Name',
40
+ },
41
+ placeholderEmail: {
42
+ name: 'placeholderEmail',
43
+ type: { name: 'String', required: false },
44
+ defaultValue: '',
45
+ description: 'Placeholder Email',
46
+ },
47
+ privacyText: {
48
+ name: 'privacyText',
49
+ type: { name: 'String', required: false },
50
+ defaultValue: '',
51
+ description: 'Privacy Text',
52
+ },
53
+ openBtnText: {
54
+ name: 'openBtnText',
55
+ type: { name: 'String', required: false },
56
+ defaultValue: '',
57
+ description: 'Open Button Text',
58
+ },
59
+ buttonText: {
60
+ name: 'buttonText',
61
+ type: { name: 'String', required: false },
62
+ defaultValue: '',
63
+ description: 'Button Text',
64
+ },
65
+ formAction: {
66
+ name: 'formAction',
67
+ type: { name: 'String', required: false },
68
+ defaultValue: '',
69
+ description: 'Form Action',
70
+ },
71
+ newsletterListId: {
72
+ name: 'newsletterListId',
73
+ type: { name: 'String', required: false },
74
+ defaultValue: '',
75
+ description: 'Newsletter List Id',
76
+ },
77
+ footer: {
78
+ name: 'footer',
79
+ type: { name: 'boolean', required: true },
80
+ defaultValue: false,
81
+ description: 'Footer Newsletter',
82
+ },
83
+ },
84
+ parameters: {
85
+ docs: {
86
+ description: {
87
+ component: 'Newsletter component',
110
88
  },
89
+ page: () => (
90
+ <>
91
+ <Title />
92
+ <Description />
93
+ <Primary />
94
+ <ArgsTable story={PRIMARY_STORY} />
95
+ </>
96
+ ),
111
97
  },
112
- mainText:"You get more than 405 free spins",
113
- subscribeText:"Subscribe to our newsletter and get more than 405 free spins instantly.",
114
- placeholderName:"Name",
115
- placeholderEmail:"Email",
116
- privacyText:"By subscribing, you confirm that you are over 18 years of age and that you accept our",
117
- openBtnText:"FÅ 405 FREE SPINS UMIDDELBART",
118
- buttonText:"Hent dine freespins",
119
- formAction:'',
120
- newsletterListId:'',
121
- footer : false
122
- };
123
-
98
+ },
99
+ };
100
+
101
+ const Template = (args) => <Newsletter {...args} />;
102
+
103
+ export const Default = Template.bind({});
104
+ Default.args = {
105
+ page: {},
106
+ mainText: 'You get more than 405 free spins',
107
+ subscribeText: 'Subscribe to our newsletter and get more than 405 free spins instantly.',
108
+ placeholderName: 'Name',
109
+ placeholderEmail: 'Email',
110
+ privacyText:
111
+ 'By subscribing, you confirm that you are over 18 years of age and that you accept our',
112
+ openBtnText: 'FÅ 405 FREE SPINS UMIDDELBART',
113
+ buttonText: 'Hent dine freespins',
114
+ formAction: '',
115
+ newsletterListId: '',
116
+ footer: false,
117
+ };
@@ -1,19 +1,19 @@
1
1
  /* eslint-disable react/no-danger */
2
2
  /* eslint-disable no-unused-expressions */
3
3
  /* eslint-disable react/prop-types */
4
- import React, { useRef, useState } from 'react';
4
+ import React, { useRef, useState, useContext } from 'react';
5
5
  import { translate } from 'gatsby-core-theme/src/helpers/getters';
6
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
6
7
  import styles from './newsletter-optin.module.scss';
7
8
 
8
9
  export default function Newsletter({
9
- page,
10
10
  title = 'Exclusive Casino Offers and Free Spins straight to your Inbox',
11
11
  description = 'Subscribe below to be the first to get notified of exclusive casino offers, free spins and bonuses - conveniently via email or SMS. We won’t flood your inbox, but just give you the good stuff in the right way!',
12
12
  terms = 'I confirm that I am 18+ years old and Irish resident.',
13
- privacyText = 'Read our <a href="/privacy-policy">Privacy Policy</a> for more details.',
13
+ privacyText = 'Read our <a class="newsletter-gtm" href="/privacy-policy">Privacy Policy</a> for more details.',
14
14
  }) {
15
15
  const form = useRef(null);
16
-
16
+ const { translations } = useContext(Context) || {};
17
17
  const onSubmit = (e) => {
18
18
  e.preventDefault();
19
19
  // validationForm(e.target.elements) && form.current.submit();
@@ -70,17 +70,17 @@ export default function Newsletter({
70
70
  <p>{description}</p>
71
71
  <form action="" method="post" ref={form} onSubmit={onSubmit}>
72
72
  <input
73
- placeholder={translate(page?.translations, 'first_name', 'First Name')}
73
+ placeholder={translate(translations, 'first_name', 'First Name')}
74
74
  type="text"
75
75
  name="name"
76
76
  />
77
77
  <input
78
- placeholder={translate(page?.translations, 'email', 'E-Mail')}
78
+ placeholder={translate(translations, 'email', 'E-Mail')}
79
79
  type="email"
80
80
  name="email"
81
81
  />
82
82
  <input
83
- placeholder={translate(page?.translations, 'phone_number', 'Phone Number')}
83
+ placeholder={translate(translations, 'phone_number', 'Phone Number')}
84
84
  type="text"
85
85
  name="phone"
86
86
  />