gatsby-core-theme 1.6.2 → 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 CHANGED
@@ -1,3 +1,45 @@
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
+
12
+ ## [1.6.5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.4...v1.6.5) (2021-11-22)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * manu item image width and height ([799be5b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/799be5b2e2e54a21e5d5beb00c9eec7a152d7560))
18
+
19
+ ## [1.6.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.3...v1.6.4) (2021-11-22)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * general issues ([419d8d3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/419d8d36f7bfe153e7e07d2ad2b92cd19e597aa1))
25
+
26
+
27
+ ### Code Refactoring
28
+
29
+ * align cards on search, dropdown z-index on mobile when open, lazyload force load on tab click ([1e44fa7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/1e44fa74f6e6ac63169a9bca9affa40f96a7d3cc))
30
+
31
+
32
+ * Merge branch 'tm-2478-search' into 'master' ([26e1a6e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/26e1a6ebd7632a4b866d9e02f8edf58cca5a17f6))
33
+ * Merge branch 'tm-2478-search' of git.ilcd.rocks:team-floyd/themes/gatsby-themes into tm-2478-search ([725ec14](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/725ec145917d2d7eb436f90cbb87a5427300166d))
34
+ * Merge branch 'master' into tm-2478-search ([9be2cb8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9be2cb83d0948f9925b8e199064e075a44fc2f6d))
35
+
36
+ ## [1.6.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.2...v1.6.3) (2021-11-18)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * html sitemap filters ([58892f4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/58892f4a694be085c32ea80daef50f7c59ee8d87))
42
+
1
43
  ## [1.6.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.1...v1.6.2) (2021-11-17)
2
44
 
3
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "1.6.2",
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.1",
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"
@@ -78,7 +78,10 @@ export default function AuthorBox({ author }) {
78
78
  </a>
79
79
  ))}
80
80
  </p>
81
- <p className={styles.biography}>{author.biography}</p>
81
+ <div
82
+ className={styles.biography}
83
+ dangerouslySetInnerHTML={{ __html: author.biography }}
84
+ />
82
85
  </div>
83
86
  {author.profile_page_path && (
84
87
  <Link
@@ -35,7 +35,9 @@ export default function Item({
35
35
  const isMobile = useIsMobile();
36
36
 
37
37
  const ItemImage = () =>
38
- item.image ? <img src={imagePrettyUrl(item.image)} alt={item.title} /> : null;
38
+ item.image ? (
39
+ <img width="20" height="20" src={imagePrettyUrl(item.image)} alt={item.title} />
40
+ ) : null;
39
41
 
40
42
  return (
41
43
  <ConditionalWrapper
@@ -15,7 +15,9 @@ const Archive = ({ module, PaginationComponent, page, loadMore, gtmClass = '' })
15
15
 
16
16
  useEffect(() => {
17
17
  if (module.pagination_type === 'load_more') {
18
- const items = module.items.filter((item, index) => index < parseInt(loadMore.limit));
18
+ const items = module.items.filter(
19
+ (item, index) => index < parseInt(loadMore ? loadMore.limit : 9)
20
+ );
19
21
  setModuleItems(items);
20
22
  }
21
23
  }, [module, module.items, loadMore]);
@@ -24,7 +26,7 @@ const Archive = ({ module, PaginationComponent, page, loadMore, gtmClass = '' })
24
26
  let items = [...module.items];
25
27
  if (items.length > moduleItems.length) {
26
28
  items = items.filter(
27
- (item, index) => index < moduleItems.length + parseInt(loadMore.increment)
29
+ (item, index) => index < moduleItems.length + parseInt(loadMore ? loadMore.increment : 9)
28
30
  );
29
31
  setModuleItems(items);
30
32
  }
@@ -2,15 +2,15 @@
2
2
  display: grid;
3
3
 
4
4
  @include min(mobile) {
5
- grid-template-columns: repeat(var(--cards-mob-column), 1fr);
5
+ grid-template-columns: repeat(var(--cards-mob-column), minmax(0,1fr));
6
6
  }
7
7
 
8
8
  @include min(tablet) {
9
- grid-template-columns: repeat(var(--cards-tablet-column), 1fr);
9
+ grid-template-columns: repeat(var(--cards-tablet-column), minmax(0,1fr));
10
10
  }
11
11
 
12
12
  @include min(desktop) {
13
- grid-template-columns: repeat(var(--cards-desktop-column), 1fr);
13
+ grid-template-columns: repeat(var(--cards-desktop-column), minmax(0,1fr));
14
14
  }
15
15
  column-gap: 0.8rem;
16
16
  @include min(desktop) {
@@ -1,8 +1,6 @@
1
- .contactForm,
2
- .newsLetterForm {
1
+ .contactForm {
3
2
  width: 100%;
4
- max-width: 80rem;
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.4rem);
25
- margin-right: 0.8rem;
23
+ width: calc(50% - 0.8rem);
24
+ margin-right: 1.6rem;
26
25
  }
27
26
  &.email {
28
- width: calc(50% - 0.4rem);
27
+ width: calc(50% - 0.8rem);
29
28
  }
30
29
  &.message {
31
30
  width: 100%;
32
- margin-bottom: 1rem;
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: #f3f2f2;
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
- // border: none;
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.4rem;
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: auto;
98
+ min-width: 16.2rem;
96
99
  }
97
100
  }
98
- @include min(desktop) {
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
- width: 100%;
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 #000;
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(--primary-color);
125
- color: var(--primary-color);
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 (name === '' || email === '' || (type === 'contact' && message === '')) {
46
- setState({ ...state, isValid: false });
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
- {page.robot_options && <meta name="robots" content={getRobotOptions(page.robot_options)} />}
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="article" />
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 && (
@@ -39,9 +39,11 @@ export function processSitemapPages(pages, markets) {
39
39
  pageListByMarket[market] = [];
40
40
  let pageList = [];
41
41
  Object.keys(pages[market]).forEach((pageType) => {
42
- pageList = pageList.concat(
43
- pages[market][pageType].map((row) => pick(row, pickHTMLSitemapPageKeys))
42
+ const filteredPages = pages[market][pageType].filter(
43
+ (page) => page.robot_options && page.robot_options.page_index === 1
44
44
  );
45
+
46
+ pageList = pageList.concat(filteredPages.map((row) => pick(row, pickHTMLSitemapPageKeys)));
45
47
  });
46
48
 
47
49
  pageListByMarket[market] = groupBy(pageList, 'template_id');
@@ -1,5 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { forceCheck } from 'react-lazyload';
3
4
  import TabList from './tab/tab-list';
4
5
  import styles from './tabs.module.scss';
5
6
 
@@ -24,6 +25,7 @@ const Tabs = ({
24
25
 
25
26
  function onClickTabItem(tabId) {
26
27
  setActiveTab(tabId);
28
+ forceCheck();
27
29
  }
28
30
 
29
31
  return (
@@ -79,7 +79,7 @@ TabList.propTypes = {
79
79
  activeTab: PropTypes.string,
80
80
  activeTabClass: PropTypes.string,
81
81
  alignRight: PropTypes.bool,
82
- gtmClass: PropTypes.bool,
82
+ gtmClass: PropTypes.string,
83
83
  };
84
84
 
85
85
  export default TabList;
@@ -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
  );
@@ -11,7 +11,7 @@
11
11
  opacity: 1;
12
12
  z-index: map-get($z-index, modal);
13
13
  &.list {
14
- z-index: map-get($z-index, above-content);
14
+ z-index: map-get($z-index, --scroll-to-top-index);
15
15
  }
16
16
  }
17
17
  }
@@ -49,4 +49,5 @@
49
49
  --color-45: #83ad10;
50
50
  --color-46: #cc8006;
51
51
  --color-47: #006695;
52
+ --color-48: #E5E5E5;
52
53
  }
@@ -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
+ };
@@ -13,6 +13,9 @@ export default function getPageDataList(length) {
13
13
  template_id: '5',
14
14
  name: 'Rizk Casino',
15
15
  logo_url: '#',
16
+ robot_options: {
17
+ page_index: 1,
18
+ },
16
19
  banner: '313df295c19d7c5f137ceda9d0cc5df7.jpeg',
17
20
  meta_title: 'my meta title',
18
21
  language: 'en',