gatsby-core-theme 1.6.5 → 1.6.6
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 +11 -0
- package/package.json +2 -2
- package/src/components/organisms/form/form.module.scss +22 -20
- package/src/components/organisms/form/index.js +27 -6
- package/src/components/organisms/head/index.js +15 -3
- package/src/hooks/tabs/tab/tab-list.js +1 -1
- package/src/pages/404/404.test.js +3 -3
- package/src/styles/utils/variables/_colors.scss +1 -0
- package/tests/factories/modules/contact-us-authors.factory.js +59 -0
- package/tests/factories/modules/site-schema.factory.js +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [1.6.6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.5...v1.6.6) (2021-11-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added captcha on form ([a85dcb1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a85dcb1b6aa405cab07b4e2d235e63bb189f9511))
|
|
7
|
+
* general fixes ([80bab76](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/80bab7614074a770f0d97a3c3499086701fe7bda))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
* Merge branch 'tm-2565-contact-us-page' into 'master' ([0563d78](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0563d781911004f3fb370e96fcca76066405cd60))
|
|
11
|
+
|
|
1
12
|
## [1.6.5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.4...v1.6.5) (2021-11-22)
|
|
2
13
|
|
|
3
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-core-theme",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "Gatsby Theme NPM Package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"react": "^17.0.2",
|
|
58
58
|
"react-cookies": "^0.1.1",
|
|
59
59
|
"react-dom": "^17.0.2",
|
|
60
|
-
"react-google-recaptcha": "^2.0
|
|
60
|
+
"react-google-recaptcha": "^2.1.0",
|
|
61
61
|
"react-helmet": "^6.0.0",
|
|
62
62
|
"react-icons": "^4.2.0",
|
|
63
63
|
"react-lazyload": "^2.6.5"
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
.contactForm
|
|
2
|
-
.newsLetterForm {
|
|
1
|
+
.contactForm {
|
|
3
2
|
width: 100%;
|
|
4
|
-
|
|
5
|
-
margin: 0 auto;
|
|
3
|
+
padding-top: 1.6rem;
|
|
6
4
|
form {
|
|
7
5
|
width: 100%;
|
|
8
6
|
@include flex-direction(column);
|
|
@@ -20,16 +18,17 @@
|
|
|
20
18
|
.formGroup {
|
|
21
19
|
width: 100%;
|
|
22
20
|
display: inline-block;
|
|
21
|
+
background-color: var(--color-48);
|
|
23
22
|
&.name {
|
|
24
|
-
width: calc(50% - 0.
|
|
25
|
-
margin-right:
|
|
23
|
+
width: calc(50% - 0.8rem);
|
|
24
|
+
margin-right: 1.6rem;
|
|
26
25
|
}
|
|
27
26
|
&.email {
|
|
28
|
-
width: calc(50% - 0.
|
|
27
|
+
width: calc(50% - 0.8rem);
|
|
29
28
|
}
|
|
30
29
|
&.message {
|
|
31
30
|
width: 100%;
|
|
32
|
-
margin-bottom:
|
|
31
|
+
margin-bottom: 1.6rem;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
}
|
|
@@ -51,14 +50,14 @@
|
|
|
51
50
|
|
|
52
51
|
input,
|
|
53
52
|
textarea {
|
|
54
|
-
background:
|
|
55
|
-
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
53
|
+
background: var(--color-48);
|
|
56
54
|
border-radius: 0.3rem;
|
|
57
55
|
font-size: 1.4rem;
|
|
56
|
+
line-height: 2.1rem;
|
|
58
57
|
padding: 1.6rem;
|
|
59
58
|
width: 100%;
|
|
60
59
|
max-width: 100%;
|
|
61
|
-
|
|
60
|
+
border: none;
|
|
62
61
|
outline: none;
|
|
63
62
|
&:invalid,
|
|
64
63
|
&.invalid {
|
|
@@ -78,12 +77,16 @@
|
|
|
78
77
|
display: none;
|
|
79
78
|
}
|
|
80
79
|
}
|
|
80
|
+
|
|
81
81
|
.formButton {
|
|
82
|
+
display: inline-block;
|
|
82
83
|
width: 100%;
|
|
84
|
+
margin-bottom: .8rem;
|
|
83
85
|
button {
|
|
86
|
+
margin: 0;
|
|
84
87
|
width: 100%;
|
|
85
88
|
text-align: center;
|
|
86
|
-
height: 4.
|
|
89
|
+
height: 4.8rem;
|
|
87
90
|
&:focus {
|
|
88
91
|
border: none;
|
|
89
92
|
outline: none;
|
|
@@ -92,37 +95,36 @@
|
|
|
92
95
|
@include min(tablet) {
|
|
93
96
|
width: 100%;
|
|
94
97
|
button {
|
|
95
|
-
width:
|
|
98
|
+
min-width: 16.2rem;
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
|
-
@include min(
|
|
101
|
+
@include min(tablet) {
|
|
99
102
|
width: auto;
|
|
100
103
|
margin-right: 1.6rem;
|
|
101
104
|
display: inline-block;
|
|
102
105
|
}
|
|
103
106
|
}
|
|
104
107
|
.formAlerts {
|
|
105
|
-
|
|
108
|
+
display: inline-block;
|
|
106
109
|
order: -1;
|
|
107
110
|
@include min(tablet) {
|
|
111
|
+
width: calc(100% - 18rem);
|
|
108
112
|
order: unset;
|
|
109
113
|
}
|
|
110
114
|
@include min(desktop) {
|
|
111
|
-
width: calc(100% - 12rem);
|
|
112
115
|
display: inline-block;
|
|
113
|
-
float: right;
|
|
114
116
|
}
|
|
115
117
|
div {
|
|
116
118
|
border-radius: 0.4rem;
|
|
117
|
-
border: 1px solid
|
|
119
|
+
border: 1px solid var(--color-33);
|
|
118
120
|
font-size: 1.4rem;
|
|
119
121
|
font-weight: 400;
|
|
120
122
|
width: 100%;
|
|
121
123
|
height: 4.4rem;
|
|
122
124
|
padding: 1rem 1.6rem;
|
|
123
125
|
&.alertSuccess {
|
|
124
|
-
border-color: var(--
|
|
125
|
-
color: var(--
|
|
126
|
+
border-color: var(--color-44);
|
|
127
|
+
color: var(--color-44) ;
|
|
126
128
|
}
|
|
127
129
|
&.alertDanger {
|
|
128
130
|
border-color: var(--color-11);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
3
|
+
import ReCAPTCHA from 'react-google-recaptcha';
|
|
4
4
|
import Button from '~atoms/button';
|
|
5
5
|
import styles from './form.module.scss';
|
|
6
6
|
|
|
@@ -13,11 +13,13 @@ const FormComponent = ({
|
|
|
13
13
|
hasButton = true,
|
|
14
14
|
buttonLabel = 'Submit',
|
|
15
15
|
}) => {
|
|
16
|
+
const recaptchaRef = useRef();
|
|
16
17
|
const [state, setState] = useState({
|
|
17
18
|
loading: false,
|
|
18
19
|
success: false,
|
|
19
20
|
failed: false,
|
|
20
21
|
isValid: true,
|
|
22
|
+
isDisabled: true,
|
|
21
23
|
name: '',
|
|
22
24
|
email: '',
|
|
23
25
|
message: '',
|
|
@@ -41,14 +43,19 @@ const FormComponent = ({
|
|
|
41
43
|
}
|
|
42
44
|
const handleSubmit = (e) => {
|
|
43
45
|
e.preventDefault();
|
|
44
|
-
const { name, email, message } = state;
|
|
45
|
-
if (
|
|
46
|
-
|
|
46
|
+
const { name, email, message, isDisabled } = state;
|
|
47
|
+
if (
|
|
48
|
+
name === '' ||
|
|
49
|
+
email === '' ||
|
|
50
|
+
(type === 'contact' && message === '') ||
|
|
51
|
+
isDisabled === true
|
|
52
|
+
) {
|
|
53
|
+
setState({ ...state, isValid: false, success: false });
|
|
47
54
|
return;
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
const form = e.target;
|
|
51
|
-
setState({ ...state, loading: true, success: false, failed: false });
|
|
58
|
+
setState({ ...state, loading: true, success: false, failed: false, isDisabled: true });
|
|
52
59
|
postData(submitUrl, new FormData(form))
|
|
53
60
|
.then((response) => {
|
|
54
61
|
// on success
|
|
@@ -58,6 +65,7 @@ const FormComponent = ({
|
|
|
58
65
|
success: true,
|
|
59
66
|
loading: false,
|
|
60
67
|
isValid: true,
|
|
68
|
+
isDisabled: true,
|
|
61
69
|
});
|
|
62
70
|
} else {
|
|
63
71
|
// on error
|
|
@@ -78,8 +86,14 @@ const FormComponent = ({
|
|
|
78
86
|
isValid: true,
|
|
79
87
|
});
|
|
80
88
|
});
|
|
89
|
+
recaptchaRef.current.reset();
|
|
81
90
|
};
|
|
82
91
|
|
|
92
|
+
function recaptchaOnChange(value) {
|
|
93
|
+
// eslint-disable-next-line no-unused-expressions
|
|
94
|
+
value && setState({ ...state, isDisabled: false });
|
|
95
|
+
}
|
|
96
|
+
|
|
83
97
|
return (
|
|
84
98
|
<div
|
|
85
99
|
className={`${styles.formComponent} ${
|
|
@@ -122,6 +136,13 @@ const FormComponent = ({
|
|
|
122
136
|
</div>
|
|
123
137
|
)}
|
|
124
138
|
{/* if has button */}
|
|
139
|
+
<div className={styles.recaptcha}>
|
|
140
|
+
<ReCAPTCHA
|
|
141
|
+
ref={recaptchaRef}
|
|
142
|
+
sitekey={`${process.env.RECAPTCHA_SITE_KEY}`}
|
|
143
|
+
onChange={recaptchaOnChange}
|
|
144
|
+
/>
|
|
145
|
+
</div>
|
|
125
146
|
{hasButton && (
|
|
126
147
|
<div className={styles.formButton}>
|
|
127
148
|
<Button
|
|
@@ -31,6 +31,12 @@ export function getRobotOptions(options) {
|
|
|
31
31
|
if (process.env.GATSBY_ACTIVE_ENV === 'development') array.push('noindex,follow');
|
|
32
32
|
return array.join();
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
function setName(string) {
|
|
36
|
+
const [name] = string.split('.');
|
|
37
|
+
return name[0].toUpperCase() + name.slice(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
34
40
|
const Head = ({ page = {}, siteInfo }) => {
|
|
35
41
|
const pageImage = getPageImage(page) ? getPageImage(page) : imagePrettyUrl(siteInfo?.site_logo);
|
|
36
42
|
// When google re-indexes dev NSA and IRL, remove lines 28, 41, 42, 43 and process.env.GATSBY_ACTIVE_ENV !== 'development' from lines 24, 25, 27, 29, 43
|
|
@@ -43,7 +49,12 @@ const Head = ({ page = {}, siteInfo }) => {
|
|
|
43
49
|
{page.meta_robots && process.env.GATSBY_ACTIVE_ENV !== 'development' && (
|
|
44
50
|
<meta name="robots" content={page.meta_robots.join()} />
|
|
45
51
|
)}
|
|
46
|
-
|
|
52
|
+
|
|
53
|
+
{page.robot_options && !page.path.includes('/page/') && (
|
|
54
|
+
<meta name="robots" content={getRobotOptions(page.robot_options)} />
|
|
55
|
+
)}
|
|
56
|
+
{page.path.includes('/page/') && <meta name="robots" content="noindex,follow" />}
|
|
57
|
+
|
|
47
58
|
{process.env.GATSBY_ACTIVE_ENV === 'development' && (
|
|
48
59
|
<meta name="googlebot" content="noindex,follow" />
|
|
49
60
|
)}
|
|
@@ -51,11 +62,12 @@ const Head = ({ page = {}, siteInfo }) => {
|
|
|
51
62
|
{page.preconnect_links &&
|
|
52
63
|
page.preconnect_links.map((link) => <link key={keygen()} rel="preconnect" href={link} />)}
|
|
53
64
|
<meta name="og:title" content={page.meta_title} />
|
|
54
|
-
<meta name="og:site_name" content={siteInfo?.site_name} />
|
|
65
|
+
<meta name="og:site_name" content={siteInfo?.site_name && setName(siteInfo?.site_name)} />
|
|
55
66
|
<meta name="og:description" content={page.meta_description} />
|
|
56
|
-
<meta name="og:type" content=
|
|
67
|
+
<meta name="og:type" content={page.path === '/' ? 'website' : 'article'} />
|
|
57
68
|
<meta name="og:image" content={pageImage} />
|
|
58
69
|
<meta name="og:url" content={getUrl(page.path)} />
|
|
70
|
+
|
|
59
71
|
{schemaGenerator(page, pageImage).map(
|
|
60
72
|
(schema) =>
|
|
61
73
|
schema && (
|
|
@@ -10,12 +10,12 @@ describe('404', () => {
|
|
|
10
10
|
const { container } = render(
|
|
11
11
|
<PageNotFound
|
|
12
12
|
pageContext={{
|
|
13
|
-
page: { sections: {} },
|
|
13
|
+
page: { sections: {}, path: '' },
|
|
14
14
|
marketSections: {},
|
|
15
15
|
siteInfo: {
|
|
16
16
|
site_name: '',
|
|
17
|
-
site_logo: ''
|
|
18
|
-
}
|
|
17
|
+
site_logo: '',
|
|
18
|
+
},
|
|
19
19
|
}}
|
|
20
20
|
/>
|
|
21
21
|
);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
2
|
+
export const authors = {
|
|
3
|
+
1: {
|
|
4
|
+
author_title: 'Irish Sportsbook Specialist',
|
|
5
|
+
email_address: 'siobhan.aslett@irishluck.ie',
|
|
6
|
+
facebook_profile: null,
|
|
7
|
+
image: 'siobhan-aslett.png',
|
|
8
|
+
image_alt: 'Siobhan Aslett',
|
|
9
|
+
image_object: {
|
|
10
|
+
width: '1024',
|
|
11
|
+
height: '1024',
|
|
12
|
+
url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/siobhan-aslett.png',
|
|
13
|
+
filename: 'siobhan-aslett.png',
|
|
14
|
+
},
|
|
15
|
+
instagram_profile: null,
|
|
16
|
+
linkedin_profile: 'https://ie.linkedin.com/in/siobhan-aslett-b748091ab',
|
|
17
|
+
name: 'Siobhan Aslett',
|
|
18
|
+
twitter_profile: null,
|
|
19
|
+
},
|
|
20
|
+
2: {
|
|
21
|
+
author_title: 'Online Casino Specialist',
|
|
22
|
+
email_address: 'dermot.heathcote@irishluck.ie',
|
|
23
|
+
facebook_profile: null,
|
|
24
|
+
image: 'dermot-heathcote.png',
|
|
25
|
+
image_alt: null,
|
|
26
|
+
instagram_profile: null,
|
|
27
|
+
linkedin_profile: null,
|
|
28
|
+
image_object: {
|
|
29
|
+
width: '1024',
|
|
30
|
+
height: '1024',
|
|
31
|
+
url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/dermot-heathcote.png',
|
|
32
|
+
filename: 'dermot-heathcote.png',
|
|
33
|
+
},
|
|
34
|
+
name: 'Dermot Heathcote',
|
|
35
|
+
twitter_profile: null,
|
|
36
|
+
},
|
|
37
|
+
3: {
|
|
38
|
+
additional_url: null,
|
|
39
|
+
author_title: 'Junior Copywriter',
|
|
40
|
+
email_address: 'cameron.murphy@irishluck.ie',
|
|
41
|
+
facebook_profile: null,
|
|
42
|
+
image: 'cameron-murphy.jpeg',
|
|
43
|
+
image_alt: null,
|
|
44
|
+
image_asset_id: 37728,
|
|
45
|
+
image_object: {
|
|
46
|
+
width: '1024',
|
|
47
|
+
height: '1024',
|
|
48
|
+
url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/cameron-murphy.jpeg',
|
|
49
|
+
filename: 'cameron-murphy.jpeg',
|
|
50
|
+
},
|
|
51
|
+
instagram_profile: null,
|
|
52
|
+
linkedin_profile: null,
|
|
53
|
+
name: 'Cameron Murphy',
|
|
54
|
+
personal_website: null,
|
|
55
|
+
profile_page_path: 'about-us/cameron-murphy',
|
|
56
|
+
site_id: 1,
|
|
57
|
+
twitter_profile: null,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
2
|
+
export const siteSchema = {
|
|
3
|
+
address: null,
|
|
4
|
+
alias_site_name: null,
|
|
5
|
+
email: null,
|
|
6
|
+
facebook: 'https://www.facebook.com/',
|
|
7
|
+
instagram: 'https://www.instagram.com/',
|
|
8
|
+
linkedin: 'https://www.linkedin.com/',
|
|
9
|
+
organization_founding_date: null,
|
|
10
|
+
owned_by: null,
|
|
11
|
+
phone_number: null,
|
|
12
|
+
site_name: null,
|
|
13
|
+
spotify: 'https://www.spotify.com/',
|
|
14
|
+
twitter: 'https://www.twitter.com/',
|
|
15
|
+
wikipedia: 'https://www.wikipedia.com/',
|
|
16
|
+
youtube: 'https://www.youtube.com/',
|
|
17
|
+
};
|