gatsby-matrix-theme 7.1.13 → 7.1.16

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,42 @@
1
+ ## [7.1.16](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v7.1.15...v7.1.16) (2022-05-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * updated to latest core version ([7e01099](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/7e01099905afd0064226d175a60498ff14bd47fc))
7
+
8
+ ## [7.1.15](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v7.1.14...v7.1.15) (2022-05-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add translate for toggle button ([0464483](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0464483c2ac776aee2b9d461a72c737b6d8fee6b))
14
+ * fixed logic of anchor ([0c45039](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0c450393bfe8c9deb00569115773367efc48558d))
15
+ * udpate variantone to expect prop ([bbac40d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/bbac40d3f5242b1a5443a544248f3accf2da0c5c))
16
+ * update showLaunchDate ([9eaf100](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9eaf1003e7ab4fb4d75e0be49c67df00c6117210))
17
+ * update variant one and its style to match il and nsa ([b605272](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b605272235cfe5aacbcbfd133b853873f4179c87))
18
+
19
+
20
+ * Merge branch 'tm-2062-change-toplist-logo' into 'master' ([fee0d3e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fee0d3e2962b5e834e3ec1468dd7e59c233b52a4))
21
+ * Merge branch 'tm-2894-popup-design' into 'master' ([aa0d98c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/aa0d98c173162ad6c16893de006ea2770c3873b2))
22
+ * Merge branch 'tm-2907-anchor' into 'master' ([720818e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/720818eec7ab3754550f881b3e0f7b6c23c9fcab))
23
+
24
+ ## [7.1.14](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v7.1.13...v7.1.14) (2022-05-26)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * add privacyText ([e54910f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e54910f1f2dfab1c611d7615f263e22ac2bd46f0))
30
+ * clean up the code ([8363435](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/83634355e60027bf4cf5e5d50194cd9e0de54eee))
31
+ * cleanup ([be930bb](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/be930bb11c4d595b0942152bc61816be895fc5ee))
32
+ * fix bug ([43d433e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/43d433e7f89299d88cef87e59d8977605a03a292))
33
+ * fix the logic ([1928992](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1928992b62f8688afc9480390e5706e2ae073fd7))
34
+ * fix validation ([083924d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/083924d90aed68d03cc2b7bd975a968df374d74f))
35
+ * validation email ([6d8da87](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6d8da87172a1539fcf463c8ca11700d5e0ec1baf))
36
+
37
+
38
+ * Merge branch 'jetmir/fixLogicNewsletter' into 'master' ([19cd274](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/19cd274d4e4f8d1173d10e8c6b1c955451eccd6d))
39
+
1
40
  ## [7.1.13](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v7.1.12...v7.1.13) (2022-05-26)
2
41
 
3
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "7.1.13",
3
+ "version": "7.1.16",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -29,7 +29,7 @@
29
29
  "react": "^17.0.2",
30
30
  "gatsby-plugin-sitemap": "^3.3.0",
31
31
  "react-dom": "^17.0.2",
32
- "gatsby-core-theme": "^7.0.7"
32
+ "gatsby-core-theme": "^7.0.8"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@babel/core": "^7.13.1",
@@ -10,12 +10,13 @@ import styles from './newsletter-form.module.scss';
10
10
  const NewsletterForm = ({
11
11
  handleApi,
12
12
  setErr,
13
+ setLogading,
13
14
  redirectUrl,
14
- privacyText,
15
+ privacyText = 'By subscribing, you confirm that you are over 18 years of age and that you accept our',
15
16
  formText = {
16
17
  placeholderName: 'John Doe',
17
18
  placeholderEmail: 'johndoe@email.com',
18
- placeholderPhoneNumber: '123456789',
19
+ placeholderPhoneNumber: '08XXXXXXXX',
19
20
  buttonText: 'Submit',
20
21
  thankYouText: null,
21
22
  textAboveEmail: 'Email address',
@@ -23,8 +24,6 @@ const NewsletterForm = ({
23
24
  textAbovePhoneNumber: 'Phone number',
24
25
  mainText: 'You get more than 405 free spins',
25
26
  subscribeText: 'Subscribe to our newsletter and get more than 405 free spins instantly.',
26
- redirectUrl,
27
- privacyText,
28
27
  },
29
28
  }) => {
30
29
  // eslint-disable-next-line react/destructuring-assignment
@@ -32,7 +31,7 @@ const NewsletterForm = ({
32
31
  const form = useRef(null);
33
32
  const [ip, setIP] = useState('');
34
33
  const [error, setError] = useState(false);
35
- const [toggleSubscribe, setToggleSubscribe] = useState(false);
34
+ const [loading, setLoading] = useState(false);
36
35
  const { translations } = useContext(Context) || {};
37
36
 
38
37
  const validationForm = (e) => {
@@ -48,7 +47,7 @@ const NewsletterForm = ({
48
47
  e.name.classList.remove(styles.error);
49
48
  }
50
49
 
51
- if (!e.email.value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i)) {
50
+ if (!e.phone?.value && !e.email.value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i)) {
52
51
  emailValidate = false;
53
52
  e.email.classList.add(styles.error);
54
53
  } else {
@@ -56,7 +55,7 @@ const NewsletterForm = ({
56
55
  e.email.classList.remove(styles.error);
57
56
  }
58
57
 
59
- if (e.phone) {
58
+ if (e.phone && !e.email?.value) {
60
59
  if (!e.phone.value && e.phone.value.trim() === '') {
61
60
  numberValidate = false;
62
61
  e.phone.classList.add(styles.error);
@@ -67,7 +66,6 @@ const NewsletterForm = ({
67
66
  }
68
67
 
69
68
  if (nameValidate && (emailValidate || numberValidate)) {
70
- setToggleSubscribe(true);
71
69
  return true;
72
70
  }
73
71
  return false;
@@ -91,6 +89,7 @@ const NewsletterForm = ({
91
89
  const bacomApi = async (name, email) => {
92
90
  // eslint-disable-next-line no-bitwise
93
91
  const timestamp = (Date.now() / 1000) | 0;
92
+ setLoading(true);
94
93
  await fetch(
95
94
  `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}`,
96
95
  {
@@ -103,6 +102,7 @@ const NewsletterForm = ({
103
102
  ).then((res) =>
104
103
  res.text().then((text) => {
105
104
  text === 'OK' ? (window.location.href = redirectUrl) : setError(true);
105
+ setLoading(false);
106
106
  })
107
107
  );
108
108
  };
@@ -123,49 +123,54 @@ const NewsletterForm = ({
123
123
 
124
124
  return (
125
125
  <>
126
- {!toggleSubscribe && <p className={styles.maintext}>{formText.mainText}</p>}
127
- {!toggleSubscribe && (
128
- <p
129
- dangerouslySetInnerHTML={{ __html: formText.subscribeText }}
130
- className={styles.subscribe}
131
- />
132
- )}
133
- {!error && !toggleSubscribe ? (
134
- <form ref={form} onSubmit={handelSubmit}>
135
- {formText.textAboveName ? (
136
- <p className={styles.textAboveInput}>{formText.textAboveName}</p>
137
- ) : null}
138
-
139
- <input
140
- className={styles.input}
141
- placeholder={formText.placeholderName}
142
- type="text"
143
- name="name"
144
- />
145
- {formText.textAboveEmail ? (
146
- <p className={styles.textAboveInput}>{formText.textAboveEmail}</p>
147
- ) : null}
148
-
149
- <input
150
- className={styles.input}
151
- placeholder={formText.placeholderEmail}
152
- type="email"
153
- name="email"
126
+ {!error ? (
127
+ <>
128
+ <p className={styles.maintext}>{formText.mainText}</p>
129
+ <p
130
+ dangerouslySetInnerHTML={{ __html: formText.subscribeText }}
131
+ className={styles.subscribe}
154
132
  />
155
- {formText.textAbovePhoneNumber ? (
156
- <p className={styles.textAboveInput}>{formText.textAbovePhoneNumber}</p>
157
- ) : null}
158
133
 
159
- {formText.placeholderPhoneNumber && (
134
+ <form ref={form} onSubmit={handelSubmit}>
135
+ {formText.textAboveName ? (
136
+ <p className={styles.textAboveInput}>{formText.textAboveName}</p>
137
+ ) : null}
138
+
139
+ <input
140
+ className={styles.input}
141
+ placeholder={formText.placeholderName}
142
+ type="text"
143
+ name="name"
144
+ />
145
+ {formText.textAboveEmail ? (
146
+ <p className={styles.textAboveInput}>{formText.textAboveEmail}</p>
147
+ ) : null}
148
+
160
149
  <input
161
150
  className={styles.input}
162
- placeholder={formText.placeholderPhoneNumber}
163
- type="tel"
164
- name="phone"
151
+ placeholder={formText.placeholderEmail}
152
+ type="email"
153
+ name="email"
154
+ />
155
+ {formText.textAbovePhoneNumber ? (
156
+ <p className={styles.textAboveInput}>{formText.textAbovePhoneNumber}</p>
157
+ ) : null}
158
+
159
+ {formText.placeholderPhoneNumber && (
160
+ <input
161
+ className={styles.input}
162
+ placeholder={formText.placeholderPhoneNumber}
163
+ type="tel"
164
+ name="phone"
165
+ />
166
+ )}
167
+ <PrivacyandSuccess
168
+ loading={setLogading || loading}
169
+ btnText={formText.buttonText}
170
+ privacyText={privacyText}
165
171
  />
166
- )}
167
- <PrivacyandSuccess btnText={formText.buttonText} privacyText={formText.privacyText} />
168
- </form>
172
+ </form>
173
+ </>
169
174
  ) : (
170
175
  <span>
171
176
  {translate(
@@ -194,6 +199,7 @@ NewsletterForm.propTypes = {
194
199
  setErr: PropTypes.bool,
195
200
  redirectUrl: PropTypes.string,
196
201
  privacyText: PropTypes.string,
202
+ setLogading: PropTypes.bool,
197
203
  };
198
204
 
199
205
  export default NewsletterForm;
@@ -3,18 +3,19 @@ import PropTypes from 'prop-types';
3
3
  import Button from 'gatsby-core-theme/src/components/atoms/button';
4
4
  import styles from './newsletter-privacy&button.module.scss';
5
5
 
6
- const PrivacyandSuccess = ({ privacyText, btnText }) => (
6
+ const PrivacyandSuccess = ({ privacyText, btnText, loading }) => (
7
7
  <div className={styles.display}>
8
8
  {privacyText ? (
9
9
  <p className={styles.privacytext} dangerouslySetInnerHTML={{ __html: privacyText }} />
10
10
  ) : null}
11
- <Button className={styles.button} btnText={btnText} isButton />
11
+ <Button disabled={loading} className={styles.button} btnText={btnText} isButton />
12
12
  </div>
13
13
  );
14
14
 
15
15
  PrivacyandSuccess.propTypes = {
16
16
  privacyText: PropTypes.string,
17
17
  btnText: PropTypes.string,
18
+ loading: PropTypes.bool,
18
19
  };
19
20
 
20
21
  export default PrivacyandSuccess;
@@ -11,21 +11,7 @@ import Button from '../../atoms/newsletter/toggle-button/index';
11
11
  import Form from '../../atoms/newsletter/form/index';
12
12
  import styles from './newsletter.module.scss';
13
13
 
14
- const Newsletter = ({
15
- page,
16
- mainText = 'You get more than 405 free spins',
17
- subscribeText = 'Subscribe to our newsletter and get more than 405 free spins instantly.',
18
- placeholderName = 'Name',
19
- textAboveName = 'Name',
20
- placeholderEmail = 'Email',
21
- textAboveEmail = 'Something to be added',
22
- placeholderPhoneNumber = '00000000',
23
- textAbovePhoneNumber = 'Something to be added',
24
- privacyText = 'By subscribing, you confirm that you are over 18 years of age and that you accept our',
25
- openBtnText = 'FÅ 405 FREE SPINS UMIDDELBART',
26
- buttonText = 'Hent dine freespins',
27
- footer = false,
28
- }) => {
14
+ const Newsletter = ({ page, openBtnText = 'Unlock Exclusive Bonuses', footer = false }) => {
29
15
  const [toggleNewsetter, setToggleNewsletter] = useState(false);
30
16
  const redirectUrl =
31
17
  page?.path === '/'
@@ -56,19 +42,7 @@ const Newsletter = ({
56
42
  : styles.newsletter
57
43
  }
58
44
  >
59
- <Form
60
- placeholderName={placeholderName}
61
- textAboveName={textAboveName}
62
- placeholderEmail={placeholderEmail}
63
- textAboveEmail={textAboveEmail}
64
- placeholderPhoneNumber={placeholderPhoneNumber}
65
- textAbovePhoneNumber={textAbovePhoneNumber}
66
- buttonText={buttonText}
67
- redirectUrl={redirectUrl}
68
- privacyText={privacyText}
69
- mainText={mainText}
70
- subscribeText={subscribeText}
71
- />
45
+ <Form redirectUrl={redirectUrl} />
72
46
  {!footer ? (
73
47
  <MdClose className={styles.closeBtn} onClick={() => setToggleNewsletter(false)} />
74
48
  ) : null}
@@ -78,17 +52,7 @@ const Newsletter = ({
78
52
  };
79
53
 
80
54
  Newsletter.propTypes = {
81
- placeholderName: PropTypes.string,
82
- textAboveName: PropTypes.string,
83
- placeholderEmail: PropTypes.string,
84
- privacyText: PropTypes.string,
85
55
  openBtnText: PropTypes.string,
86
- buttonText: PropTypes.string,
87
- textAboveEmail: PropTypes.string,
88
- placeholderPhoneNumber: PropTypes.string,
89
- textAbovePhoneNumber: PropTypes.string,
90
- mainText: PropTypes.string,
91
- subscribeText: PropTypes.string,
92
56
  page: PropTypes.shape({
93
57
  path: PropTypes.string,
94
58
  template: PropTypes.string,
@@ -28,13 +28,14 @@ export default function Row({
28
28
  layout = 'list',
29
29
  number = 1,
30
30
  isPPC = false,
31
+ showLaunchDate = true,
31
32
  }) {
32
33
  const itemName = item.name;
33
34
  const itemRating = item.rating;
34
35
  const reviewPath = item.review_link ? `/${item.review_link}` : item.path || '/';
35
- const logoUrl = item.logo_url;
36
36
  const pros = item.extra_fields?.pro_1 || item.extra_fields?.pro_2 || item.extra_fields?.pro_3;
37
37
  const { translations } = useContext(Context) || {};
38
+ const tandcEnabled = item?.extra_fields?.terms_and_conditions_text_enabled === '1';
38
39
  let sellingPoints = item.selling_points;
39
40
  if (pros) {
40
41
  sellingPoints = [
@@ -45,18 +46,24 @@ export default function Row({
45
46
  }
46
47
  const trackerType = tracker.toLowerCase().replace(' ', '_');
47
48
  const prettyLink = prettyTracker(item, trackerType);
49
+ const hasRibbon = getExtraField(item.extra_fields, 'ribbon_text');
50
+ const imageObject = item?.standardised_logo_url_object || item?.logo_url_object;
51
+
48
52
  const launchDate = getLaunchDate(item.founded);
49
- const logUrlObject = item?.logo_url_object;
50
53
 
51
54
  return (
52
- <div className={`${styles.row} ${layout === 'grid' ? styles.grid : ''}`}>
55
+ <div
56
+ className={`${styles.row} ${layout === 'grid' ? styles.grid : ''} ${
57
+ showLaunchDate ? styles.launchDate : ''
58
+ } ${!tandcEnabled ? styles.rowNoTandC : ''}`}
59
+ >
53
60
  {layout === 'grid' && (
54
61
  <div className={`${styles.numbers} ${styles[`num_${number}`]}`} id={`num_${number}`}>
55
62
  {number}
56
63
  </div>
57
64
  )}
58
- <div className={styles.ribbon}>
59
- {getExtraField(item.extra_fields, 'ribbon_text') && (
65
+ {hasRibbon && (
66
+ <div className={styles.ribbon}>
60
67
  <Link to={reviewPath} className="toplist-variant-one-gtm">
61
68
  <Label
62
69
  title={getExtraField(item.extra_fields, 'ribbon_text')}
@@ -67,8 +74,8 @@ export default function Row({
67
74
  }
68
75
  />
69
76
  </Link>
70
- )}
71
- </div>
77
+ </div>
78
+ )}
72
79
 
73
80
  <div className={styles.casinoDetails}>
74
81
  <a
@@ -79,10 +86,13 @@ export default function Row({
79
86
  className="toplist-variant-one-gtm logo-cta"
80
87
  >
81
88
  <LazyImage
82
- alt={getAltText(logUrlObject, itemName)}
83
- width={128}
84
- height={40}
85
- src={imagePrettyUrl(logoUrl, 128, 60)}
89
+ alt={getAltText(imageObject, item.name)}
90
+ src={imagePrettyUrl(imageObject?.filename || item?.logo_url, 80).replace(
91
+ 'filters:format(webp)/',
92
+ ''
93
+ )}
94
+ width={80}
95
+ height={800}
86
96
  />
87
97
  </a>
88
98
  <div>
@@ -94,53 +104,53 @@ export default function Row({
94
104
  >
95
105
  {itemName}
96
106
  </a>
97
- <StarRating numOfStars={5} rating={itemRating} />
107
+ <StarRating numOfStars={5} rating={itemRating} showLabel />
108
+ {!isPPC && (
109
+ <Link className={`${styles.reviewLink} toplist-variant-one-gtm`} to={reviewPath}>
110
+ {`${itemName} ${translate(translations, 'read_review', 'Review')}`}
111
+ </Link>
112
+ )}
98
113
  </div>
99
114
  </div>
100
- <div className={styles.bonus}>
101
- <a
102
- href={prettyLink}
103
- target="_blank"
104
- rel="noreferrer"
105
- className="toplist-variant-one-gtm bonus-cta"
106
- >
107
- <Bonus item={item} tracker={oneliner} />
108
- </a>
109
- {!isPPC && (
110
- <Link className={`${styles.reviewLink} toplist-variant-one-gtm`} to={reviewPath}>
111
- {`${itemName} ${translate(translations, 'read_review', 'Review')}`}
112
- </Link>
113
- )}
114
- </div>
115
- <div className={styles.pros}>
116
- <SellingPoints icon={<MdCheck />} sellingPoints={sellingPoints} limit={3} />
117
- </div>
118
- <div className={styles.launchDate}>
119
- {launchDate && (
120
- <>
121
- <p>{translate(translations, 'launch_date', 'Launch Date')}</p>
122
- <p>{launchDate}</p>
123
- </>
124
- )}
125
- </div>
126
- <div className={styles.cta}>
127
- <OperatorCta operator={item} tracker={tracker} gtmClass="toplist-operator-cta-gtm" />
128
- {!isPPC && (
129
- <Link className={`${styles.reviewLink} toplist-variant-one-gtm`} to={reviewPath}>
130
- {`${itemName} ${translate(translations, 'read_review', 'Review')}`}
131
- </Link>
132
- )}
133
- </div>
134
- <div className={styles.tandc}>
135
- {item?.extra_fields?.terms_and_conditions_text_enabled === '1' && (
136
- <Tnc onlyMobile={layout === 'list'} operator={item} />
115
+
116
+ <a
117
+ href={prettyLink}
118
+ target="_blank"
119
+ rel="noreferrer"
120
+ className={`toplist-variant-one-gtm bonus-cta ${styles.bonus} ${
121
+ showLaunchDate ? styles.bonusLaunch : ''
122
+ } ${hasRibbon ? styles.withRibbon : ''}`}
123
+ >
124
+ <Bonus item={item} tracker={oneliner} />
125
+ {showLaunchDate && (
126
+ <span>
127
+ {translate(translations, 'launch_date', 'Launch Date')}: {launchDate}
128
+ </span>
137
129
  )}
138
- </div>
130
+ </a>
131
+ <SellingPoints icon={<MdCheck />} sellingPoints={sellingPoints} limit={3} />
132
+
133
+ {showLaunchDate && (
134
+ <div className={styles.launchDate}>
135
+ {launchDate && (
136
+ <>
137
+ <p className={styles.launchDateLabel}>
138
+ {translate(translations, 'launch_date', 'Launch Date')}
139
+ </p>
140
+ <p>{launchDate}</p>
141
+ </>
142
+ )}
143
+ </div>
144
+ )}
145
+ <OperatorCta operator={item} tracker={tracker} gtmClass="toplist-operator-cta-gtm" />
146
+
147
+ {tandcEnabled && <Tnc onlyMobile={layout === 'list'} operator={item} />}
139
148
  </div>
140
149
  );
141
150
  }
142
151
 
143
152
  Row.propTypes = {
153
+ showLaunchDate: PropTypes.bool,
144
154
  tracker: PropTypes.string,
145
155
  oneliner: PropTypes.string,
146
156
  layout: PropTypes.oneOf(['list', 'grid']),
@@ -150,7 +160,6 @@ Row.propTypes = {
150
160
  name: PropTypes.string,
151
161
  logo_url: PropTypes.string,
152
162
  rating: PropTypes.string,
153
- logo_url_object: PropTypes.shape({}),
154
163
  selling_points: PropTypes.arrayOf(PropTypes.string),
155
164
  review_link: PropTypes.string,
156
165
  one_liners: PropTypes.shape({
@@ -166,6 +175,11 @@ Row.propTypes = {
166
175
  pro_2: PropTypes.string,
167
176
  pro_3: PropTypes.string,
168
177
  }),
178
+ // eslint-disable-next-line react/forbid-prop-types
179
+ standardised_logo_url_object: PropTypes.object,
180
+ // eslint-disable-next-line react/forbid-prop-types
181
+ logo_url_object: PropTypes.object,
182
+
169
183
  bonus: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
170
184
  relation: PropTypes.shape({
171
185
  rating: PropTypes.string,