1
0
mirror of https://github.com/NginxProxyManager/nginx-proxy-manager.git synced 2025-11-14 11:42:26 +03:00

Fix #4831 mobile header menu not working

This commit is contained in:
Jamie Curnow
2025-11-11 14:05:26 +10:00
parent 7f0cce944d
commit 4bd545c88e
3 changed files with 107 additions and 105 deletions

View File

@@ -175,7 +175,11 @@ const getMenuDropown = (item: MenuItem, onClick?: () => void) => {
);
};
export function SiteMenu() {
interface Props {
mobileExpanded?: boolean;
setMobileExpanded?: (expanded: boolean) => void;
}
export function SiteMenu({ mobileExpanded = false, setMobileExpanded }: Props) {
// This is hacky AF. But that's the price of using a non-react UI kit.
const closeMenus = () => {
const navMenus = document.querySelectorAll(".nav-item.dropdown");
@@ -185,12 +189,13 @@ export function SiteMenu() {
if (dropdown) {
dropdown.classList.remove("show");
}
setMobileExpanded?.(false);
});
};
return (
<header className="navbar-expand-md">
<div className="collapse navbar-collapse">
<div className={cn("collapse", "navbar-collapse", { show: mobileExpanded })} id="navbar-menu">
<div className="navbar">
<div className="container-xl">
<div className="row flex-column flex-md-row flex-fill align-items-center">