Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
danielamormocea committed Jan 18, 2022
1 parent ac2c60a commit e673d77
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 47 deletions.
88 changes: 44 additions & 44 deletions src/components/theme/Header/HeaderNavigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import downIcon from '@plone/volto/icons/down-key.svg';
import closeIcon from '@plone/volto/icons/clear.svg';
import { Icon } from '@plone/volto/components';
import { connect } from 'react-redux';
import Sticky from 'react-stickynode';

import Sticky from 'react-stickynode';

import circleLeft from '@plone/volto/icons/circle-left.svg';
import circleRight from '@plone/volto/icons/circle-right.svg';
Expand Down Expand Up @@ -65,7 +64,6 @@ const MobileNav = ({ items, activeItem }) => {
)}
</div>
</Sticky>

);
};

Expand All @@ -78,7 +76,6 @@ const HeaderNavigation = ({ items, pageWidth }) => {
items && items.length < 4 ? items.length : 4,
);


const [displayedItems, setDisplayedItems] = React.useState([]);
const history = useHistory();
const pathname = history.location.pathname;
Expand Down Expand Up @@ -148,48 +145,51 @@ const HeaderNavigation = ({ items, pageWidth }) => {
{isMobile ? (
<MobileNav activeItem={activeItem} items={items} />
) : (
<Sticky enabled={true} top={isTablet ? 75 : 102} className="sticky-header-nav">
<div className="header-navigation-lead">
{displayedItems.length > 0 &&
displayedItems.map((item, index) => (
<Link
style={{
width: `${
items.length < itemsPerPage
? 100 / items.length - 1
: 100 / itemsPerPage - 1
}%`,
}}
className={`lead-navigation-item ${
activeItem.title === item.title ? 'active-lead-nav' : ''
}`}
key={index}
to={item.url}
title={item.title}
>
{item.title}
</Link>
))}
{!noPrev && (
<Icon
className="navigation-prev"
name={circleLeft}
size="34px"
onClick={handlePrev}
/>
)}
{!noNext && (
<Icon
className="navigation-next"
name={circleRight}
size="34px"
onClick={handleNext}
/>
)}
</div>
<Sticky
enabled={true}
top={isTablet ? 75 : 102}
className="sticky-header-nav"
>
<div className="header-navigation-lead">
{displayedItems.length > 0 &&
displayedItems.map((item, index) => (
<Link
style={{
width: `${
items.length < itemsPerPage
? 100 / items.length - 1
: 100 / itemsPerPage - 1
}%`,
}}
className={`lead-navigation-item ${
activeItem.title === item.title ? 'active-lead-nav' : ''
}`}
key={index}
to={item.url}
title={item.title}
>
{item.title}
</Link>
))}
{!noPrev && (
<Icon
className="navigation-prev"
name={circleLeft}
size="34px"
onClick={handlePrev}
/>
)}
{!noNext && (
<Icon
className="navigation-next"
name={circleRight}
size="34px"
onClick={handleNext}
/>
)}
</div>
</Sticky>
)}

</React.Fragment>
);
};
Expand Down
3 changes: 0 additions & 3 deletions src/customizations/volto/components/theme/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ const Header = (props) => {
const pathName = props.pathname;
const hideSearch = ['/header', '/head', '/footer'].includes(pathName);




return (
<div className="header-wrapper" role="banner">
<Sticky enabled={true} top={0}>
Expand Down

0 comments on commit e673d77

Please sign in to comment.