diff --git a/apps/web/src/components/navigation-menu/index.js b/apps/web/src/components/navigation-menu/index.js index 9d39de3e8..c017cb5e8 100644 --- a/apps/web/src/components/navigation-menu/index.js +++ b/apps/web/src/components/navigation-menu/index.js @@ -27,6 +27,7 @@ import { useStore as useAppStore } from "../../stores/app-store"; import { useStore as useUserStore } from "../../stores/user-store"; import { useStore as useThemeStore } from "../../stores/theme-store"; import useLocation from "../../hooks/use-location"; +import { FlexScrollContainer } from "../scroll-container"; function shouldSelectNavItem(route, pin) { if (pin.type === "notebook") { @@ -126,96 +127,96 @@ function NavigationMenu(props) { bg={"bgSecondary"} px={0} > - - {routes.map((item) => ( - { - if (!isMobile && location === item.path) - return toggleNavigationContainer(); - _navigate(item.path); - }} - /> - ))} - {colors.map((color) => ( - { - _navigate(`/colors/${color.id}`); - }} - menu={{ - items: [ - { - key: "rename", - title: () => "Rename color", - onClick: async ({ color }) => { - await showRenameColorDialog(color.id); - }, - }, - ], - extraData: { color }, - }} - /> - ))} - - {pins.map((pin) => ( - "Remove shortcut", - onClick: async ({ pin }) => { - await db.settings.unpin(pin.id); - refreshNavItems(); - }, - }, - ], - extraData: { pin }, - }} - icon={ - pin.type === "notebook" - ? Notebook2 - : pin.type === "tag" - ? Tag2 - : Topic - } - isShortcut - selected={shouldSelectNavItem(location, pin)} - onClick={() => { - if (pin.type === "notebook") { - _navigate(`/notebooks/${pin.id}`); - } else if (pin.type === "topic") { - _navigate(`/notebooks/${pin.notebookId}/${pin.id}`); - } else if (pin.type === "tag") { - _navigate(`/tags/${pin.id}`); + + + {routes.map((item) => ( + { + if (!isMobile && location === item.path) + return toggleNavigationContainer(); + _navigate(item.path); + }} + /> + ))} + {colors.map((color) => ( + { + _navigate(`/colors/${color.id}`); + }} + menu={{ + items: [ + { + key: "rename", + title: () => "Rename color", + onClick: async ({ color }) => { + await showRenameColorDialog(color.id); + }, + }, + ], + extraData: { color }, + }} + /> + ))} + - ))} - + {pins.map((pin) => ( + "Remove shortcut", + onClick: async ({ pin }) => { + await db.settings.unpin(pin.id); + refreshNavItems(); + }, + }, + ], + extraData: { pin }, + }} + icon={ + pin.type === "notebook" + ? Notebook2 + : pin.type === "tag" + ? Tag2 + : Topic + } + isShortcut + selected={shouldSelectNavItem(location, pin)} + onClick={() => { + if (pin.type === "notebook") { + _navigate(`/notebooks/${pin.id}`); + } else if (pin.type === "topic") { + _navigate(`/notebooks/${pin.notebookId}/${pin.id}`); + } else if (pin.type === "tag") { + _navigate(`/tags/${pin.id}`); + } + }} + /> + ))} + + {theme === "light" ? (