gatsby-matrix-theme 7.1.2 → 7.1.3

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,24 @@
1
+ ## [7.1.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v7.1.2...v7.1.3) (2022-05-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * an extra if to check if number is present ([f9c09d1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/f9c09d151c4549e38bef447c8bba73370a9b70b7))
7
+ * button text can be passed through props ([5cb8411](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5cb84113b3bcad14f8d215f86690dd55f18d4289))
8
+ * og image twitter ([5705d3e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5705d3e32acd59df43287ed392b1bddb2b392054))
9
+ * og meta tag facebook ([bbf3205](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/bbf3205e49e9c53cb8254c84239ffd213ef539b4))
10
+ * phone number or email required ([1343b8a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1343b8a1b5254fa6a01c3e1120715db5298691bf))
11
+ * some issues ([6b965a4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6b965a45b120f85396b528ea04fa53f65edd087e))
12
+ * thank you aded conditionally ([88e58be](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/88e58be24b70636b086a7c0ccc8851a6e2d4769d))
13
+ * updated to latest core version ([6b37034](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6b370349be538ff663dd67393f7d689d66627b55))
14
+
15
+
16
+ * Merge branch 'tm-2828-signup-form' into 'master' ([d56624c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d56624c16f2c7b2c912657577386210bd2c0062c))
17
+ * Merge branch 'tm-2828-signup-form' into 'master' ([8653ce5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8653ce544cc550d2c1093095bbbc2a10620c6e93))
18
+ * Merge branch 'tm-2828-phone-number-request' into 'master' ([91b1d93](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/91b1d93f5a5f72bb8832071946ef5c506c58387b))
19
+ * Merge branch 'tm2889-og-image' into 'master' ([d247e08](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d247e08ca99b4d8b864bd45862a8b9294b9a0799))
20
+ * Merge branch 'tm-2563-unhandled-issues' into 'master' ([d8f3887](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d8f388789d09c52eb30cf1ebe35b2ea8ffc46a91))
21
+
1
22
  ## [7.1.2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v7.1.1...v7.1.2) (2022-05-18)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "7.1.2",
3
+ "version": "7.1.3",
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.6"
32
+ "gatsby-core-theme": "^7.0.7"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@babel/core": "^7.13.1",
@@ -13,17 +13,20 @@ const NewsletterForm = ({
13
13
  subscribeText,
14
14
  setErr,
15
15
  redirectUrl,
16
+ privacyText,
16
17
  formText = {
17
18
  placeholderName: 'John Doe',
18
19
  placeholderEmail: 'johndoe@email.com',
19
20
  placeholderPhoneNumber: '123456789',
20
21
  buttonText: 'Submit',
22
+ thankYouText: null,
21
23
  textAboveEmail: 'Email address',
22
24
  textAboveName: 'Your name',
23
25
  textAbovePhoneNumber: 'Phone number',
24
26
  mainText,
25
27
  subscribeText,
26
28
  redirectUrl,
29
+ privacyText,
27
30
  },
28
31
  }) => {
29
32
  // eslint-disable-next-line react/destructuring-assignment
@@ -55,15 +58,17 @@ const NewsletterForm = ({
55
58
  e.email.classList.remove(styles.error);
56
59
  }
57
60
 
58
- if (!e.phone.value && e.phone.value.trim() === '') {
59
- numberValidate = false;
60
- e.phone.classList.add(styles.error);
61
- } else {
62
- numberValidate = true;
63
- e.phone.classList.remove(styles.error);
61
+ if (e.phone) {
62
+ if (!e.phone.value && e.phone.value.trim() === '') {
63
+ numberValidate = false;
64
+ e.phone.classList.add(styles.error);
65
+ } else {
66
+ numberValidate = true;
67
+ e.phone.classList.remove(styles.error);
68
+ }
64
69
  }
65
70
 
66
- if (nameValidate && emailValidate && numberValidate) {
71
+ if (nameValidate && (emailValidate || numberValidate)) {
67
72
  setToggleSubscribe(true);
68
73
  return true;
69
74
  }
@@ -121,7 +126,7 @@ const NewsletterForm = ({
121
126
  return (
122
127
  <>
123
128
  {toggleSubscribe ? (
124
- <h1>Thank you</h1>
129
+ form.textthankYouText && <h1>Thank you</h1>
125
130
  ) : (
126
131
  <h1 className={styles.maintext}>{formText.mainText}</h1>
127
132
  )}
@@ -152,13 +157,15 @@ const NewsletterForm = ({
152
157
  <p className={styles.textAboveInput}>{formText.textAbovePhoneNumber}</p>
153
158
  ) : null}
154
159
 
155
- <input
156
- className={styles.input}
157
- placeholder={formText.placeholderPhoneNumber}
158
- type="tel"
159
- name="phone"
160
- />
161
- <PrivacyandSuccess privacyText={formText.privacyText} />
160
+ {formText.placeholderPhoneNumber && (
161
+ <input
162
+ className={styles.input}
163
+ placeholder={formText.placeholderPhoneNumber}
164
+ type="tel"
165
+ name="phone"
166
+ />
167
+ )}
168
+ <PrivacyandSuccess btnText={formText.buttonText} privacyText={formText.privacyText} />
162
169
  </form>
163
170
  ) : (
164
171
  <span>
@@ -189,6 +196,7 @@ NewsletterForm.propTypes = {
189
196
  mainText: PropTypes.string,
190
197
  subscribeText: PropTypes.string,
191
198
  redirectUrl: PropTypes.string,
199
+ privacyText: PropTypes.string,
192
200
  };
193
201
 
194
202
  export default NewsletterForm;
@@ -3,17 +3,18 @@ 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 }) => (
6
+ const PrivacyandSuccess = ({ privacyText, btnText }) => (
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="Submit" isButton />
11
+ <Button className={styles.button} btnText={btnText} isButton />
12
12
  </div>
13
13
  );
14
14
 
15
15
  PrivacyandSuccess.propTypes = {
16
16
  privacyText: PropTypes.string,
17
+ btnText: PropTypes.string,
17
18
  };
18
19
 
19
20
  export default PrivacyandSuccess;
@@ -71,7 +71,7 @@ const Head = ({ page = {}, siteInfo }) => {
71
71
  />
72
72
  <meta property="og:description" content={parsedMetaDescr} />
73
73
  <meta property="og:type" content={page.path === '/' ? 'website' : 'article'} />
74
- <meta property="og:image" content={pageImage} />
74
+ <meta property="og:image" content={pageImage.replace('/filters:format(webp)', '')} />
75
75
  <meta property="og:url" content={getUrl(page.path)} />
76
76
  <meta
77
77
  property="og:locale"
@@ -98,7 +98,7 @@ const Head = ({ page = {}, siteInfo }) => {
98
98
  <meta name="twitter:site" content={`@${twitterUsername}`} />
99
99
  <meta name="twitter:creator" content={`@${twitterUsername}`} />
100
100
  <meta name="twitter:card" content="summary" />
101
- <meta name="twitter:image" content={pageImage} />
101
+ <meta name="twitter:image" content={pageImage.replace('/filters:format(webp)', '')} />
102
102
  <meta property="twitter:label1" content="Reading time" />
103
103
  <meta property="twitter:data1" content={`${page.reading_time}`} />
104
104
  </Helmet>