gatsby-core-theme 30.0.113 → 30.0.115
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,17 @@
|
|
|
1
|
+
## [30.0.115](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.114...v30.0.115) (2024-04-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* fix translation key for newsleterr, align with documentation ([b9672be](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b9672beeebaa52a43543067cf9ecbb0fd68a257c))
|
|
7
|
+
|
|
8
|
+
## [30.0.114](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.113...v30.0.114) (2024-04-18)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* validate phone number ([2e9e39e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2e9e39ef0c026c94babf52e42e9aff653376e642))
|
|
14
|
+
|
|
1
15
|
## [30.0.113](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.112...v30.0.113) (2024-04-18)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ import { translate } from 'gatsby-core-theme/src/helpers/getters';
|
|
|
7
7
|
import Form from '../../../organisms/form';
|
|
8
8
|
import { newsLetterForm } from '../../../../constants/forms';
|
|
9
9
|
|
|
10
|
-
const NewsletterForm = ({ handleApi, redirectUrl, submitText = 'Submit', market }) => {
|
|
10
|
+
const NewsletterForm = ({ handleApi, redirectUrl, submitText = 'Submit', market, setErr }) => {
|
|
11
11
|
const [ip, setIP] = useState('');
|
|
12
12
|
const [error, setError] = useState(false);
|
|
13
13
|
const { translations } = useContext(Context) || {};
|
|
@@ -31,11 +31,13 @@ const NewsletterForm = ({ handleApi, redirectUrl, submitText = 'Submit', market
|
|
|
31
31
|
// eslint-disable-next-line no-bitwise
|
|
32
32
|
const timestamp = (Date.now() / 1000) | 0;
|
|
33
33
|
const refUrl = process.env.BACOM_REF_URL;
|
|
34
|
+
const validatePhoneNr = typeof phomeNumber === 'undefined';
|
|
35
|
+
|
|
34
36
|
await fetch(
|
|
35
37
|
`https://bacom.dk/subscribe/gig/?firstname=${name}&user_ip=${ip}&ref_name=${
|
|
36
38
|
process.env.BACOM_REF_NAME
|
|
37
39
|
}&ref_url=${refUrl}×tamp=${timestamp}&country=${process.env.COUNTRY}&email=${email}${
|
|
38
|
-
|
|
40
|
+
!validatePhoneNr ? `&phone_number=${phomeNumber}` : ''
|
|
39
41
|
}`,
|
|
40
42
|
{
|
|
41
43
|
method: 'GET',
|
|
@@ -56,7 +58,7 @@ const NewsletterForm = ({ handleApi, redirectUrl, submitText = 'Submit', market
|
|
|
56
58
|
? handleApi(e?.name?.value, e?.email?.value, e?.phomeNumber?.value, ip)
|
|
57
59
|
: bacomApi(e?.name?.value, e?.email?.value, e?.phomeNumber?.value);
|
|
58
60
|
|
|
59
|
-
if (error)
|
|
61
|
+
if (error || setErr)
|
|
60
62
|
return (
|
|
61
63
|
<span>
|
|
62
64
|
{translate(
|
|
@@ -87,6 +89,7 @@ NewsletterForm.propTypes = {
|
|
|
87
89
|
redirectUrl: PropTypes.string,
|
|
88
90
|
submitText: PropTypes.string,
|
|
89
91
|
market: PropTypes.string,
|
|
92
|
+
setErr: PropTypes.bool,
|
|
90
93
|
};
|
|
91
94
|
|
|
92
95
|
export default NewsletterForm;
|
package/src/constants/forms.js
CHANGED
|
@@ -87,22 +87,22 @@ export const newsLetterForm = {
|
|
|
87
87
|
default: {
|
|
88
88
|
title: {
|
|
89
89
|
label: 'You get more than 405 free spins',
|
|
90
|
-
translationKey: '
|
|
90
|
+
translationKey: 'newsletter_form_main_text',
|
|
91
91
|
},
|
|
92
92
|
description: {
|
|
93
93
|
label: 'Subscribe to our newsletter and get more than 405 free spins instantly.',
|
|
94
|
-
translationKey: '
|
|
94
|
+
translationKey: 'newsletter_form_subscribe_text',
|
|
95
95
|
},
|
|
96
96
|
fields: [
|
|
97
97
|
{
|
|
98
98
|
label: 'Name',
|
|
99
99
|
id: 'name',
|
|
100
100
|
type: 'text',
|
|
101
|
-
translationKey: '
|
|
101
|
+
translationKey: 'newsletter_form_first_name_text',
|
|
102
102
|
required: true,
|
|
103
103
|
placeholder: {
|
|
104
104
|
label: 'John Doe',
|
|
105
|
-
translationKey: '
|
|
105
|
+
translationKey: 'newsletter_form_first_name_placeholder',
|
|
106
106
|
},
|
|
107
107
|
},
|
|
108
108
|
{
|
|
@@ -113,19 +113,19 @@ export const newsLetterForm = {
|
|
|
113
113
|
required: true,
|
|
114
114
|
placeholder: {
|
|
115
115
|
label: 'johndoe@email.com',
|
|
116
|
-
translationKey: '
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
label: 'Phone Number',
|
|
121
|
-
id: 'phomeNumber',
|
|
122
|
-
type: 'number',
|
|
123
|
-
translationKey: 'newsletter_form_phone_text',
|
|
124
|
-
placeholder: {
|
|
125
|
-
label: '08XXXXXXXX',
|
|
126
|
-
translationKey: 'newsletter_placeholder_phone',
|
|
116
|
+
translationKey: 'newsletter_form_email_placeholder',
|
|
127
117
|
},
|
|
128
118
|
},
|
|
119
|
+
// {
|
|
120
|
+
// label: 'Phone Number',
|
|
121
|
+
// id: 'phomeNumber',
|
|
122
|
+
// type: 'number',
|
|
123
|
+
// translationKey: 'newsletter_form_phone_text',
|
|
124
|
+
// placeholder: {
|
|
125
|
+
// label: '08XXXXXXXX',
|
|
126
|
+
// translationKey: 'newsletter_form_phone_placeholder',
|
|
127
|
+
// },
|
|
128
|
+
// },
|
|
129
129
|
{
|
|
130
130
|
type: 'checkbox',
|
|
131
131
|
id: 'checkbox',
|
|
@@ -141,7 +141,7 @@ export const newsLetterForm = {
|
|
|
141
141
|
translationKey: 'link_checkbox',
|
|
142
142
|
},
|
|
143
143
|
required: true,
|
|
144
|
-
translationKey: '
|
|
144
|
+
translationKey: 'newsletter_form_privacy_text_1',
|
|
145
145
|
},
|
|
146
146
|
],
|
|
147
147
|
},
|