gatsby-core-theme 30.0.61 → 30.0.63

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,21 @@
1
+ ## [30.0.63](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.62...v30.0.63) (2024-01-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added prop for nofollow in links component ([92f2a0c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/92f2a0ce520fcf6a8941f49710c02e93cacd540c))
7
+ * added prop to row ([fda7eb3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/fda7eb36729126d21b5f4b684e349e7a18fe95d2))
8
+
9
+
10
+ * Merge branch 'tm-3991-review-links-nofollow' into 'master' ([9a9bbea](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9a9bbea8686949397b769cb8b1ecb68ad52314b6))
11
+
12
+ ## [30.0.62](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.61...v30.0.62) (2024-01-25)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * operator banner ([c75ded0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c75ded0143f6da5f6f0d9516396a02dc5911b12f))
18
+
1
19
  ## [30.0.61](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.60...v30.0.61) (2024-01-24)
2
20
 
3
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.61",
3
+ "version": "30.0.63",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Context } from 'gatsby-core-theme/src/context/MainProvider';
4
4
  import { translate } from 'gatsby-core-theme/src/helpers/getters';
5
- import Link from 'gatsby-core-theme/src/hooks/link';
5
+ import LinkCustom from 'gatsby-core-theme/src/hooks/link';
6
6
 
7
7
  const ReviewLink = ({
8
8
  template,
@@ -10,6 +10,7 @@ const ReviewLink = ({
10
10
  operatorName,
11
11
  reviewPath,
12
12
  className,
13
+ nofollow = false,
13
14
  isComparisonTable = false,
14
15
  }) => {
15
16
  let isBonusTemplate = false;
@@ -20,7 +21,7 @@ const ReviewLink = ({
20
21
  }
21
22
 
22
23
  return (
23
- <Link className={className || ''} to={reviewPath}>{`${
24
+ <LinkCustom className={className || ''} nofollow={nofollow} to={reviewPath}>{`${
24
25
  isBonusTemplate
25
26
  ? translate(translations, 'bonus', '[operator_name] Bonus').replace(
26
27
  '[operator_name]',
@@ -31,13 +32,14 @@ const ReviewLink = ({
31
32
  isComparisonTable ? 'read_review_comparison' : 'read_review',
32
33
  (pageName && '[operator_name]') || (operatorName && '[operator_name] Review')
33
34
  ).replace('[operator_name]', pageName || operatorName)
34
- }`}</Link>
35
+ }`}</LinkCustom>
35
36
  );
36
37
  };
37
38
 
38
39
  ReviewLink.propTypes = {
39
40
  template: PropTypes.string,
40
41
  pageName: PropTypes.string,
42
+ nofollow: PropTypes.bool,
41
43
  operatorName: PropTypes.string,
42
44
  reviewPath: PropTypes.string,
43
45
  className: PropTypes.string,
@@ -157,18 +157,19 @@
157
157
  }
158
158
  }
159
159
 
160
+ .hide {
161
+ display: none;
162
+ }
163
+
160
164
  .floating {
161
165
  max-width: var(--main-container-max);
162
166
  border-radius: 1.6rem;
163
167
  width: 95%;
164
168
  box-shadow: 0px 4px 6px -2px rgba(27, 27, 28, 0.02), 0px 12px 16px -4px rgba(27, 27, 28, 0.05);
165
- left: 0;
166
- right: 0;
167
- transition: all 1s;
168
- margin-bottom: -10rem;
169
169
  margin-left: auto;
170
170
  margin-right: auto;
171
171
  padding: 0.8rem 1.6rem;
172
+
172
173
  > svg {
173
174
  right: 10px;
174
175
  top: -7px;
@@ -16,19 +16,17 @@ import styles from './bonus.module.scss';
16
16
 
17
17
  export default function TemplateOne({
18
18
  operator,
19
- stickyOffset = 0,
20
19
  pageTemplate,
21
20
  module = {
22
21
  name: 'bonus',
23
22
  },
24
23
  tncEnable = true,
25
24
  tncFixed = false,
26
- showOnLoad = false,
27
25
  showWelcomeText = true,
28
26
  floating = false,
27
+ closedBanner,
28
+ setClosedBanner,
29
29
  }) {
30
- const [show, setShow] = useState(showOnLoad);
31
- const [closed, setClosed] = useState(false);
32
30
  const { translations } = useContext(Context) || {};
33
31
  const { standardised_logo_url, logo_url, bonus, name } = operator || {};
34
32
  const logo = standardised_logo_url || logo_url;
@@ -42,80 +40,76 @@ export default function TemplateOne({
42
40
  },
43
41
  };
44
42
 
45
- isSticky(stickyOffset, setShow);
46
-
47
43
  const clickHandler = () => {
48
- setShow(false);
49
- setClosed(true);
44
+ setClosedBanner(true);
50
45
  };
51
46
 
52
47
  return (
53
- !closed && (
54
- <div
55
- className={`${styles.operatorBanner || ''} ${show && styles.show} ${
56
- tncEnable ? styles.tncEnable : ''
57
- } ${showTncFixed ? styles.showTncFixed || '' : ''} ${floating ? styles.floating : ''}
48
+ <div
49
+ className={`${styles.operatorBanner || ''} ${!closedBanner ? styles.show : styles.hide} ${
50
+ tncEnable ? styles.tncEnable : ''
51
+ } ${showTncFixed ? styles.showTncFixed || '' : ''} ${floating ? styles.floating : ''}
58
52
  `}
59
- >
60
- <div className={styles.container}>
61
- <div>
62
- <PrettyLink
63
- operator={operator}
64
- pageTemplate={pageTemplate}
65
- module={module.name}
66
- tracker={module?.tracking_link_name || 'main'}
67
- clickedElement="oneliner"
68
- className={`${styles.logo || ''} operator-banner-gtm logo-cta`}
69
- >
70
- <LazyImage
71
- alt={operator?.name}
72
- src={imagePrettyUrl(logo, 120, 120)}
73
- loading="eager"
74
- height={120}
75
- width={100}
76
- />
77
- <div className={styles.details}>
78
- {name && <span>{name}</span>}
79
- {bonus?.rating && <Rating rating={bonus?.rating} showDecimal />}
80
- </div>
81
- </PrettyLink>
82
- <div className={styles.bonus || ''}>
83
- {showWelcomeText && (
84
- <p className={styles.welcomeBonus}>
85
- {translate(translations, 'welcome_bonus', 'Welcome Bonus')}
86
- </p>
87
- )}
88
-
89
- <BonusBox item={operator} tracker={module?.type || 'main'} />
90
- {tncEnable && !tncFixed && <Tnc hasCollapse={false} operator={operator} />}
91
- </div>
92
- </div>
93
-
94
- <OperatorCta
53
+ >
54
+ <div className={styles.container}>
55
+ <div>
56
+ <PrettyLink
95
57
  operator={operator}
96
- module={module.name}
97
58
  pageTemplate={pageTemplate}
59
+ module={module.name}
98
60
  tracker={module?.tracking_link_name || 'main'}
99
- icon={<FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />}
100
- translationsObj={translationsObj}
101
- />
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
- />
61
+ clickedElement="oneliner"
62
+ className={`${styles.logo || ''} operator-banner-gtm logo-cta`}
63
+ >
64
+ <LazyImage
65
+ alt={operator?.name}
66
+ src={imagePrettyUrl(logo, 120, 120)}
67
+ loading="eager"
68
+ height={120}
69
+ width={100}
70
+ />
71
+ <div className={styles.details}>
72
+ {name && <span>{name}</span>}
73
+ {bonus?.rating && <Rating rating={bonus?.rating} showDecimal />}
74
+ </div>
75
+ </PrettyLink>
76
+ <div className={styles.bonus || ''}>
77
+ {showWelcomeText && (
78
+ <p className={styles.welcomeBonus}>
79
+ {translate(translations, 'welcome_bonus', 'Welcome Bonus')}
80
+ </p>
81
+ )}
82
+
83
+ <BonusBox item={operator} tracker={module?.type || 'main'} />
84
+ {tncEnable && !tncFixed && <Tnc hasCollapse={false} operator={operator} />}
85
+ </div>
110
86
  </div>
87
+
88
+ <OperatorCta
89
+ operator={operator}
90
+ module={module.name}
91
+ pageTemplate={pageTemplate}
92
+ tracker={module?.tracking_link_name || 'main'}
93
+ icon={<FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />}
94
+ translationsObj={translationsObj}
95
+ />
96
+ {showTncFixed && <Tnc hasCollapse={false} operator={operator} />}
97
+ <IoMdClose
98
+ className={`${styles.closeBtn || ''}`}
99
+ onClick={clickHandler}
100
+ fontSize={16}
101
+ color="#ffffff"
102
+ title="Close Icon"
103
+ />
111
104
  </div>
112
- )
105
+ </div>
113
106
  );
114
107
  }
115
108
 
116
109
  TemplateOne.propTypes = {
117
110
  showWelcomeText: PropTypes.bool,
118
- showOnLoad: PropTypes.bool,
111
+ closedBanner: PropTypes.bool,
112
+ setClosedBanner: PropTypes.func,
119
113
  operator: PropTypes.shape({
120
114
  standardised_logo_url: PropTypes.string,
121
115
  logo: PropTypes.string,
@@ -21,6 +21,7 @@ const Row = ({
21
21
  itemRefs,
22
22
  index,
23
23
  className,
24
+ nofollow = false,
24
25
  module,
25
26
  }) => {
26
27
  const reviewPath = item.review_link ? `/${item.review_link}` : item.path || null;
@@ -62,6 +63,7 @@ const Row = ({
62
63
  className={`${styles.reviewLink || ''} toplist-variant-one-gtm`}
63
64
  template={pageTemplate}
64
65
  operatorName={item.name}
66
+ nofollow={nofollow}
65
67
  reviewPath={reviewPath}
66
68
  />
67
69
  )}
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable camelcase */
2
2
  /* eslint-disable no-useless-concat */
3
3
  /* eslint-disable no-restricted-globals */
4
- import React, { useEffect } from 'react';
4
+ import React, { useEffect, useState } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import loadable from '@loadable/component';
7
7
  // eslint-disable-next-line import/no-extraneous-dependencies
@@ -21,7 +21,7 @@ function Body({ pageContext, children, hideOperatorBanner, serverData, offsetTop
21
21
  const getBodySection = (name) => getSection(name, pageContext);
22
22
  const { template } = pageContext.page;
23
23
  const is404 = pageContext?.page?.path?.includes('404');
24
-
24
+ const [closedBanner, setClosedBanner] = useState(false);
25
25
  const main = getBodySection('main');
26
26
  const navigation = getBodySection('navigation');
27
27
  const footer = getBodySection('footer');
@@ -67,6 +67,8 @@ function Body({ pageContext, children, hideOperatorBanner, serverData, offsetTop
67
67
  pageTemplate={template}
68
68
  module={{ name: 'operator_banner', tracking_link_name: 'main' }}
69
69
  floating
70
+ closedBanner={closedBanner}
71
+ setClosedBanner={setClosedBanner}
70
72
  operator={pageContext.page.relation}
71
73
  />
72
74
  )}
@@ -10,6 +10,7 @@ function LinkCustom({
10
10
  activeClassName = '',
11
11
  partiallyActive = false,
12
12
  external = false,
13
+ nofollow = false,
13
14
  ...other
14
15
  }) {
15
16
  if (!to) {
@@ -50,6 +51,7 @@ function LinkCustom({
50
51
  </a>
51
52
  ) : (
52
53
  <Link
54
+ rel={nofollow ? 'nofollow' : null}
53
55
  to={formatPath(to)}
54
56
  activeClassName={activeClassName}
55
57
  partiallyActive={partiallyActive}
@@ -64,6 +66,7 @@ function LinkCustom({
64
66
 
65
67
  LinkCustom.propTypes = {
66
68
  to: PropTypes.string,
69
+ nofollow: PropTypes.bool,
67
70
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.element, PropTypes.any]),
68
71
  activeClassName: PropTypes.string,
69
72
  partiallyActive: PropTypes.bool,