@omniumretail/component-library 1.3.58 → 1.3.59
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.
|
@@ -26674,32 +26674,43 @@ const Header = ({
|
|
|
26674
26674
|
const headerRef = useRef(null);
|
|
26675
26675
|
const overlayRef = useRef(null);
|
|
26676
26676
|
const companyLogos = getCompanyLogos(companyName);
|
|
26677
|
+
const closeMenuAndExecute = (action2, delay = 150) => {
|
|
26678
|
+
setIsMenuOpen(false);
|
|
26679
|
+
setActiveDropdown(null);
|
|
26680
|
+
setTimeout(action2, delay);
|
|
26681
|
+
};
|
|
26677
26682
|
const onLogout = () => {
|
|
26678
|
-
|
|
26679
|
-
|
|
26680
|
-
|
|
26681
|
-
logout
|
|
26682
|
-
|
|
26683
|
-
|
|
26684
|
-
|
|
26683
|
+
closeMenuAndExecute(() => {
|
|
26684
|
+
if (shouldConfirmNavigation) {
|
|
26685
|
+
onLeavingPage("/logout");
|
|
26686
|
+
} else if (logout) {
|
|
26687
|
+
logout();
|
|
26688
|
+
} else {
|
|
26689
|
+
onHome();
|
|
26690
|
+
}
|
|
26691
|
+
});
|
|
26685
26692
|
};
|
|
26686
26693
|
const onProfile = () => {
|
|
26687
|
-
|
|
26688
|
-
|
|
26689
|
-
|
|
26690
|
-
onProfileClick
|
|
26691
|
-
|
|
26692
|
-
|
|
26693
|
-
|
|
26694
|
+
closeMenuAndExecute(() => {
|
|
26695
|
+
if (shouldConfirmNavigation) {
|
|
26696
|
+
onLeavingPage("/profile");
|
|
26697
|
+
} else if (onProfileClick) {
|
|
26698
|
+
onProfileClick();
|
|
26699
|
+
} else {
|
|
26700
|
+
window.location.href = profileUrl;
|
|
26701
|
+
}
|
|
26702
|
+
});
|
|
26694
26703
|
};
|
|
26695
26704
|
const onHome = () => {
|
|
26696
|
-
|
|
26697
|
-
|
|
26698
|
-
|
|
26699
|
-
onHomeClick
|
|
26700
|
-
|
|
26701
|
-
|
|
26702
|
-
|
|
26705
|
+
closeMenuAndExecute(() => {
|
|
26706
|
+
if (shouldConfirmNavigation) {
|
|
26707
|
+
onLeavingPage("/home");
|
|
26708
|
+
} else if (onHomeClick) {
|
|
26709
|
+
onHomeClick();
|
|
26710
|
+
} else {
|
|
26711
|
+
window.location.href = homeUrl;
|
|
26712
|
+
}
|
|
26713
|
+
});
|
|
26703
26714
|
};
|
|
26704
26715
|
const onSupport = () => {
|
|
26705
26716
|
if (onSupportModalOpen) {
|
|
@@ -26747,11 +26758,13 @@ const Header = ({
|
|
|
26747
26758
|
{
|
|
26748
26759
|
className: styles$4.listName,
|
|
26749
26760
|
onClick: () => {
|
|
26750
|
-
|
|
26751
|
-
onLeavingPage
|
|
26752
|
-
|
|
26753
|
-
|
|
26754
|
-
|
|
26761
|
+
closeMenuAndExecute(() => {
|
|
26762
|
+
if (onLeavingPage && link2.targetRoute) {
|
|
26763
|
+
onLeavingPage(link2.targetRoute);
|
|
26764
|
+
} else {
|
|
26765
|
+
link2.action();
|
|
26766
|
+
}
|
|
26767
|
+
}, 100);
|
|
26755
26768
|
},
|
|
26756
26769
|
children: [
|
|
26757
26770
|
/* @__PURE__ */ jsx(
|
|
@@ -26770,11 +26783,13 @@ const Header = ({
|
|
|
26770
26783
|
{
|
|
26771
26784
|
className: styles$4.dropdownMenu,
|
|
26772
26785
|
children: link2.dropdownMenu.map((dropdownLink) => /* @__PURE__ */ jsx("li", { onClick: () => {
|
|
26773
|
-
|
|
26774
|
-
onLeavingPage
|
|
26775
|
-
|
|
26776
|
-
|
|
26777
|
-
|
|
26786
|
+
closeMenuAndExecute(() => {
|
|
26787
|
+
if (onLeavingPage && dropdownLink.targetRoute) {
|
|
26788
|
+
onLeavingPage(dropdownLink.targetRoute);
|
|
26789
|
+
} else {
|
|
26790
|
+
dropdownLink.action();
|
|
26791
|
+
}
|
|
26792
|
+
}, 100);
|
|
26778
26793
|
}, className: styles$4.listItem, children: /* @__PURE__ */ jsx("div", { className: styles$4.listName, children: dropdownLink.name }) }, dropdownLink.name))
|
|
26779
26794
|
}
|
|
26780
26795
|
)
|