gatsby-core-theme 37.0.1 → 37.0.2

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,10 @@
1
+ ## [37.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v37.0.1...v37.0.2) (2024-08-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * lazy loading creating delayed menu styling in highly populated menus ([470f7b2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/470f7b2caac43e8ee6b8e743a9ef2f7a060ab636))
7
+
1
8
  ## [37.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v37.0.0...v37.0.1) (2024-08-23)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "37.0.1",
3
+ "version": "37.0.2",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -1,8 +1,10 @@
1
1
  /* eslint-disable arrow-body-style */
2
- import React, { useContext, lazy, useRef, Suspense } from "react";
2
+ import React, { useContext, useRef } from "react";
3
3
  import PropTypes from "prop-types";
4
- import MenuIcon from "~atoms/menu/menu-icon";
4
+ import MegaItems from 'gatsby-core-theme/src/components/atoms/menu/mega-items';
5
+ import Items from 'gatsby-core-theme/src/components/atoms/menu/items';
5
6
 
7
+ import MenuIcon from "~atoms/menu/menu-icon";
6
8
  import { NavigationContext } from "~organisms/navigation/navigationContext";
7
9
 
8
10
  import styles from "./menu.module.scss";
@@ -22,9 +24,6 @@ const Menu = ({
22
24
  enableMegaMenu = false
23
25
  }) => {
24
26
  let menuObject;
25
- const Items = enableMegaMenu
26
- ? lazy(() => import('gatsby-core-theme/src/components/atoms/menu/mega-items'))
27
- : lazy(() => import('gatsby-core-theme/src/components/atoms/menu/items'));
28
27
 
29
28
  const menuListRef = useRef(React.createRef());
30
29
  const toplistModule = section?.modules?.find(
@@ -68,11 +67,21 @@ const Menu = ({
68
67
  } ${styles[customStyles] || ""}`}
69
68
  role="menu"
70
69
  >
71
- {menuObject && menuObject.children &&
70
+ {menuObject &&
72
71
  menuObject.children.map((child) => {
73
72
  const level = 1;
74
73
  return (
75
- <Suspense>
74
+ enableMegaMenu ? (
75
+ <MegaItems
76
+ toplist={toplistModule}
77
+ menuListRef={menuListRef}
78
+ gtmClass={gtmClass}
79
+ key={keygen()}
80
+ item={child}
81
+ canOpenAllSubMenus={canOpenAllSubMenus}
82
+ level={level}
83
+ />
84
+ ) : (
76
85
  <Items
77
86
  toplist={toplistModule}
78
87
  menuListRef={menuListRef}
@@ -82,7 +91,7 @@ const Menu = ({
82
91
  canOpenAllSubMenus={canOpenAllSubMenus}
83
92
  level={level}
84
93
  />
85
- </Suspense>
94
+ )
86
95
  );
87
96
  })}
88
97
  </ul>