+ const renderColumns = () => (
+
+ {menuItemColumns.map((section, columnIndex) => (
+
+ {columnIndex !== menuItemColumnsLength
+ ? renderColumnContent(menuItem.items[columnIndex], columnIndex)
+ : menuItem.items
+ .slice(menuItemColumnsLength)
+ .map((section, _idx) =>
+ renderColumnContent(section, columnIndex),
+ )}
+
+ ))}
+
+ );
+
+ const renderDefaultColumns = () => (
+
{menuItem.items.map((section, index) => (
-
- {index === 0 && (
-
- )}
-
+
+ {renderColumnContent(section, index)}
+
))}
-
-
-
- {menuItem.items.map((section, index) => (
-
- {index !== 0 && (
-
-
-
- )}
-
- ))}
-
-
-
-);
+
+ );
-const StandardMegaMenuGrid = ({ menuItem, renderMenuItem }) => (
-
- {menuItem.items.map((section, index) => (
-
-
-
- ))}
-
-);
+ return menuItemColumns ? renderColumns() : renderDefaultColumns();
+};
const FirstLevelContent = ({ element, renderMenuItem, pathName }) => {
- const topics = element.title === 'Topics' ? true : false;
+ const topics = element.title === 'Topics';
let defaultIndex = -1;
return (
@@ -308,6 +323,7 @@ const NestedAccordion = ({ menuItems, renderMenuItem, pathName }) => {
function HeaderMenuPopUp({
menuItems,
+ menuItemsLayouts,
renderMenuItem,
pathName,
onClose,
@@ -322,6 +338,11 @@ function HeaderMenuPopUp({
(current) => current.url === activeItem || current['@id'] === activeItem,
);
+ const layout =
+ !!menuItemsLayouts &&
+ Object.keys(menuItemsLayouts).includes(menuItem?.url) &&
+ menuItemsLayouts[menuItem.url];
+
return (
)}
- {menuItem.title === 'Topics' ? (
-
- ) : menuItem.title === 'Countries' ? (
-
- ) : (
-
- )}
+
)}
diff --git a/theme/themes/eea/extras/header.less b/theme/themes/eea/extras/header.less
index 13228b3198..74240a1ee2 100644
--- a/theme/themes/eea/extras/header.less
+++ b/theme/themes/eea/extras/header.less
@@ -747,6 +747,7 @@
#mega-menu .ui.list {
margin: 0;
+ gap: @megaMenuListGap;
}
#mega-menu .item {
@@ -770,7 +771,7 @@
}
}
-#at-a-glance {
+.at-a-glance {
.item {
margin: @megaMenuGlanceListItemMargin;
font-size: @megaMenuGlanceListItemFontSize;
@@ -782,30 +783,10 @@
}
}
-// add negative margin to the first column subtitle from nested grid
-// so that the subtitle lines up with the subtitle from the left column
-#mega-menu .nested-grid > .column:first-of-type .sub-title {
- margin-top: @megaMenuSubTitleCountriesNestedGridMarginTop;
-}
-
-#topics-right-column {
+.topics-right-column {
padding-left: @topicsRightColumnPaddingLeft;
}
-.ui.grid > .column > .ui.grid {
- margin-top: 0;
-}
-
-#mega-menu .ui.grid {
- div.column:first-child {
- padding-left: 0.625rem;
- }
-
- div.column:last-child {
- padding-right: 0.625rem;
- }
-}
-
#mega-menu .active:not(.title-link):not(.button) > span {
padding-left: @megaMenuListItemActivePadding;
border-left: @megaMenuListItemActiveBorder;
diff --git a/theme/themes/eea/extras/header.variables b/theme/themes/eea/extras/header.variables
index 81b396e604..91bf981eb8 100644
--- a/theme/themes/eea/extras/header.variables
+++ b/theme/themes/eea/extras/header.variables
@@ -182,9 +182,9 @@
@megaMenuSubTitleFontWeight: @font-weight-7;
@megaMenuSubTitlePadding: 0.5rem 0;
@megaMenuSubTitleDisplay: block;
-@megaMenuSubTitleCountriesNestedGridMarginTop: -1rem;
/* List Item */
+@megaMenuListGap: 0 2rem;
@megaMenuListItemFontSize: @font-size-1;
@megaMenuListItemFontWeight: @font-weight-4;
@megaMenuListItemPadding: @rem-space-2 0;