Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: auto close navigation menu when navigating on mobile

thecodrr0c1988f5f87c
diff --git a/apps/web/src/components/navigation-menu/navigation-item.js b/apps/web/src/components/navigation-menu/navigation-item.js
index a72ea96d4..6837659d0 100644
--- a/apps/web/src/components/navigation-menu/navigation-item.js
+++ b/apps/web/src/components/navigation-menu/navigation-item.js
@@ -1,8 +1,10 @@
import React from "react";
import { Flex, Button, Text } from "rebass";
+import { useStore as useAppStore } from "../../stores/app-store";
function NavigationItem(props) {
const { icon: Icon, color, title, isLoading } = props;
+ const toggleSideMenu = useAppStore((store) => store.toggleSideMenu);
return (
<Button
@@ -10,7 +12,10 @@ function NavigationItem(props) {
py={3}
label={title}
title={title}
- onClick={props.onClick}
+ onClick={() => {
+ toggleSideMenu(false);
+ props.onClick();
+ }}
>
<Flex
justifyContent={["flex-start", "center", "center"]}