diff --git a/src/components/theme/Header/HeaderNavigation.jsx b/src/components/theme/Header/HeaderNavigation.jsx
index 756c5b6..7873125 100644
--- a/src/components/theme/Header/HeaderNavigation.jsx
+++ b/src/components/theme/Header/HeaderNavigation.jsx
@@ -11,25 +11,6 @@ import { connect } from 'react-redux';
import circleLeft from '@plone/volto/icons/circle-left.svg';
import circleRight from '@plone/volto/icons/circle-right.svg';
-const Card = ({ children, itemId }) => {
- return (
-
- {children}
-
- );
-};
-
const MobileNav = ({ items, activeItem }) => {
const [expanded, setExpanded] = React.useState(false);
@@ -44,25 +25,23 @@ const MobileNav = ({ items, activeItem }) => {
{items &&
items.length > 0 &&
items.map((item, i) => (
-
-
-
- {item.title}
- {item.url === activeItem.url && (
- setExpanded(false)}
- />
- )}
-
-
-
+
+
+ {item.title}
+ {item.url === activeItem.url && (
+ setExpanded(false)}
+ />
+ )}
+
+
))}
) : (
@@ -85,21 +64,6 @@ const MobileNav = ({ items, activeItem }) => {
);
};
-function onWheel(apiObj, ev) {
- const isThouchpad = Math.abs(ev.deltaX) !== 0 || Math.abs(ev.deltaY) < 15;
-
- if (isThouchpad) {
- ev.stopPropagation();
- return;
- }
-
- if (ev.deltaY < 0) {
- apiObj.scrollNext();
- } else if (ev.deltaY > 0) {
- apiObj.scrollPrev();
- }
-}
-
const HeaderNavigation = ({ items, pageWidth }) => {
const [activeItem, setActiveItem] = React.useState('');
const [isMobile, setIsMobile] = React.useState(false);
@@ -120,9 +84,8 @@ const HeaderNavigation = ({ items, pageWidth }) => {
const first = itemsIncrement * 3;
const last = first + itemsPerPage;
const itemsInit = items.slice(first, last);
-
setDisplayedItems(itemsInit);
- }, [itemsIncrement]);
+ }, [itemsIncrement, itemsPerPage, items]);
React.useEffect(() => {
//init items
@@ -144,6 +107,9 @@ const HeaderNavigation = ({ items, pageWidth }) => {
if (pageWidth && pageWidth > 768) {
setIsMobile(false);
}
+ if (pageWidth && pageWidth > 1240) {
+ setItemsPerPage(7);
+ }
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [items, pageWidth]);