gatsby-matrix-theme 2.1.2 → 2.2.0

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.
Files changed (88) hide show
  1. package/.storybook/main.js +1 -0
  2. package/CHANGELOG.md +46 -0
  3. package/jest.config.js +1 -0
  4. package/package.json +2 -2
  5. package/src/components/atoms/cards/article-card/index.js +9 -6
  6. package/src/components/atoms/cards/author-card/index.js +6 -1
  7. package/src/components/atoms/cards/base-card/index.js +1 -1
  8. package/src/components/atoms/cards/game-card/index.js +9 -6
  9. package/src/components/atoms/cards/operator-card/index.js +14 -8
  10. package/src/components/atoms/cards/payment-method-card/index.js +11 -9
  11. package/src/components/atoms/cards/popup-card/index.js +2 -3
  12. package/src/components/atoms/cards/popup-card/popup-card.stories.js +0 -10
  13. package/src/components/atoms/cards/software-provider-card/index.js +10 -9
  14. package/src/components/atoms/link-menu/index.js +1 -1
  15. package/src/components/atoms/operator-bonuses/index.js +10 -7
  16. package/src/components/atoms/search/autocomplete/article.js +1 -1
  17. package/src/components/atoms/search/autocomplete/game.js +1 -1
  18. package/src/components/atoms/search/autocomplete/operator.js +1 -1
  19. package/src/components/atoms/search/autocomplete/payment_methods.js +1 -1
  20. package/src/components/atoms/search/autocomplete/software_provider.js +1 -1
  21. package/src/components/atoms/table/banking/index.js +24 -20
  22. package/src/components/atoms/table/column/index.js +2 -5
  23. package/src/components/atoms/table/staticColumn/index.js +28 -33
  24. package/src/components/molecules/faq/index.js +1 -1
  25. package/src/components/molecules/game-iframe/index.js +6 -1
  26. package/src/components/molecules/game-score-gauge/game-score-gauge.stories.js +7 -12
  27. package/src/components/molecules/game-score-gauge/index.js +4 -2
  28. package/src/components/molecules/info-grid/index.js +1 -0
  29. package/src/components/molecules/newsletter/index.js +1 -0
  30. package/src/components/molecules/newsletter/newsletter.stories.js +106 -112
  31. package/src/components/molecules/newsletter-optin/index.js +7 -7
  32. package/src/components/molecules/newsletter-optin/newsletter-optin.stories.js +79 -80
  33. package/src/components/molecules/operator-summary/index.js +8 -2
  34. package/src/components/molecules/small-welcome-bonus/index.js +19 -6
  35. package/src/components/molecules/small-welcome-bonus/small-welcome-bonus.stories.js +49 -53
  36. package/src/components/molecules/toplist/row/variant-one.js +26 -10
  37. package/src/components/organisms/footer-navigation/index.js +9 -1
  38. package/src/components/organisms/popup/index.js +6 -5
  39. package/src/components/organisms/popup/popup.stories.js +0 -10
  40. package/src/components/organisms/toplist/comparison-table/index.js +11 -13
  41. package/src/components/organisms/toplist/index.js +2 -4
  42. package/src/components/organisms/toplist/list/index.js +4 -5
  43. package/src/gatsby-core-theme/components/atoms/module-title/index.js +5 -8
  44. package/src/gatsby-core-theme/components/atoms/not-found/index.js +24 -0
  45. package/src/gatsby-core-theme/components/atoms/not-found/not-found.module.scss +17 -0
  46. package/src/gatsby-core-theme/components/atoms/spotlights/index.js +25 -8
  47. package/src/gatsby-core-theme/components/molecules/content/content.module.scss +73 -16
  48. package/src/gatsby-core-theme/components/molecules/content/index.js +2 -0
  49. package/src/gatsby-core-theme/components/molecules/footer/index.js +5 -1
  50. package/src/gatsby-core-theme/components/molecules/main/index.js +6 -1
  51. package/src/gatsby-core-theme/components/molecules/module/index.js +1 -3
  52. package/src/gatsby-core-theme/components/molecules/search/index.js +26 -3
  53. package/src/gatsby-core-theme/components/organisms/anchor/anchor.module.scss +5 -1
  54. package/src/gatsby-core-theme/components/organisms/anchor/index.js +11 -2
  55. package/src/gatsby-core-theme/components/organisms/carousel/index.js +17 -6
  56. package/src/gatsby-core-theme/components/organisms/navigation/index.js +2 -2
  57. package/src/gatsby-core-theme/components/organisms/search/index.js +2 -1
  58. package/src/gatsby-core-theme/components/pages/body/index.js +14 -9
  59. package/src/gatsby-core-theme/components/pages/search/index.js +79 -74
  60. package/src/hooks/tabs/index.js +6 -4
  61. package/src/hooks/tabs/tab/tab-list.js +4 -1
  62. package/src/hooks/tabs/tab/tab.js +37 -28
  63. package/storybook/public/{0.a9b647e1.iframe.bundle.js → 0.a5c4cf9f.iframe.bundle.js} +1 -1
  64. package/storybook/public/{1.94c59b7e.iframe.bundle.js → 1.b2b72c50.iframe.bundle.js} +1 -1
  65. package/storybook/public/{10.727dd594.iframe.bundle.js → 10.502b5ac2.iframe.bundle.js} +1 -1
  66. package/storybook/public/{11.2e850035.iframe.bundle.js → 11.30535586.iframe.bundle.js} +1 -1
  67. package/storybook/public/{5.fed35abd.iframe.bundle.js → 5.66b5b921.iframe.bundle.js} +3 -3
  68. package/storybook/public/{5.fed35abd.iframe.bundle.js.LICENSE.txt → 5.66b5b921.iframe.bundle.js.LICENSE.txt} +0 -0
  69. package/storybook/public/5.66b5b921.iframe.bundle.js.map +1 -0
  70. package/storybook/public/{6.a63e093c.iframe.bundle.js → 6.89431426.iframe.bundle.js} +1 -1
  71. package/storybook/public/{7.4996d626.iframe.bundle.js → 7.a53e817b.iframe.bundle.js} +1 -1
  72. package/storybook/public/8.e043e6dc.iframe.bundle.js +3 -0
  73. package/storybook/public/{8.f4491507.iframe.bundle.js.LICENSE.txt → 8.e043e6dc.iframe.bundle.js.LICENSE.txt} +0 -0
  74. package/storybook/public/8.e043e6dc.iframe.bundle.js.map +1 -0
  75. package/storybook/public/{9.3097c14c.iframe.bundle.js → 9.eba0e7c0.iframe.bundle.js} +1 -1
  76. package/storybook/public/iframe.html +1 -1
  77. package/storybook/public/main.c07025f4.iframe.bundle.js +1 -0
  78. package/storybook/public/{runtime~main.941ed6de.iframe.bundle.js → runtime~main.c4f3a4d6.iframe.bundle.js} +1 -1
  79. package/storybook/public/vendors~main.8050786b.iframe.bundle.js +7 -0
  80. package/storybook/public/{vendors~main.f3d8ec5b.iframe.bundle.js.LICENSE.txt → vendors~main.8050786b.iframe.bundle.js.LICENSE.txt} +0 -0
  81. package/storybook/public/vendors~main.8050786b.iframe.bundle.js.map +1 -0
  82. package/src/gatsby-core-theme/pages/404/index.js +0 -66
  83. package/storybook/public/5.fed35abd.iframe.bundle.js.map +0 -1
  84. package/storybook/public/8.f4491507.iframe.bundle.js +0 -3
  85. package/storybook/public/8.f4491507.iframe.bundle.js.map +0 -1
  86. package/storybook/public/main.920f3ab1.iframe.bundle.js +0 -1
  87. package/storybook/public/vendors~main.f3d8ec5b.iframe.bundle.js +0 -7
  88. package/storybook/public/vendors~main.f3d8ec5b.iframe.bundle.js.map +0 -1
@@ -9,7 +9,6 @@ import Row from '../../molecules/toplist/row/variant-one';
9
9
 
10
10
  const TopList = ({ module, toplistHeading, CustomRow, page }) => {
11
11
  const template = page?.template;
12
- const translations = page?.translations;
13
12
  const ComparisonTable =
14
13
  module?.style === 'comparison_table' ? loadable(() => import('./comparison-table')) : null;
15
14
 
@@ -21,14 +20,13 @@ const TopList = ({ module, toplistHeading, CustomRow, page }) => {
21
20
  page={page}
22
21
  />
23
22
  ) : (
24
- <Tabs translations={page.translations} title={module.title} module={module} tabsAlign="right">
23
+ <Tabs title={module.title} module={module} tabsAlign="right" gtmClass="toplist-tabs-menu-gtm">
25
24
  {module.items.map((toplist) => (
26
25
  <div label={toplist.title} key={keygen()}>
27
26
  {toplistHeading}
28
27
  <List
29
28
  toplist={toplist}
30
29
  CustomRow={Row}
31
- translations={translations}
32
30
  hasLoadMoreButton={toplist.show_load_more}
33
31
  initItemsCount={toplist.num_items_initial_load}
34
32
  loadItemsCount={toplist.num_items_load_more}
@@ -48,7 +46,7 @@ TopList.propTypes = {
48
46
  }),
49
47
  toplistHeading: PropTypes.element,
50
48
  CustomRow: PropTypes.func,
51
- page: PropTypes.shape({ template: PropTypes.string, translations: PropTypes.shape({}) }),
49
+ page: PropTypes.shape({ template: PropTypes.string }),
52
50
  };
53
51
 
54
52
  export default TopList;
@@ -1,9 +1,10 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
2
  /* eslint-disable react/prop-types */
3
- import React, { useRef } from 'react';
3
+ import React, { useRef, useContext } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { forceCheck } from 'react-lazyload';
6
6
  import { translate } from 'gatsby-core-theme/src/helpers/getters';
7
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
7
8
  import keygen from '~helpers/keygen';
8
9
  import Row from '~molecules/toplist/default-row';
9
10
  import Button from '~atoms/button';
@@ -16,13 +17,12 @@ export default function List({
16
17
  initItemsCount,
17
18
  loadItemsCount,
18
19
  pageTemplate,
19
- translations,
20
20
  }) {
21
21
  const initLoadItems = Number(initItemsCount) !== 0 ? Number(initItemsCount) : 10000;
22
22
  const loadingItems = Number(loadItemsCount) !== 0 ? Number(loadItemsCount) : 10000;
23
23
 
24
24
  const isPPCPage = pageTemplate && pageTemplate.toLowerCase() === 'ppc';
25
-
25
+ const { translations } = useContext(Context) || {};
26
26
  const elRefs = useRef([]);
27
27
 
28
28
  const addToRefs = (el, index) => {
@@ -66,7 +66,6 @@ export default function List({
66
66
  tracker={toplist.tracker}
67
67
  oneliner={toplist.one_liner}
68
68
  isPPC={isPPCPage}
69
- translations={translations}
70
69
  index={index}
71
70
  />
72
71
  ) : (
@@ -84,6 +83,7 @@ export default function List({
84
83
  onClick={handleClick}
85
84
  invertColors
86
85
  primaryColor={false}
86
+ gtmClass="toplist-loadmore-btn-gtm btn-cta"
87
87
  />
88
88
  </div>
89
89
  )}
@@ -106,5 +106,4 @@ List.propTypes = {
106
106
  initItemsCount: PropTypes.string,
107
107
  loadItemsCount: PropTypes.string,
108
108
  pageTemplate: PropTypes.string,
109
- translations: PropTypes.shape({}),
110
109
  };
@@ -1,17 +1,13 @@
1
- import React from 'react';
1
+ import React, { useContext } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { FaAngleRight } from 'react-icons/fa';
4
4
  import { translate } from 'gatsby-core-theme/src/helpers/getters';
5
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
5
6
  // eslint-disable-next-line import/no-extraneous-dependencies
6
7
  import styles from './module-title.module.scss';
7
8
  import Link from '~hooks/link';
8
9
 
9
- const ModuleTitle = ({
10
- module,
11
- viewMoreIcon = <FaAngleRight />,
12
- pageContext = null,
13
- translations,
14
- }) => {
10
+ const ModuleTitle = ({ module, viewMoreIcon = <FaAngleRight />, pageContext = null }) => {
15
11
  const tabsToplist = module?.items?.length > 1 && module?.name === 'top_list';
16
12
  const CustomTag = `${module.module_title_tag}`;
17
13
  const monthNames = [
@@ -28,6 +24,7 @@ const ModuleTitle = ({
28
24
  'November',
29
25
  'December',
30
26
  ];
27
+ const { translations } = useContext(Context) || {};
31
28
  const d = new Date();
32
29
  const year = d.getFullYear();
33
30
  const month = monthNames[d.getMonth()];
@@ -91,7 +88,7 @@ const ModuleTitle = ({
91
88
  </span>
92
89
 
93
90
  {module.link_label && (
94
- <Link to={module.link_value} className={styles.viewMore}>
91
+ <Link to={module.link_value} className={`${styles.viewMore} module-title-gtm`}>
95
92
  {module.link_label}
96
93
  {viewMoreIcon}
97
94
  </Link>
@@ -0,0 +1,24 @@
1
+ /* eslint-disable react/no-unescaped-entities */
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import Image from 'gatsby-core-theme/src/hooks/gatsby-img';
5
+
6
+ import styles from './not-found.module.scss';
7
+
8
+ const NotFound = ({ imagePath }) => (
9
+ <div className={styles.wrapper}>
10
+ <div className={styles.textBlock}>
11
+ <p>Oops! We can't seem to find that page anymore.</p>
12
+ <p>While you're here though, why not check out these top South African Casinos:</p>
13
+ </div>
14
+ <div className={styles.imgContainer}>
15
+ <Image filename={imagePath} width={381} height={144} alt="Not found" />
16
+ </div>
17
+ </div>
18
+ );
19
+
20
+ NotFound.propTypes = {
21
+ imagePath: PropTypes.string,
22
+ };
23
+
24
+ export default NotFound;
@@ -0,0 +1,17 @@
1
+ .wrapper {
2
+ max-width: var(--main-container-max);
3
+ margin: 0 auto;
4
+ padding: 0 1.6rem;
5
+ margin-top: 8rem;
6
+
7
+ @include min(laptop) {
8
+ margin-top: 0;
9
+ padding: 0 2.4rem;
10
+ }
11
+
12
+ .textBlock {
13
+ @include min(tablet) {
14
+ max-width: 60%;
15
+ }
16
+ }
17
+ }
@@ -20,10 +20,10 @@ const Spotlights = ({ module, page }) => {
20
20
  const img = mode === 'icon' ? item.icon : item.image;
21
21
  return (
22
22
  <>
23
- <span className={styles.itemImage}>
23
+ <span className={`${styles.itemImage} logo-cta`}>
24
24
  <LazyImage alt={item.label} src={imagePrettyUrl(img)} />
25
25
  </span>
26
- <span className={styles.label}>{item.label}</span>
26
+ <span className={`${styles.label} name-cta`}>{item.label}</span>
27
27
  </>
28
28
  );
29
29
  };
@@ -58,11 +58,17 @@ const Spotlights = ({ module, page }) => {
58
58
  {path === 'about-us' ? (
59
59
  <>
60
60
  {item.link.type === 'external' ? (
61
- <a href={item.link.value} title={item.label} target="_blank" rel="noreferrer">
61
+ <a
62
+ href={item.link.value}
63
+ title={item.label}
64
+ target="_blank"
65
+ rel="noreferrer"
66
+ className="spotlights-gtm"
67
+ >
62
68
  {content(item)}
63
69
  </a>
64
70
  ) : (
65
- <Link to={item.link.value} title={item.label}>
71
+ <Link to={item.link.value} title={item.label} className="spotlights-gtm">
66
72
  {content(item)}
67
73
  </Link>
68
74
  )}
@@ -79,14 +85,18 @@ const Spotlights = ({ module, page }) => {
79
85
  title={item.label}
80
86
  target="_blank"
81
87
  rel="noreferrer"
82
- className={styles.readMore}
88
+ className={`${styles.readMore} spotlights-gtm`}
83
89
  >
84
90
  {item.link_text ? item.link_text : 'Read More'}
85
91
  </a>
86
92
  ) : (
87
93
  <>
88
94
  {item.link.value && (
89
- <Link to={item.link.value} title={item.label} className={styles.readMore}>
95
+ <Link
96
+ to={item.link.value}
97
+ title={item.label}
98
+ className={`${styles.readMore} spotlights-gtm`}
99
+ >
90
100
  {see_more_link.title ? see_more_link.title : 'Read More'}
91
101
  </Link>
92
102
  )}
@@ -98,11 +108,17 @@ const Spotlights = ({ module, page }) => {
98
108
  ) : (
99
109
  <div className={styles.pillarCards}>
100
110
  {item.link.type === 'external' ? (
101
- <a href={item.link.value} title={item.label} target="_blank" rel="noreferrer">
111
+ <a
112
+ href={item.link.value}
113
+ title={item.label}
114
+ target="_blank"
115
+ rel="noreferrer"
116
+ className="spotlights-gtm"
117
+ >
102
118
  {content(item)}
103
119
  </a>
104
120
  ) : (
105
- <Link to={item.link.value} title={item.label}>
121
+ <Link to={item.link.value} title={item.label} className="spotlights-gtm">
106
122
  {content(item)}
107
123
  </Link>
108
124
  )}
@@ -120,6 +136,7 @@ const Spotlights = ({ module, page }) => {
120
136
  targetBlank={item.link.type === 'external'}
121
137
  to={item.link.value}
122
138
  primaryColor={false}
139
+ gtmClass="spotlights-gtm btn-cta"
123
140
  />
124
141
  )}
125
142
  </div>
@@ -1,16 +1,10 @@
1
1
  .content {
2
2
  width: 100%;
3
- table{
4
- @include min(tablet){
5
- thead, tbody{
6
- display: table;
7
- width: 100%;
8
- table-layout: fixed;
9
- }
10
- }
3
+ div {
4
+ display: flow-root;
11
5
  }
12
- p{
13
- margin-bottom: 24px;
6
+ p:not(:last-of-type) {
7
+ margin-bottom: 2.4rem;
14
8
  }
15
9
  table {
16
10
  width: 100% !important;
@@ -20,7 +14,14 @@
20
14
  font-weight: 400;
21
15
  table-layout: auto;
22
16
  @include link-color(var(--color-6));
23
-
17
+ @include min(tablet) {
18
+ thead,
19
+ tbody {
20
+ display: table;
21
+ width: 100%;
22
+ table-layout: fixed;
23
+ }
24
+ }
24
25
  thead {
25
26
  tr {
26
27
  th {
@@ -54,6 +55,11 @@
54
55
  padding: 1rem;
55
56
  vertical-align: top;
56
57
  padding-left: 1.4rem;
58
+ a {
59
+ img {
60
+ width: 15rem;
61
+ }
62
+ }
57
63
  }
58
64
  }
59
65
 
@@ -102,17 +108,65 @@
102
108
  }
103
109
  }
104
110
 
111
+ .stackTable {
112
+ @include max(mobile) {
113
+ table {
114
+ border-collapse: inherit;
115
+ box-shadow: 0 2px 16px #17182f14;
116
+
117
+ thead {
118
+ display: none;
119
+ }
120
+
121
+ tbody {
122
+ tr {
123
+ &:first-child {
124
+ td {
125
+ color: var(--table-head-text);
126
+ background: var(--table-head-background);
127
+
128
+ border-radius: 0;
129
+
130
+ &:first-child {
131
+ border-top-left-radius: var(--table-border-radius);
132
+ border-top-right-radius: var(--table-border-radius);
133
+ }
134
+ }
135
+ }
136
+
137
+ td {
138
+ display: block;
139
+ text-align: left;
140
+ border-bottom: 1px solid #bfd3e5;
141
+ width: 100% !important;
142
+ }
143
+
144
+ &:last-child {
145
+ td {
146
+ border-radius: 0;
147
+ &:last-child {
148
+ border-bottom-right-radius: var(--table-border-radius);
149
+ border-bottom-left-radius: var(--table-border-radius);
150
+ border-bottom: none;
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
159
+
105
160
  .tableResponsive,
106
161
  .tableResponsive > div {
107
162
  box-sizing: content-box;
108
163
  width: 100%;
109
- table{
164
+ table {
110
165
  display: block;
111
166
  width: 100%;
112
167
  @include overflow(overflow-x, auto, touch);
113
- @include scrollbar(0.8rem, 0.8rem, var(--color-33));
114
-
115
168
  }
169
+ @include scrollbar(0.8rem, 0.8rem, var(--color-33));
116
170
 
117
171
  * {
118
172
  box-sizing: content-box;
@@ -121,7 +175,10 @@
121
175
  td,
122
176
  th {
123
177
  @include max(tablet) {
124
- min-width: 25rem;
178
+ min-width: 15rem;
179
+ }
180
+ img {
181
+ max-width: none;
125
182
  }
126
183
  }
127
184
  }
@@ -131,7 +188,7 @@
131
188
  color: var(--color-6);
132
189
  font-size: 1.6rem;
133
190
  list-style-position: inside;
134
- padding: 1.6rem;
191
+ padding: 0 1.6rem 1.6rem;
135
192
 
136
193
  li {
137
194
  margin: 0.35rem 0;
@@ -50,6 +50,8 @@ const Content = ({ module }) => {
50
50
  return `${styles.tableResponsive} ${styles.firstTable}`;
51
51
  case 'table_2':
52
52
  return `${styles.tableResponsive} ${styles.secondTable}`;
53
+ case 'stack_table':
54
+ return styles.stackTable;
53
55
  case 'default_table':
54
56
  return `${styles.tableResponsive}`;
55
57
  case 'content_frame_style':
@@ -25,7 +25,10 @@ const Footer = ({
25
25
  <div className={styles.topPart}>
26
26
  <div className={styles.links}>
27
27
  {footerMenu && showLinks && (
28
- <LinkList lists={getExtraField(section?.extra_fields, footerMenu)} />
28
+ <LinkList
29
+ lists={getExtraField(section?.extra_fields, footerMenu)}
30
+ gtmClass="mobile-menu-gtm"
31
+ />
29
32
  )}
30
33
  </div>
31
34
 
@@ -54,6 +57,7 @@ const Footer = ({
54
57
  imageOnly
55
58
  singleList
56
59
  lists={getExtraField(section?.extra_fields, footerLogos)}
60
+ gtmClass="mobile-menu-gtm logo-cta"
57
61
  />
58
62
  )}
59
63
  </div>
@@ -19,8 +19,13 @@ const Main = ({ section = {}, page = {}, pageContext = {}, showNewsletter = fals
19
19
  typeof window !== 'undefined' && Boolean(getURLParam('subscribed'))
20
20
  ? loadable(() => import(`../../../../components/atoms/newsletter/success`))
21
21
  : null;
22
+ const NotFound = page.path.includes('404')
23
+ ? loadable(() => import(`gatsby-core-theme/src/components/atoms/not-found`))
24
+ : null;
25
+
22
26
  return (
23
27
  <main className={styles.modulePage}>
28
+ {NotFound && <NotFound imagePath="404" />}
24
29
  {section.modules &&
25
30
  section.modules.map((module) => (
26
31
  <Module key={keygen()} module={module} page={page} pageContext={pageContext} />
@@ -28,7 +33,7 @@ const Main = ({ section = {}, page = {}, pageContext = {}, showNewsletter = fals
28
33
  {SearchPage && <SearchPage page={page} />}
29
34
  {showNewsletter && <Newsletter page={page} />}
30
35
  {NewsletterSuccess && showNewsletter && <NewsletterSuccess />}
31
- {page.author && <AuthorBox author={page.author} translations={page.translations} />}
36
+ {page.author && <AuthorBox author={page.author} />}
32
37
  </main>
33
38
  );
34
39
  };
@@ -109,9 +109,7 @@ const Modules = ({ module, page, pageContext }) => {
109
109
  module.name
110
110
  } ${styles.module} ${module?.style && styles[module.style]} module`}
111
111
  >
112
- {module.name !== 'top_list' && (
113
- <ModuleTitle module={module} translations={page?.translations} />
114
- )}
112
+ {module.name !== 'top_list' && <ModuleTitle module={module} />}
115
113
  <ModuleComponent module={module} page={page} pageContext={pageContext} {...extraProps} />
116
114
  </div>
117
115
  )
@@ -6,6 +6,10 @@ import { FaSearch } from 'react-icons/fa';
6
6
  // eslint-disable-next-line import/no-extraneous-dependencies
7
7
  import Tabs from 'gatsby-matrix-theme/src/hooks/tabs';
8
8
  import styles from 'gatsby-core-theme/src/components/molecules/search/search.module.scss';
9
+ import Link from 'gatsby-core-theme/src/hooks/link';
10
+ import { translate } from 'gatsby-core-theme/src/helpers/getters';
11
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
12
+
9
13
  import LazyImage from '~hooks/lazy-image';
10
14
  import ConditionalWrapper from '~atoms/conditional-wrapper';
11
15
  import { getURLParam } from '~helpers/getters';
@@ -52,6 +56,8 @@ const Search = ({
52
56
  const searchInputRef = useRef(React.createRef());
53
57
  const formBoxInputRef = useRef(React.createRef());
54
58
 
59
+ const { translations } = useContext(Context) || {};
60
+
55
61
  // Store search results, in case of page search with tabs it's a multidimensal array grouped by types
56
62
  const searchResultsRef = useRef([]);
57
63
  // Store the search function object
@@ -246,7 +252,7 @@ const Search = ({
246
252
  // Use a default or given close button
247
253
  if (formSearchOptionsCopy !== null && formSearchOptionsCopy.searchButtonComponent === undefined) {
248
254
  formSearchOptionsCopy.searchButtonComponent = (
249
- <button aria-label="Search" type="submit">
255
+ <button aria-label="Search" type="submit" className="search-gtm btn-cta">
250
256
  {searchIcon === null ? <FaSearch /> : <img alt="search" src={searchIcon} />}
251
257
  </button>
252
258
  );
@@ -270,6 +276,16 @@ const Search = ({
270
276
  {formSearchOptionsCopy.autoComplete && searchResultsRef.current.length > 0 && (
271
277
  <div className={styles.autocomplete}>
272
278
  {searchResultsRef.current.map((item) => getChildType(item, item.type))}
279
+ {formSearchOptionsCopy.showViewResultsText && (
280
+ <div className={styles.viewAllResults}>
281
+ <Link
282
+ to={`/${searchURLPageName}?${searchUrlParam}=${searchQuery}`}
283
+ className="search-gtm"
284
+ >
285
+ <h1>{translate(translations, 'view_all', 'View All Results')}</h1>
286
+ </Link>
287
+ </div>
288
+ )}
273
289
  </div>
274
290
  )}
275
291
  </form>
@@ -293,7 +309,7 @@ const Search = ({
293
309
  maxLength="60"
294
310
  />
295
311
  <div className={styles.searchButton}>
296
- <button aria-label="Search" type="submit">
312
+ <button aria-label="Search" type="submit" className="search-gtm btn-cta">
297
313
  {searchIcon === null ? <FaSearch /> : <img alt="search" src={searchIcon} />}
298
314
  </button>
299
315
  </div>
@@ -311,6 +327,7 @@ const Search = ({
311
327
  {...pageSearchOptionsCopy.tabsOptions}
312
328
  activeTabClass="searchActive"
313
329
  headerClass="searchHeader"
330
+ gtmClass="search-tabs-menu-gtm"
314
331
  >
315
332
  {items}
316
333
  </Tabs>
@@ -333,6 +350,7 @@ const Search = ({
333
350
  items,
334
351
  model_type: type,
335
352
  title: titleObj ? titleObj.title : '',
353
+ pagination_type: 'load_more',
336
354
  ...pageSearchOptionsCopy.archiveOptions.includeOptions,
337
355
  };
338
356
  }
@@ -354,7 +372,12 @@ const Search = ({
354
372
  module_title_tag: 'h2',
355
373
  }}
356
374
  />
357
- <Archive module={items} loadMore={loadMore} page={page} />
375
+ <Archive
376
+ module={items}
377
+ loadMore={loadMore}
378
+ page={page}
379
+ gtmClass="archive-gtm"
380
+ />
358
381
  </>
359
382
  )}
360
383
  </div>
@@ -2,12 +2,16 @@
2
2
  .link {
3
3
  word-break: inherit;
4
4
  white-space: nowrap;
5
-
6
5
  background-color: var(--color-7);
7
6
  padding: 1rem 2.5rem;
8
7
  border-radius: 0.6rem;
9
8
  color: #000;
10
9
  font-weight: 400;
10
+ @include flex-align(center, center);
11
+
12
+ svg {
13
+ margin-left: 1rem;
14
+ }
11
15
 
12
16
  &:hover {
13
17
  background-color: var(--secondary-color);
@@ -5,7 +5,13 @@ import keygen from '~helpers/keygen';
5
5
  import { anchorLink } from '~helpers/strings';
6
6
  import styles from './anchor.module.scss';
7
7
 
8
- function Anchor({ module: { items }, headerOffset = 80, sliderGap = 0, isFixed = false }) {
8
+ function Anchor({
9
+ module: { items },
10
+ headerOffset = 80,
11
+ sliderGap = 0,
12
+ isFixed = false,
13
+ icon = null,
14
+ }) {
9
15
  const [isFixedMenu, setIsFixedMenu] = useState(false);
10
16
  if (isFixed && typeof window !== 'undefined') {
11
17
  window.addEventListener('scroll', () => {
@@ -47,15 +53,17 @@ function Anchor({ module: { items }, headerOffset = 80, sliderGap = 0, isFixed =
47
53
  usePagination={false}
48
54
  settings={{ numberOfSlides: 0, sliderGap }}
49
55
  className={styles.sliderWrapper}
56
+ gtmClass="anchor-carousel-gtm"
50
57
  >
51
58
  {items?.map((anchor) => (
52
59
  <a
53
- className={styles.link}
60
+ className={`${styles.link} anchor-carousel-gtm anchor-menu-gtm`}
54
61
  key={keygen()}
55
62
  onClick={handleClick}
56
63
  href={`#${anchor.label && anchorLink(anchor?.label?.toLowerCase().trim())}`}
57
64
  >
58
65
  {anchor.label}
66
+ {icon}
59
67
  </a>
60
68
  ))}
61
69
  </Slider>
@@ -76,6 +84,7 @@ Anchor.propTypes = {
76
84
  sliderGap: PropTypes.number,
77
85
  styles: PropTypes.shape({}),
78
86
  isFixed: PropTypes.bool,
87
+ icon: PropTypes.element,
79
88
  };
80
89
 
81
90
  export default Anchor;
@@ -9,7 +9,7 @@ import Slide from '../../../../components/molecules/carousel/screenshot-slide';
9
9
 
10
10
  import styles from './carousel.module.scss';
11
11
 
12
- const Carousel = ({ module = {}, settings = {} }) => {
12
+ const Carousel = ({ module = {}, settings = {}, gtmClass = '' }) => {
13
13
  const [width] = useWindowSize();
14
14
  // render one item per slide
15
15
  const renderOne = (items) => {
@@ -17,7 +17,7 @@ const Carousel = ({ module = {}, settings = {} }) => {
17
17
  for (let i = 0; i < items.length; i += 1) {
18
18
  arr.push(
19
19
  <div key={keygen()} className={styles.carouselItem}>
20
- <Slide item={items[i]} />
20
+ <Slide item={items[i]} gtmClass={gtmClass} />
21
21
  </div>
22
22
  );
23
23
  }
@@ -30,11 +30,11 @@ const Carousel = ({ module = {}, settings = {} }) => {
30
30
  arr.push(
31
31
  <div className={styles.slide} key={keygen()}>
32
32
  <div key={keygen()} className={styles.carouselItem}>
33
- <Slide item={items[i]} />
33
+ <Slide item={items[i]} gtmClass={gtmClass} />
34
34
  </div>
35
35
  {items[i + 1] && (
36
36
  <div key={keygen()} className={styles.carouselItem}>
37
- <Slide item={items[i + 1]} />
37
+ <Slide item={items[i + 1]} gtmClass={gtmClass} />
38
38
  </div>
39
39
  )}
40
40
  </div>
@@ -46,12 +46,22 @@ const Carousel = ({ module = {}, settings = {} }) => {
46
46
  return (
47
47
  <div className={styles.carouselContainer}>
48
48
  {width >= 991 && (
49
- <Slider {...settings} className={styles.screenshotCarousel} useArrows={false}>
49
+ <Slider
50
+ {...settings}
51
+ className={styles.screenshotCarousel}
52
+ useArrows={false}
53
+ gtmClass={gtmClass}
54
+ >
50
55
  {renderTwo(module.items)}
51
56
  </Slider>
52
57
  )}
53
58
  {width < 991 && width > 0 && (
54
- <Slider {...settings} className={styles.screenshotCarousel} useArrows={false}>
59
+ <Slider
60
+ {...settings}
61
+ className={styles.screenshotCarousel}
62
+ useArrows={false}
63
+ gtmClass={gtmClass}
64
+ >
55
65
  {renderOne(module.items)}
56
66
  </Slider>
57
67
  )}
@@ -72,6 +82,7 @@ Carousel.propTypes = {
72
82
  }),
73
83
  settings: PropTypes.shape(PropTypes.object),
74
84
  styles: PropTypes.object,
85
+ gtmClass: PropTypes.string,
75
86
  };
76
87
 
77
88
  export default Carousel;
@@ -60,12 +60,12 @@ const Navigation = ({
60
60
  >
61
61
  <nav className={styles.nav} style={{ justifyContent: logoPosition }} ref={navRef}>
62
62
  <NavigationProvider>
63
- <Link className={styles.logo} to="/" onClick={onClickHandler}>
63
+ <Link className={`${styles.logo} main-menu-gtm logo-cta`} to="/" onClick={onClickHandler}>
64
64
  <img alt={getSiteName()} src={logo} width={logoWidth} height={logoHeight} />
65
65
  </Link>
66
66
  {showMenu && (
67
67
  <>
68
- <Menu section={section} menu={menu} options={options} />
68
+ <Menu section={section} menu={menu} options={options} gtmClass="main-menu-gtm" />
69
69
  {hasSearch && <SearchForm className={styles.search} searchIcon={searchIcon} />}
70
70
  </>
71
71
  )}