diff --git a/src/sections/General/Navigation/index.js b/src/sections/General/Navigation/index.js index 5e5017338c99..168cb4463424 100644 --- a/src/sections/General/Navigation/index.js +++ b/src/sections/General/Navigation/index.js @@ -256,6 +256,30 @@ const Navigation = () => { closeDropDown(); }; + + useEffect(() => { + const plusButtons = document.querySelectorAll(".plus"); + + plusButtons.forEach((plus, index) => { + plus.addEventListener("click", () => { + const index = plus.getAttribute("data-index"); + const mobileNavSubitemContainer = document.querySelector(`.mobile-nav-subitem-container[data-index='${index}']`); + + if (mobileNavSubitemContainer.style.display === "block" && plus.style.transform == "rotate(180deg)") { + mobileNavSubitemContainer.style.display = "none"; + plus.style.transform = "rotate(0deg)"; + + } else { + mobileNavSubitemContainer.style.display = "block"; + plus.style.transform = "rotate(180deg)"; + } + }); + }); + }, []); + + + + return ( { : "mobile-nav-item" } > - - {menu.name} - - +
+ + {menu.name} + + {menu.subItems !== undefined && ( +
+ +
+ )} +
+ {menu.subItems !== undefined && ( +
+ +
+ )} ))} {!userData && (
)} -
+