Commit fd41c9e4 authored by Øyvind Julsrud's avatar Øyvind Julsrud Committed by Oyvind
Browse files

DEICH-5917: deichman.no: Fix navbar not closing when clicking list element

parent f5ba69bd
......@@ -27,26 +27,26 @@ const Nav = props => {
const { isVisible, isLoggedIn, userData } = props;
const { borrowerName = "" } = userData;
const handleRouteChange = () => {
// Ensure navigation closes when changing routes
const { isVisible } = props;
if (isVisible) {
onToggle();
}
};
useEffect(() => {
Router.events.on("routeChangeStart", handleRouteChange);
return () => {
Router.events.off("routeChangeStart", handleRouteChange);
};
}, []);
}, [handleRouteChange, Router.events]);
const onToggle = () => {
props.toggleNav();
};
const handleRouteChange = () => {
// Ensure navigation closes when changing routes
const { isVisible } = props;
if (isVisible) {
onToggle();
}
};
const handleSignup = () => {
Router.push("/registrer-deg");
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment