gatsby-core-theme 35.0.4 → 35.0.5

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,18 @@
1
+ ## [35.0.5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v35.0.4...v35.0.5) (2024-07-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * changed site to BAL and added icons ([5bc1a10](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5bc1a102a2a9f8112f10832dfd56e28a694f92f4))
7
+ * included icons ([df4999f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/df4999fb385f04bf88d9c907820753249a57b76b))
8
+ * removed settings ([3202fe7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3202fe72fb37b13febcdd7cd5a0935d3952555d1))
9
+ * tests + lintstagedrc ([cdf460d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cdf460d241e355ef80cc91d576117f0d7b2d96bc))
10
+
11
+
12
+ * Merge branch 'tm-4071-market-dropdown' into 'master' ([9796dee](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9796dee092c7137ef1376737b80fac846b2fc049))
13
+ * Merge branch 'tm-4071-market-dropdown' into 'master' ([09e0239](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/09e0239967257cd12417ff3695933349e8447e90))
14
+ * Merge branch 'master' into tm-4071-market-dropdown ([e745fe7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e745fe7c3e333ddd32da414919b0021d73ffb104))
15
+
1
16
  ## [35.0.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v35.0.3...v35.0.4) (2024-07-25)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "35.0.4",
3
+ "version": "35.0.5",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -1,29 +1,29 @@
1
1
  /* eslint-disable import/no-named-as-default */
2
- import React, { useRef } from 'react';
3
- import PropTypes from 'prop-types';
4
- import Search from '~organisms/search';
5
- import Link from '~hooks/link';
6
- import Menu from '~molecules/menu';
7
- import MarketDropdown from '~atoms/market-dropdown';
8
- import { toggleScroll } from '~helpers/scroll';
9
- import ConditionalWrapper from '~atoms/conditional-wrapper';
10
- import Sticky from '~molecules/sticky';
11
- import CustomComponent from '~atoms/menu/variables';
12
- import { pageTypes } from '../../../constants/site-settings/navigation';
2
+ import React, { useRef } from "react";
3
+ import PropTypes from "prop-types";
4
+ import Search from "~organisms/search";
5
+ import Link from "~hooks/link";
6
+ import Menu from "~molecules/menu";
7
+ import MarketDropdown from "~atoms/market-dropdown";
8
+ import { toggleScroll } from "~helpers/scroll";
9
+ import ConditionalWrapper from "~atoms/conditional-wrapper";
10
+ import Sticky from "~molecules/sticky";
11
+ import CustomComponent from "~atoms/menu/variables";
12
+ import { pageTypes } from "../../../constants/site-settings/navigation";
13
13
 
14
- import NavigationProvider from './navigationContext';
14
+ import NavigationProvider from "./navigationContext";
15
15
 
16
- import styles from './navigation.module.scss';
16
+ import styles from "./navigation.module.scss";
17
17
 
18
18
  const Navigation = ({
19
19
  section,
20
20
  pageContext,
21
21
  sticky = true,
22
- orientation = 'horizontal',
23
- mobileAnimation = 'collapseFull',
22
+ orientation = "horizontal",
23
+ mobileAnimation = "collapseFull",
24
24
  stopScrollOnOpen = true,
25
25
  canOpenAllSubMenus = true,
26
- logo = '../../../../../images/logo.svg',
26
+ logo = "../../../../../images/logo.svg",
27
27
  logoWidth = 200,
28
28
  logoHeight = 31,
29
29
  searchIcon = null,
@@ -31,15 +31,15 @@ const Navigation = ({
31
31
  children,
32
32
  customStyles,
33
33
  hasCustomComponent = false,
34
- hasMarketDropdown = false,
35
34
  hasSearch = true,
36
35
  disableSearch,
37
36
  menu,
38
37
  }) => {
39
38
  const navRef = useRef(React.createRef());
40
- const showMenu = pageTypes[template]?.showNavMenu ?? pageTypes.default.showNavMenu;
39
+ const showMenu =
40
+ pageTypes[template]?.showNavMenu ?? pageTypes.default.showNavMenu;
41
41
 
42
- let searchURLPageName = 's';
42
+ let searchURLPageName = "s";
43
43
 
44
44
  const showLogoWithLink =
45
45
  pageTypes[template]?.showLogoWithLink ?? pageTypes.default.showLogoWithLink;
@@ -53,9 +53,10 @@ const Navigation = ({
53
53
  />
54
54
  );
55
55
 
56
- if (stopScrollOnOpen) toggleScroll('', true);
56
+ if (stopScrollOnOpen) toggleScroll("", true);
57
57
 
58
- const activeMarket = pageContext?.allMarkets && pageContext?.allMarkets[pageContext.page.market];
58
+ const activeMarket =
59
+ pageContext?.allMarkets && pageContext?.allMarkets[pageContext.page.market];
59
60
  if (activeMarket) activeMarket.market = pageContext?.page?.market;
60
61
 
61
62
  if (activeMarket?.path_prefix) {
@@ -64,8 +65,8 @@ const Navigation = ({
64
65
 
65
66
  const onClickHandler = () => {
66
67
  if (
67
- typeof window !== 'undefined' &&
68
- window.location.href.replace(window.location.origin, '') === '/'
68
+ typeof window !== "undefined" &&
69
+ window.location.href.replace(window.location.origin, "") === "/"
69
70
  ) {
70
71
  window.location.reload();
71
72
  }
@@ -75,24 +76,29 @@ const Navigation = ({
75
76
  <ConditionalWrapper
76
77
  condition={sticky}
77
78
  wrapper={(items) => (
78
- <Sticky position="top" fullWidth showOnScroll={false} className={styles.stickyNav || ''}>
79
+ <Sticky
80
+ position="top"
81
+ fullWidth
82
+ showOnScroll={false}
83
+ className={styles.stickyNav || ""}
84
+ >
79
85
  {items}
80
86
  </Sticky>
81
87
  )}
82
88
  >
83
- <nav className={styles.nav || ''} ref={navRef}>
89
+ <nav className={styles.nav || ""} ref={navRef}>
84
90
  <NavigationProvider>
85
91
  {showMenu && showLogoWithLink ? (
86
92
  <Link
87
- className={`${styles.logo || ''} main-menu-gtm logo-cta`}
93
+ className={`${styles.logo || ""} main-menu-gtm logo-cta`}
88
94
  aria-label="Nav Logo"
89
- to={activeMarket?.path_prefix || '/'}
95
+ to={activeMarket?.path_prefix || "/"}
90
96
  onClick={onClickHandler}
91
97
  >
92
98
  {logoImg}
93
99
  </Link>
94
100
  ) : (
95
- <div className={`${styles.logo || ''}`}>{logoImg}</div>
101
+ <div className={`${styles.logo || ""}`}>{logoImg}</div>
96
102
  )}
97
103
  {showMenu && (
98
104
  <>
@@ -108,17 +114,20 @@ const Navigation = ({
108
114
  />
109
115
 
110
116
  <div className={styles.navIconContainer}>
111
- {hasMarketDropdown && <MarketDropdown pageContext={pageContext} />}
117
+ {activeMarket && <MarketDropdown pageContext={pageContext} />}
112
118
  {hasCustomComponent && (
113
- <CustomComponent pageContext={pageContext} section={section} />
119
+ <CustomComponent
120
+ pageContext={pageContext}
121
+ section={section}
122
+ />
114
123
  )}
115
124
  {hasSearch && (
116
125
  <Search
117
- className={styles.search || ''}
126
+ className={styles.search || ""}
118
127
  searchIcon={searchIcon}
119
128
  pageContext={pageContext}
120
129
  searchURLPageName={searchURLPageName}
121
- marketPrefix={activeMarket?.path_prefix || '/'}
130
+ marketPrefix={activeMarket?.path_prefix || "/"}
122
131
  isDisabled={disableSearch}
123
132
  />
124
133
  )}
@@ -154,11 +163,15 @@ Navigation.propTypes = {
154
163
  }),
155
164
  hasSearch: PropTypes.bool,
156
165
  sticky: PropTypes.bool,
157
- orientation: PropTypes.oneOf(['horizontal']),
158
- mobileAnimation: PropTypes.oneOf(['collapseFull', 'collapse', 'slideLeft', 'slideTop']),
166
+ orientation: PropTypes.oneOf(["horizontal"]),
167
+ mobileAnimation: PropTypes.oneOf([
168
+ "collapseFull",
169
+ "collapse",
170
+ "slideLeft",
171
+ "slideTop",
172
+ ]),
159
173
  stopScrollOnOpen: PropTypes.bool,
160
174
  canOpenAllSubMenus: PropTypes.bool,
161
- hasMarketDropdown: PropTypes.bool,
162
175
  template: PropTypes.string,
163
176
  logo: PropTypes.string,
164
177
  logoWidth: PropTypes.number,
@@ -1,22 +1,22 @@
1
1
  // eslint-disable-next-line import/prefer-default-export
2
2
  export const pageTypes = {
3
3
  informational: {
4
- section: 'navigation',
4
+ section: "navigation",
5
5
  showLogoWithLink: true,
6
6
  disableSearch: false,
7
7
  customComponent: false,
8
8
  exclusiveOperator: false,
9
- navMenu: 'main_menu',
9
+ navMenu: "main_menu",
10
10
  showNavMenu: true,
11
11
  disablePopup: true,
12
12
  },
13
13
  responsible_gambling_guide: {
14
- section: 'rg_navigation',
14
+ section: "rg_navigation",
15
15
  showLogoWithLink: false,
16
16
  disableSearch: false,
17
17
  customComponent: false,
18
18
  exclusiveOperator: false,
19
- navMenu: 'rg_menu',
19
+ navMenu: "rg_menu",
20
20
  showNavMenu: true,
21
21
  disablePopup: true,
22
22
  },
@@ -29,13 +29,12 @@ export const pageTypes = {
29
29
  disablePopup: true,
30
30
  },
31
31
  default: {
32
- section: 'navigation',
32
+ section: "navigation",
33
33
  showLogoWithLink: true,
34
34
  disableSearch: false,
35
35
  customComponent: false,
36
- marketDropdown: true,
37
36
  exclusiveOperator: true,
38
- navMenu: 'main_menu',
37
+ navMenu: "main_menu",
39
38
  showNavMenu: true,
40
39
  disablePopup: false,
41
40
  },