gatsby-core-theme 30.0.56 → 30.0.58

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 (30) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/gatsby-node.mjs +1 -1
  3. package/package.json +1 -1
  4. package/src/components/atoms/scroll-to-top/index.js +3 -49
  5. package/src/components/atoms/scroll-to-top/scroll-to-top.module.scss +1 -41
  6. package/src/components/molecules/bonus/template-two/bonus.module.scss +4 -8
  7. package/src/components/molecules/bonus/template-two/index.js +12 -18
  8. package/src/components/molecules/carousel/default-slide/index.js +6 -4
  9. package/src/components/molecules/content/index.js +1 -0
  10. package/src/components/molecules/menu/index.js +1 -3
  11. package/src/components/molecules/pagination/index.js +1 -1
  12. package/src/components/molecules/spotlights_v2/image/template-two/index.js +1 -1
  13. package/src/components/molecules/spotlights_v2/image-text/template-one/index.js +6 -4
  14. package/src/components/molecules/spotlights_v2/image-text/template-one/template-one.module.scss +11 -5
  15. package/src/components/molecules/spotlights_v2/image-text/template-three/item/index.js +8 -6
  16. package/src/components/molecules/spotlights_v2/image-text/template-three/item/style.module.scss +31 -26
  17. package/src/components/molecules/spotlights_v2/image-text/template-two/index.js +6 -4
  18. package/src/components/molecules/spotlights_v2/image-text/template-two/template-two.module.scss +10 -6
  19. package/src/components/molecules/star-rating/one-star.js +1 -1
  20. package/src/components/organisms/cookie-consent/cookie-consent.module.scss +3 -12
  21. package/src/components/organisms/cookie-consent/cookie-consent.test.js +1 -5
  22. package/src/components/organisms/cookie-consent/index.js +5 -14
  23. package/src/components/organisms/form/form.module.scss +4 -21
  24. package/src/components/organisms/form/index.js +2 -3
  25. package/src/components/pages/body/body.module.scss +11 -0
  26. package/src/components/pages/body/index.js +17 -11
  27. package/src/components/pages/tracker/index-ssr.js +1 -2
  28. package/src/components/pages/tracker/index.js +1 -2
  29. package/src/context/MainProvider.js +0 -6
  30. package/src/styles/utils/variables/_main.scss +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,41 @@
1
+ ## [30.0.58](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.57...v30.0.58) (2024-01-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * cookie consent ([0e6fa43](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0e6fa43da500b195bfeec7f5c4ea8df44eeb711b))
7
+ * removed gap ([325589d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/325589dc50551a287837564b11257a408df00047))
8
+
9
+
10
+ ### Code Refactoring
11
+
12
+ * hide arrow on image mode template two for spotlights if link is not added ([e744e09](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e744e09a1f7df152709a576c65461cf62c1370d6))
13
+
14
+
15
+ * Merge branch 'tm-3950-spotlights' into 'master' ([9707c5c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9707c5c786fe0ab7f7fd764c4d7efc466b1f47b1))
16
+ * Merge branch 'tm-3981-grouping-bottom-page' into 'master' ([0da1509](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0da150983e5a437722ed767dba318ee1729badf6))
17
+
18
+ ## [30.0.57](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.56...v30.0.57) (2024-01-19)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * carousel item ([5d6429c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5d6429c3bdaff2ce76d73cc740ce3b905774e9bf))
24
+ * contact-form ([6b11b39](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6b11b39eb067e9078b3c9174908e4a7edc75d957))
25
+ * grouped Scroll to Top - Cookie Consent - Operator Banner ([5478d44](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5478d44bd6a399adf5a3d80bb6497e7820eabf6f))
26
+ * remove global states for cookie and banner and fixed tests ([950f798](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/950f7986d3bc525f21112477d8e4c8e76b975313))
27
+ * revert changes ([f7bd71f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f7bd71fa1ad948490846988ac2992d6ef2964612))
28
+ * slider image width and height ([148d36f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/148d36f661c976c8f22c00932e719abec8fad67a))
29
+ * slider image width and height ([9423297](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/94232974a3a94115034807ec885bd16202f8804e))
30
+ * translations moved to page context ([dfb6d3c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/dfb6d3c8275601081202a65972f1e1109a96474f))
31
+ * update carousel ([c471cce](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c471cce2a17e0037a4e1219be3b5d1fefc1f4aea))
32
+
33
+
34
+ * Merge branch 'irishluck-pre-launch-fix' into 'master' ([5dfedc3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5dfedc3972f6f8a312e4ddd06009dc60d3655bf6))
35
+ * Merge branch 'irishluck-pre-launch-fix' into 'master' ([4f076e2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4f076e20363c11fda4eebdc971d9f52d54b95511))
36
+ * Merge branch 'tm-3981-grouping-bottom-page' into 'master' ([a2ec654](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a2ec65494f02d2c6e56dcf432b22f1302cb68b4c))
37
+ * Merge branch 'contact-form' into 'master' ([313309b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/313309bd8335e79d9c041f3d341a5e84f475ba48))
38
+
1
39
  ## [30.0.56](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.55...v30.0.56) (2024-01-18)
2
40
 
3
41
 
package/gatsby-node.mjs CHANGED
@@ -430,7 +430,6 @@ export const createPages = async ({ actions: { createPage } }, themeOptions) =>
430
430
  title: 'Tracker',
431
431
  relation_type: 'page',
432
432
  language: languageKey,
433
- translations: processed.relations.translations[marketOperator],
434
433
  path: trackerPath,
435
434
  meta_robots: ['noindex', 'nofollow'],
436
435
  };
@@ -439,6 +438,7 @@ export const createPages = async ({ actions: { createPage } }, themeOptions) =>
439
438
  component: trackerComp,
440
439
  context: {
441
440
  page: trackerPageObject,
441
+ translations: processed.relations.translations[marketOperator],
442
442
  siteInfo,
443
443
  operator,
444
444
  isTracker: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.56",
3
+ "version": "30.0.58",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -1,74 +1,28 @@
1
1
  /* eslint-disable react-hooks/exhaustive-deps */
2
- import React, { useContext, useEffect, useState, useRef } from 'react';
2
+ import React, { useRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import isSticky from '~hooks/stickyOnScroll';
5
- import { Context } from '~context/MainProvider';
6
4
  import styles from './scroll-to-top.module.scss';
7
5
 
8
- const ScrollToTop = ({ scrollTo = '0', offsetTop = 400, hideOnScrollDown = false }) => {
9
- const { cookieAccepted, bannerIsActive } = useContext(Context) || {};
10
- const [show, setShow] = useState(false);
11
- let scrollY = typeof window !== 'undefined' && (window?.scrollY || 0);
12
- const showScroll = isSticky(offsetTop);
6
+ const ScrollToTop = ({ scrollTo = '0' }) => {
13
7
  const scrollToTopBtn = useRef();
14
8
 
15
9
  const scrollTop = () => {
16
10
  window.scrollTo({ top: scrollTo, behavior: 'smooth' });
17
11
  };
18
12
 
19
- const handleEvent = () => {
20
- if (window.scrollY > scrollY) {
21
- setShow(false);
22
- } else {
23
- setShow(true);
24
- }
25
- const scrollTopBtnHeight = parseInt(scrollToTopBtn.current.clientHeight / 2);
26
- const footerElementRect =
27
- document.querySelector('footer') && document.querySelector('footer').getBoundingClientRect();
28
-
29
- if (footerElementRect) {
30
- if (footerElementRect.y < window.innerHeight) {
31
- scrollToTopBtn.current.style.bottom = `${
32
- window.innerHeight - footerElementRect.y - scrollTopBtnHeight
33
- }px`;
34
- } else {
35
- scrollToTopBtn.current.style.bottom = '0px';
36
- }
37
- }
38
-
39
- scrollY = window.scrollY;
40
- };
41
-
42
- useEffect(() => {
43
- window.addEventListener('scroll', handleEvent);
44
- window.addEventListener('mousemove', handleEvent);
45
- window.addEventListener('touchstart', handleEvent);
46
-
47
- return () => {
48
- window.removeEventListener('scroll', handleEvent);
49
- window.removeEventListener('mousemove', handleEvent);
50
- window.removeEventListener('touchstart', handleEvent);
51
- };
52
- }, []);
53
-
54
13
  return (
55
14
  <button
56
15
  type="button"
57
16
  aria-label="Scroll to top"
58
17
  onClick={(e) => scrollTop(e)}
59
18
  ref={scrollToTopBtn}
60
- className={`${styles.scrollToTop || ''} ${cookieAccepted && (styles.cookieAccepted || '')} ${
61
- !bannerIsActive && (styles.closedBanner || '')
62
- } ${!show && hideOnScrollDown && (styles?.showScrollToTopButton || '')}`}
63
- style={{ display: showScroll ? 'flex' : 'none' }}
19
+ className={styles.scrollToTop}
64
20
  />
65
21
  );
66
22
  };
67
23
 
68
24
  ScrollToTop.propTypes = {
69
25
  scrollTo: PropTypes.string,
70
- offsetTop: PropTypes.number,
71
- hideOnScrollDown: PropTypes.bool,
72
26
  };
73
27
 
74
28
  export default ScrollToTop;
@@ -1,9 +1,3 @@
1
- body[data-scroll='0'] {
2
- .scrollToTop {
3
- opacity: 0;
4
- }
5
- }
6
-
7
1
  .showScrollToTopButton {
8
2
  @include max(mobile) {
9
3
  display: none !important;
@@ -18,9 +12,7 @@ body[data-scroll='0'] {
18
12
  width: 64px;
19
13
  height: 64px;
20
14
  text-align: center;
21
- bottom: 47rem;
22
- position: fixed;
23
- right: 0;
15
+ margin-left: auto;
24
16
 
25
17
  &:before {
26
18
  @include arrow(#000, 2rem, up, false);
@@ -28,36 +20,4 @@ body[data-scroll='0'] {
28
20
  bottom: calc(50% - 1.25rem);
29
21
  left: calc(50% - 1rem);
30
22
  }
31
-
32
- &.cookieAccepted {
33
- bottom: 25rem;
34
-
35
- &.closedBanner {
36
- bottom: 0;
37
- }
38
-
39
- @include min(tablet) {
40
- bottom: 11rem;
41
- }
42
- }
43
-
44
- &.closedBanner {
45
- bottom: 22rem;
46
-
47
- @include min(tablet) {
48
- bottom: 16.2rem;
49
- }
50
-
51
- @include min(laptop) {
52
- bottom: 7.4rem;
53
- }
54
- }
55
-
56
- @include min(tablet) {
57
- bottom: 27.2rem;
58
- }
59
-
60
- @include min(laptop) {
61
- bottom: 18.4rem;
62
- }
63
23
  }
@@ -1,14 +1,10 @@
1
1
  .operatorBanner {
2
2
  width: 100%;
3
- bottom: 0;
4
3
  padding: 1.6rem 1.6rem 2.4rem 1.6rem;
5
- position: fixed;
6
4
  z-index: var(--cookie-consent-index);
7
5
  border-top: 1.5px solid var(--operator-banner-sticky-border-color, #515156);
8
6
  background: var(--operator-banner-sticky-backgorund, #1b1b1c);
9
7
  box-shadow: 0px 4px 12px 0px rgba(27, 27, 28, 0.08);
10
- left: 0;
11
- right: 0;
12
8
 
13
9
  @include min(tablet) {
14
10
  padding: 1.6rem;
@@ -151,8 +147,8 @@
151
147
 
152
148
  .closeBtn {
153
149
  position: absolute;
154
- right: 0;
155
- top: 0;
150
+ right: -1rem;
151
+ top: -1rem;
156
152
  background-color: #3c3c40;
157
153
  @include min(tablet) {
158
154
  width: 2rem;
@@ -169,7 +165,7 @@
169
165
  left: 0;
170
166
  right: 0;
171
167
  transition: all 1s;
172
- bottom: -10rem;
168
+ margin-bottom: -10rem;
173
169
  margin-left: auto;
174
170
  margin-right: auto;
175
171
  padding: 0.8rem 1.6rem;
@@ -182,7 +178,7 @@
182
178
  }
183
179
 
184
180
  .show {
185
- bottom: 1rem;
181
+ margin-bottom: 0;
186
182
  }
187
183
 
188
184
  .tncEnable {
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable camelcase */
2
- import React, { useState, useEffect, useContext } from 'react';
2
+ import React, { useState, useContext } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
5
5
  import { IoMdClose } from '@react-icons/all-files/io/IoMdClose';
@@ -29,7 +29,7 @@ export default function TemplateOne({
29
29
  }) {
30
30
  const [show, setShow] = useState(showOnLoad);
31
31
  const [closed, setClosed] = useState(false);
32
- const { cookieAccepted, setBannerActive, translations } = useContext(Context) || {};
32
+ const { translations } = useContext(Context) || {};
33
33
  const { standardised_logo_url, logo_url, bonus, name } = operator || {};
34
34
  const logo = standardised_logo_url || logo_url;
35
35
 
@@ -41,12 +41,8 @@ export default function TemplateOne({
41
41
  defaultValue: 'Play',
42
42
  },
43
43
  };
44
- // eslint-disable-next-line no-unused-expressions
44
+
45
45
  isSticky(stickyOffset, setShow);
46
- useEffect(() => {
47
- // eslint-disable-next-line no-unused-expressions
48
- setBannerActive(show);
49
- });
50
46
 
51
47
  const clickHandler = () => {
52
48
  setShow(false);
@@ -57,10 +53,8 @@ export default function TemplateOne({
57
53
  !closed && (
58
54
  <div
59
55
  className={`${styles.operatorBanner || ''} ${show && styles.show} ${
60
- cookieAccepted && (styles.cookieAccepted || '')
61
- } ${tncEnable ? styles.tncEnable : ''} ${showTncFixed ? styles.showTncFixed || '' : ''} ${
62
- floating ? styles.floating : ''
63
- }
56
+ tncEnable ? styles.tncEnable : ''
57
+ } ${showTncFixed ? styles.showTncFixed || '' : ''} ${floating ? styles.floating : ''}
64
58
  `}
65
59
  >
66
60
  <div className={styles.container}>
@@ -106,14 +100,14 @@ export default function TemplateOne({
106
100
  translationsObj={translationsObj}
107
101
  />
108
102
  {showTncFixed && <Tnc hasCollapse={false} operator={operator} />}
103
+ <IoMdClose
104
+ className={`${styles.closeBtn || ''}`}
105
+ onClick={clickHandler}
106
+ fontSize={16}
107
+ color="#ffffff"
108
+ title="Close Icon"
109
+ />
109
110
  </div>
110
- <IoMdClose
111
- className={`${styles.closeBtn || ''}`}
112
- onClick={clickHandler}
113
- fontSize={16}
114
- color="#ffffff"
115
- title="Close Icon"
116
- />
117
111
  </div>
118
112
  )
119
113
  );
@@ -9,7 +9,7 @@ import styles from './default-slide.module.scss';
9
9
 
10
10
  const Slide = ({
11
11
  item = {},
12
- imageSizes = { width: null, height: 930 },
12
+ imageSizes = { width: 675, height: 930 },
13
13
  slideTitle = '',
14
14
  hideCaptions = false,
15
15
  }) => {
@@ -21,9 +21,13 @@ const Slide = ({
21
21
  className={styles.image || ''}
22
22
  src={imagePrettyUrl(item.image, imageSizes.width, imageSizes.height)}
23
23
  alt={getAltText(item?.image_object, item.title || slideTitle)}
24
+ width={imageSizes.width}
25
+ height={imageSizes.height}
24
26
  />
25
27
  )}
26
- {item.content && <p className={styles.content || ''}>{item.content}</p>}
28
+ {item.content && (
29
+ <div className={styles.content || ''} dangerouslySetInnerHTML={{ __html: item.content }} />
30
+ )}
27
31
  {item.label && <span className={styles.label}>{item.label}</span>}
28
32
  </>
29
33
  );
@@ -38,8 +42,6 @@ Slide.propTypes = {
38
42
  secondary_action: PropTypes.string,
39
43
  label: PropTypes.string,
40
44
  }),
41
- primaryBtnText: PropTypes.string,
42
- secondaryBtnText: PropTypes.string,
43
45
  hideCaptions: PropTypes.bool,
44
46
  imageSizes: PropTypes.shape({ width: PropTypes.any, height: PropTypes.any }),
45
47
  slideTitle: PropTypes.string,
@@ -71,6 +71,7 @@ const Content = ({
71
71
  </button>
72
72
 
73
73
  {showMore &&
74
+ module.show_more_content &&
74
75
  mainContent(
75
76
  module.show_more_content,
76
77
  isContentCollapsible ? styles.contentCollapsibleBox : ''
@@ -6,7 +6,6 @@ import Items from '~atoms/menu/items';
6
6
  import MenuIcon from '~atoms/menu/menu-icon';
7
7
 
8
8
  import { NavigationContext } from '~organisms/navigation/navigationContext';
9
- import { Context } from '~context/MainProvider';
10
9
 
11
10
  import styles from './menu.module.scss';
12
11
  import keygen from '~helpers/keygen';
@@ -28,7 +27,6 @@ const Menu = ({
28
27
  const menuListRef = useRef(React.createRef());
29
28
 
30
29
  const { setShowSearch, setShowMenu, showMenu, showSearch } = useContext(NavigationContext);
31
- const { cookieAccepted } = useContext(Context) || false;
32
30
 
33
31
  if (section.modules) {
34
32
  menuObject = getMenuObj(section.modules, menu);
@@ -58,7 +56,7 @@ const Menu = ({
58
56
  ref={menuListRef}
59
57
  className={`${menuListClasses || ''} ${showMenu && (styles.show || '')} ${
60
58
  styles[customStyles] || ''
61
- } ${cookieAccepted ? styles.cookieAccepted || '' : ''}`}
59
+ }`}
62
60
  role="menu"
63
61
  >
64
62
  {menuObject &&
@@ -246,7 +246,7 @@ const Pagination = ({
246
246
  Pagination.propTypes = {
247
247
  currentPage: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
248
248
  pagePath: PropTypes.string.isRequired,
249
- totalPages: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
249
+ totalPages: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
250
250
  nextComp: PropTypes.oneOfType([PropTypes.element, PropTypes.any]),
251
251
  previousComp: PropTypes.oneOfType([PropTypes.element, PropTypes.any]),
252
252
  firstComp: PropTypes.oneOfType([PropTypes.element, PropTypes.any]),
@@ -16,7 +16,7 @@ export default function TemplateOne({ module }) {
16
16
  {res?.image && <LazyImage src={imagePrettyUrl(res?.image)} />}
17
17
  <p>
18
18
  {res?.link_text || translate(translations, 'link_text_spotlights', 'Top Online Casinos')}{' '}
19
- <FaArrowRight size={20} color="#fff" />
19
+ {res.link?.value && <FaArrowRight size={20} color="#fff" />}
20
20
  </p>
21
21
  {res.subtitle && <span>{res.subtitle}</span>}
22
22
  </>
@@ -30,10 +30,12 @@ export default function TemplateOne({
30
30
  )}
31
31
  {res?.label && <TitleTag>{res.label}</TitleTag>}
32
32
  {res.subtitle && <span>{res.subtitle}</span>}
33
- <div
34
- className={`${styles.desc} ${scrollableContent ? styles.scroll : ''}`}
35
- dangerouslySetInnerHTML={{ __html: res?.text }}
36
- />
33
+ {res?.text && (
34
+ <div
35
+ className={`${styles.desc} ${scrollableContent ? styles.scroll : ''}`}
36
+ dangerouslySetInnerHTML={{ __html: res?.text }}
37
+ />
38
+ )}
37
39
  </div>
38
40
 
39
41
  {res?.link?.value && (
@@ -4,11 +4,13 @@
4
4
  @include flex-direction(column);
5
5
  @include flex-align(center, center);
6
6
  gap: 1.6rem;
7
+
7
8
  @include min(tablet) {
8
9
  display: grid;
9
10
  grid-template-columns: repeat(3, 1fr);
10
11
  }
11
12
  }
13
+
12
14
  .item {
13
15
  border-radius: 1.6rem;
14
16
  background: var(--spotlight-template-one-backgorund-image-text-mode, #fff);
@@ -18,16 +20,19 @@
18
20
  padding: 1.6rem;
19
21
  gap: 1.6rem;
20
22
  @include flex-direction(column);
21
- @include flex-align(start, space-between);
23
+ @include flex-align(stretch, space-between);
24
+
22
25
  > a {
23
26
  min-height: 5.6rem;
24
27
  width: 100%;
25
28
  white-space: normal;
26
29
  }
27
30
  }
31
+
28
32
  .topSection {
29
33
  @include flex-direction(column);
30
34
  gap: 1.6rem;
35
+
31
36
  > img {
32
37
  width: 100%;
33
38
  height: 17.6rem;
@@ -36,7 +41,6 @@
36
41
  margin-bottom: 0.8rem;
37
42
  }
38
43
 
39
-
40
44
  a > label,
41
45
  a > span,
42
46
  a > h1,
@@ -58,7 +62,7 @@
58
62
  }
59
63
 
60
64
  .desc {
61
- color: var(--uspotlight-template-one-desc-image-text-mode, #515156);
65
+ color: var(--spotlight-template-one-desc-image-text-mode, #515156);
62
66
  text-align: justify;
63
67
  font-size: 1.6rem;
64
68
  font-style: normal;
@@ -68,9 +72,10 @@
68
72
  }
69
73
 
70
74
  .scroll {
71
- height: 18rem;
72
- overflow-y: scroll;
75
+ max-height: 18rem;
76
+ overflow-y: auto;
73
77
  padding-right: 1.6rem;
78
+
74
79
  &::-webkit-scrollbar {
75
80
  width: .6rem;
76
81
  }
@@ -89,6 +94,7 @@
89
94
  background: #555;
90
95
  }
91
96
  }
97
+
92
98
  .scrollContent{
93
99
  padding: 2.4rem;
94
100
  }
@@ -27,12 +27,14 @@ export default function TemplateOne({
27
27
  <div className={styles.topSection}>
28
28
  {item?.image && <LazyImage width={104} height={104} src={imagePrettyUrl(item?.image)} />}
29
29
  {item?.label && <TitleTag>{item?.label}</TitleTag>}
30
- <div
31
- className={`${styles.desc} ${scrollableContent ? styles.scroll : ''} ${
32
- readMore && !scrollableContent && !showMore ? styles.readMore : ''
33
- }`}
34
- dangerouslySetInnerHTML={{ __html: item?.text }}
35
- />
30
+ {item?.text && (
31
+ <div
32
+ className={`${styles.desc} ${scrollableContent ? styles.scroll : ''} ${
33
+ readMore && !scrollableContent && !showMore ? styles.readMore : ''
34
+ }`}
35
+ dangerouslySetInnerHTML={{ __html: item?.text }}
36
+ />
37
+ )}
36
38
  {readMore && !scrollableContent && (
37
39
  <span onClick={() => setShowMore(!showMore)} className={styles.readMoreBtn}>
38
40
  {!showMore ? (
@@ -2,30 +2,33 @@
2
2
  @include flex-direction(column);
3
3
  @include flex-align(center, center);
4
4
  gap: 0.8rem;
5
+
5
6
  @include min(tablet) {
6
7
  display: grid;
7
8
  grid-template-columns: repeat(2, auto);
8
- align-items: flex-start;
9
9
  }
10
+
10
11
  > img {
11
12
  width: 8rem;
12
13
  height: 8rem;
13
14
  object-fit: cover;
14
15
  border-radius: 100%;
15
16
  margin-bottom: 1.6rem;
17
+
16
18
  @include min(tablet) {
17
- grid-column: 1/2;
18
- grid-row: 1/5;
19
+ grid-row: 1 / span 2;
20
+ grid-column: 1;
19
21
  width: 12rem;
20
22
  height: 12rem;
21
- margin-top: 4rem;
22
- margin-right: 2.4rem;
23
+ margin: 0;
23
24
  }
25
+
24
26
  @include min(laptop){
25
27
  width: 12.6rem;
26
28
  height: 12.6rem;
27
29
  }
28
30
  }
31
+
29
32
  > label {
30
33
  color: var(--spotlight-template-two-label-image-text-mode, #1b1b1c);
31
34
  font-size: 1.8rem;
@@ -33,19 +36,23 @@
33
36
  font-weight: 700;
34
37
  line-height: 2.8rem;
35
38
  text-transform: capitalize;
39
+
36
40
  @include min(tablet) {
37
- grid-column: 2/3;
38
- grid-row: 1/2;
39
41
  font-size: 2.2rem;
40
42
  line-height: 3rem;
43
+ grid-column: 2;
41
44
  }
42
45
  }
46
+
43
47
  > h2,
44
48
  h3,
45
49
  h4 {
50
+ font-size: 2.2rem;
51
+ font-weight: 700;
52
+ line-height: 3rem;
53
+
46
54
  @include min(tablet) {
47
- grid-column: 2/3;
48
- grid-row: 1/2;
55
+ grid-column: 2;
49
56
  }
50
57
  }
51
58
  }
@@ -58,9 +65,9 @@
58
65
  font-weight: 700;
59
66
  line-height: 2.2rem;
60
67
  margin-bottom: 1.6rem;
68
+
61
69
  @include min(tablet) {
62
- grid-column: 2/3;
63
- grid-row: 2/3;
70
+ grid-column: 2;
64
71
  }
65
72
  }
66
73
 
@@ -74,6 +81,7 @@
74
81
  gap: 1.6rem;
75
82
  @include flex-direction(column);
76
83
  @include flex-align(start, space-between);
84
+
77
85
  > a {
78
86
  height: 5.6rem;
79
87
  width: 100%;
@@ -81,33 +89,29 @@
81
89
  }
82
90
 
83
91
  .desc {
84
- color: var(--uspotlight-template-one-desc-image-text-mode, #515156);
92
+ color: var(--spotlight-template-one-desc-image-text-mode, #515156);
85
93
  text-align: justify;
86
94
  font-size: 1.6rem;
87
95
  font-style: normal;
88
96
  font-weight: 400;
89
97
  line-height: 2.7rem;
90
98
  margin-bottom: 0.8rem;
91
- @include min(tablet){
92
- grid-column: 2/3;
93
- grid-row: 2/3;
94
- }
95
99
 
100
+ @include min(tablet) {
101
+ grid-column: 2;
102
+ }
96
103
  }
97
104
 
98
105
  .readMore {
99
106
  height: 13.5rem;
100
107
  overflow: hidden;
101
- @include min(tablet){
102
- grid-column: 2/3;
103
- grid-row: 2/3;
104
- }
105
108
  }
106
109
 
107
110
  .scroll {
108
- height: 16.2rem;
109
- overflow-y: scroll;
111
+ max-height: 16.2rem;
112
+ overflow-y: auto;
110
113
  padding-right: 1.6rem;
114
+
111
115
  &::-webkit-scrollbar {
112
116
  width: 0.6rem;
113
117
  }
@@ -137,11 +141,12 @@
137
141
  font-weight: 600;
138
142
  line-height: 2.7rem;
139
143
  cursor: pointer;
140
- @include min(tablet){
141
- grid-column: 2/3;
142
- grid-row: 3/4;
143
- }
144
+
144
145
  > svg {
145
146
  margin-left: 0.4rem;
146
147
  }
148
+
149
+ @include min(tablet) {
150
+ grid-column: 2;
151
+ }
147
152
  }
@@ -30,10 +30,12 @@ export default function TemplateOne({
30
30
  )}
31
31
  {res?.label && <TitleTag>{res.label}</TitleTag>}
32
32
  {res.subtitle && <span>{res.subtitle}</span>}
33
- <div
34
- className={`${styles.desc} ${scrollableContent ? styles.scroll : ''}`}
35
- dangerouslySetInnerHTML={{ __html: res?.text }}
36
- />
33
+ {res?.text && (
34
+ <div
35
+ className={`${styles.desc} ${scrollableContent ? styles.scroll : ''}`}
36
+ dangerouslySetInnerHTML={{ __html: res?.text }}
37
+ />
38
+ )}
37
39
  </div>
38
40
  {res?.link?.value && (
39
41
  <Button
@@ -4,11 +4,13 @@
4
4
  @include flex-direction(column);
5
5
  @include flex-align(center, center);
6
6
  gap: 1.6rem;
7
+
7
8
  @include min(tablet) {
8
9
  display: grid;
9
10
  grid-template-columns: repeat(3, 1fr);
10
11
  }
11
12
  }
13
+
12
14
  .item {
13
15
  border-radius: 1.6rem;
14
16
  background: var(--spotlight-template-two-backgorund-image-text-mode, #fff);
@@ -18,17 +20,20 @@
18
20
  padding: 2.4rem;
19
21
  gap: 1.6rem;
20
22
  @include flex-direction(column);
21
- @include flex-align(start, space-between);
23
+ @include flex-align(stretch, space-between);
24
+
22
25
  > a {
23
26
  min-height: 5.6rem;
24
27
  width: 100%;
25
28
  white-space: normal;
26
29
  }
27
30
  }
31
+
28
32
  .topSection {
29
33
  @include flex-direction(column);
30
34
  @include flex-align(center, center);
31
35
  gap: .8rem;
36
+
32
37
  > img {
33
38
  width: 10.4rem;
34
39
  height: 10.4rem;
@@ -37,7 +42,6 @@
37
42
  margin-bottom: 1.6rem;
38
43
  }
39
44
 
40
-
41
45
  a > label,
42
46
  a > span,
43
47
  a > h1,
@@ -57,7 +61,6 @@
57
61
  text-align: center;
58
62
  }
59
63
 
60
-
61
64
  a > span, > span {
62
65
  color: #64646d;
63
66
  text-align: center;
@@ -70,7 +73,7 @@
70
73
  }
71
74
 
72
75
  .desc {
73
- color: var(--uspotlight-template-one-desc-image-text-mode, #515156);
76
+ color: var(--spotlight-template-one-desc-image-text-mode, #515156);
74
77
  text-align: justify;
75
78
  font-size: 1.6rem;
76
79
  font-style: normal;
@@ -80,9 +83,10 @@
80
83
  }
81
84
 
82
85
  .scroll {
83
- height: 18rem;
84
- overflow-y: scroll;
86
+ max-height: 18rem;
87
+ overflow-y: auto;
85
88
  padding-right: 1.6rem;
89
+
86
90
  &::-webkit-scrollbar {
87
91
  width: .6rem;
88
92
  }
@@ -28,7 +28,7 @@ const OneStar = ({
28
28
  };
29
29
 
30
30
  OneStar.propTypes = {
31
- numOfStars: PropTypes.oneOf([5, 10]).isRequired,
31
+ numOfStars: PropTypes.oneOf([5, 10]),
32
32
  rating: PropTypes.oneOfType([PropTypes.array, PropTypes.number, PropTypes.string]).isRequired,
33
33
  active: PropTypes.bool,
34
34
  showLabel: PropTypes.bool,
@@ -6,22 +6,13 @@
6
6
  padding: 1.7rem 0;
7
7
  box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.15);
8
8
 
9
- &.bottom {
10
- bottom: 0;
11
- left: 0;
12
- }
13
-
14
- &.top {
15
- top: 0;
16
- left: 0;
17
- }
18
-
19
9
  > div {
20
- @include flex-align(flex-start, space-between);
10
+ @include flex-align(center, center);
21
11
  flex-direction: column;
22
12
  padding: 0rem 1.6rem;
23
-
13
+ gap: 1rem;
24
14
  @include min(tablet) {
15
+ @include flex-align(flex-start, flex-end);
25
16
  flex-direction: row;
26
17
  align-items: center;
27
18
  padding: 0rem 2.3rem !important;
@@ -22,7 +22,7 @@ function renderComponent() {
22
22
  cookieAccepted: true,
23
23
  }}
24
24
  >
25
- <CookieConsent acceptText="Accept Me" declineText="Decline Me" declineURL="/" location="top">
25
+ <CookieConsent acceptText="Accept Me" declineText="Decline Me" declineURL="/">
26
26
  {children}
27
27
  </CookieConsent>
28
28
  </MainProvider>
@@ -47,10 +47,6 @@ describe('cookie consent component', () => {
47
47
  expect(getByText('Accept Me')).toBeTruthy();
48
48
  expect(getByText('Decline Me')).toBeTruthy();
49
49
  });
50
- test('Location', () => {
51
- const { container } = renderComponent();
52
- expect(container.querySelector('div.top')).toBeTruthy();
53
- });
54
50
  test('Hide on accept', () => {
55
51
  const { container, getByText } = renderComponent();
56
52
  const btn = getByText('Accept Me');
@@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
4
4
  import { navigate } from 'gatsby';
5
5
  import Modal from 'gatsby-core-theme/src/hooks/modal';
6
6
  import { ModalContext } from 'gatsby-core-theme/src/hooks/modal/modalContext';
7
- import Sticky from '~molecules/sticky';
8
7
  import Button from '~atoms/button/button';
9
8
  import { translate } from '~helpers/getters';
10
9
  import { Context } from '~context/MainProvider';
@@ -16,22 +15,15 @@ const CookieConsent = ({
16
15
  settingsCookie = false,
17
16
  declineText = 'Decline',
18
17
  declineURL = '#',
19
- location = 'bottom',
20
18
  children,
21
19
  }) => {
22
20
  const cookieName = 'CookieConsent';
23
21
  // states
24
- const [ck, setCk] = useState(true);
25
- // when component did mount or state has updated
22
+ const [ck, setCk] = useState(
23
+ (typeof window !== `undefined` && getCookie(cookieName) === 'true') || false
24
+ );
26
25
  const { showModal } = useContext(ModalContext);
27
26
  const { translations } = useContext(Context) || {};
28
- const { setCookieAccepted } = useContext(Context);
29
-
30
- useEffect(() => {
31
- const getCk = Boolean(getCookie(cookieName)) || false;
32
- setCk(getCk);
33
- setCookieAccepted(getCk);
34
- }, [ck, setCookieAccepted]);
35
27
 
36
28
  // when user declines
37
29
  const handleDecline = () => {
@@ -47,7 +39,7 @@ const CookieConsent = ({
47
39
  return (
48
40
  <>
49
41
  {!showModal && !ck && (
50
- <Sticky showOnScroll className={styles.cookieConsent || ''} position={location}>
42
+ <div className={styles.cookieConsent || ''}>
51
43
  <div className={styles.content || ''}>{children}</div>
52
44
  <div className={styles.buttonsContainer || ''}>
53
45
  {settingsCookie && (
@@ -82,7 +74,7 @@ const CookieConsent = ({
82
74
  />
83
75
  )}
84
76
  </div>
85
- </Sticky>
77
+ </div>
86
78
  )}
87
79
  </>
88
80
  );
@@ -93,7 +85,6 @@ CookieConsent.propTypes = {
93
85
  settingsCookie: PropTypes.bool,
94
86
  declineText: PropTypes.string,
95
87
  declineURL: PropTypes.string,
96
- location: PropTypes.oneOf(['bottom', 'top']),
97
88
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node, PropTypes.any]),
98
89
  };
99
90
 
@@ -106,28 +106,11 @@
106
106
  }
107
107
  }
108
108
 
109
- button {
110
- align-items: center;
111
- background-color: var(--primary-button-color,#6e33e5) !important;
112
- border-radius: 100px !important;
113
- color: var(--primary-button-color-text,#fff) !important;
114
- display: inline-flex !important;
115
- font-size: 1.8rem;
116
- font-weight: 700;
117
- gap: 0.4rem;
118
- justify-content: center;
119
- line-height: 2.7rem;
120
- padding: 1.6rem 2.4rem !important;
121
- text-align: center;
122
- text-transform: capitalize;
123
-
124
- &:hover,
125
- &:focus {
126
- background: var(--primary-button-color,#6e33e5) !important;
127
- border-radius: 100px !important;
128
- color: var(--primary-button-color-text,#fff) !important;
129
- }
109
+
110
+ button{
111
+ text-align: start;
130
112
  }
113
+
131
114
  }
132
115
 
133
116
  .formGroup {
@@ -317,21 +317,20 @@ const FormComponent = ({
317
317
  </div>
318
318
  )}
319
319
  {hasButton && (
320
- <div className={styles.formButton || ''}>
320
+ <button className={styles.formButton || ''} type="submit">
321
321
  <Button
322
322
  buttonSize={buttonSize}
323
323
  buttonType={buttonType}
324
324
  isInternalLink={false}
325
325
  btnText={state.loading ? 'sending...' : buttonLabel}
326
326
  gtmClass="form-gtm btn-cta"
327
- onClick={(e) => handleSubmit(e)}
328
327
  icon={
329
328
  showButtonIcon ? (
330
329
  <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />
331
330
  ) : null
332
331
  }
333
332
  />
334
- </div>
333
+ </button>
335
334
  )}
336
335
  {(state.success || state.failed || !state.isValid) && (
337
336
  <div className={styles.formAlerts || ''}>
@@ -0,0 +1,11 @@
1
+ .floatingArea{
2
+ @include flex-direction(column);
3
+ width: 100%;
4
+ position: fixed;
5
+ transition: all 1s;
6
+ bottom: -30rem;
7
+ }
8
+
9
+ .show {
10
+ bottom: 0;
11
+ }
@@ -13,9 +13,11 @@ import Footer from '~molecules/footer';
13
13
  import Navigation from '~organisms/navigation';
14
14
  import ScrollToTop from '~atoms/scroll-to-top';
15
15
  import CookieConsent from '~organisms/cookie-consent';
16
+ import isSticky from '~hooks/stickyOnScroll';
17
+ import styles from './body.module.scss';
16
18
  import { setCookie, getCookie } from '~helpers/cookies';
17
19
 
18
- function Body({ pageContext, children, hideOperatorBanner, serverData }) {
20
+ function Body({ pageContext, children, hideOperatorBanner, serverData, offsetTop = 400 }) {
19
21
  const getBodySection = (name) => getSection(name, pageContext);
20
22
  const { template } = pageContext.page;
21
23
  const is404 = pageContext?.page?.path?.includes('404');
@@ -23,6 +25,7 @@ function Body({ pageContext, children, hideOperatorBanner, serverData }) {
23
25
  const main = getBodySection('main');
24
26
  const navigation = getBodySection('navigation');
25
27
  const footer = getBodySection('footer');
28
+ const showScroll = isSticky(offsetTop);
26
29
 
27
30
  useEffect(() => {
28
31
  if (!getCookie('affUUID')) {
@@ -55,18 +58,20 @@ function Body({ pageContext, children, hideOperatorBanner, serverData }) {
55
58
  {main && !children && (
56
59
  <Main serverData={serverData} section={main} pageContext={pageContext} />
57
60
  )}
58
- {OperatorBanner && (
59
- <OperatorBanner
60
- pageTemplate={template}
61
- module={{ name: 'operator_banner', tracking_link_name: 'main' }}
62
- floating
63
- operator={pageContext.page.relation}
64
- />
65
- )}
66
61
  {children && <main>{children}</main>}
67
- <ScrollToTop />
68
62
  <Footer template={template} section={footer} />
69
- <CookieConsent />
63
+ <div className={`${styles.floatingArea} ${showScroll ? styles.show : ''}`}>
64
+ <ScrollToTop />
65
+ {OperatorBanner && (
66
+ <OperatorBanner
67
+ pageTemplate={template}
68
+ module={{ name: 'operator_banner', tracking_link_name: 'main' }}
69
+ floating
70
+ operator={pageContext.page.relation}
71
+ />
72
+ )}
73
+ <CookieConsent />
74
+ </div>
70
75
  </>
71
76
  );
72
77
  }
@@ -75,6 +80,7 @@ Body.propTypes = {
75
80
  children: PropTypes.element,
76
81
  // eslint-disable-next-line react/forbid-prop-types
77
82
  serverData: PropTypes.shape({}),
83
+ offsetTop: PropTypes.number,
78
84
  pageContext: PropTypes.shape({
79
85
  page: PropTypes.shape({
80
86
  id: PropTypes.number,
@@ -26,8 +26,7 @@ const Tracker = ({
26
26
  operatorLogoHeight = '80',
27
27
  serverData,
28
28
  }) => {
29
- const { operator, page } = pageContext;
30
- const translations = page?.translations;
29
+ const { operator, page, translations } = pageContext;
31
30
 
32
31
  const tracker = getTrackerName(operator, page, path);
33
32
 
@@ -25,8 +25,7 @@ const Tracker = ({
25
25
  operatorLogoWidth = '80',
26
26
  operatorLogoHeight = '80',
27
27
  }) => {
28
- const { operator, page } = pageContext;
29
- const translations = page?.translations;
28
+ const { operator, page, translations } = pageContext;
30
29
 
31
30
  const tracker = getTrackerName(operator, page, path);
32
31
 
@@ -5,17 +5,11 @@ export const Context = createContext();
5
5
 
6
6
  export default (props) => {
7
7
  const { value, children } = props;
8
- const [bannerIsActive, setBannerActive] = useState(false);
9
- const [cookieAccepted, setCookieAccepted] = useState(true);
10
8
 
11
9
  return (
12
10
  <Context.Provider
13
11
  value={{
14
12
  translations: value.translations,
15
- bannerIsActive,
16
- setBannerActive,
17
- cookieAccepted,
18
- setCookieAccepted,
19
13
  }}
20
14
  >
21
15
  {children}
@@ -82,7 +82,7 @@
82
82
  --modal-index: 30;
83
83
  --navigation-index: 20;
84
84
  --scroll-to-top-index: 10;
85
- --cookie-consent-index: 20;
85
+ --cookie-consent-index: 30;
86
86
  --search-form-index: 15;
87
87
  --above-search-form-index: 16;
88
88