Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat: cleanup sidebar and add shortcut
Marc Seitz4c77782e4aa4
diff --git a/components/datarooms/dataroom-breadcrumb.tsx b/components/datarooms/dataroom-breadcrumb.tsxindex 5ac90f8a..c28c6825 100644--- a/components/datarooms/dataroom-breadcrumb.tsx+++ b/components/datarooms/dataroom-breadcrumb.tsx@@ -48,7 +48,7 @@ function BreadcrumbComponentBase({<BreadcrumbSeparator /><BreadcrumbItem><BreadcrumbLink asChild>- <Link href={`/datarooms/${dataroomId}`}>+ <Link href={`/datarooms/${dataroomId}/documents`}>{dataroom?.name || "Loading..."}</Link></BreadcrumbLink>diff --git a/components/layouts/breadcrumb.tsx b/components/layouts/breadcrumb.tsxindex d73eabd6..8433b48c 100644--- a/components/layouts/breadcrumb.tsx+++ b/components/layouts/breadcrumb.tsx@@ -27,7 +27,7 @@ import useViewer from "@/lib/swr/use-viewer";const FOLDERS_TO_DISPLAY = 1; // Only show the last folder in the path-const SingleDocumentBreadcrumb = ({ documentId }: { documentId: string }) => {+const SingleDocumentBreadcrumb = () => {const { document } = useDocument();const { folders } = useFolderWithParents({name: document?.folder?.path ? [document.folder.path] : [],@@ -136,7 +136,9 @@ const SingleDataroomBreadcrumb = ({ path }: { path: string }) => {<BreadcrumbSeparator /><BreadcrumbItem><BreadcrumbLink asChild>- <Link href={`/datarooms/${dataroom?.id}`}>{dataroom?.name}</Link>+ <Link href={`/datarooms/${dataroom?.id}/documents`}>+ {dataroom?.name}+ </Link></BreadcrumbLink></BreadcrumbItem><BreadcrumbSeparator />@@ -345,7 +347,7 @@ export const AppBreadcrumb = () => {// Single document routeif (path === "/documents/[id]" && id) {- return <SingleDocumentBreadcrumb documentId={id} />;+ return <SingleDocumentBreadcrumb />;}// Dataroom document routesdiff --git a/components/sidebar/app-sidebar.tsx b/components/sidebar/app-sidebar.tsxindex 72c753ad..aaf118bf 100644--- a/components/sidebar/app-sidebar.tsx+++ b/components/sidebar/app-sidebar.tsx@@ -9,26 +9,12 @@ import { useEffect, useState } from "react";import { TeamContextType, initialState, useTeam } from "@/context/team-context";import Cookies from "js-cookie";import {- AudioWaveform,- BookOpen,- Bot,BrushIcon,CogIcon,- Command,ContactIcon,FolderIcon,- Frame,- GalleryVerticalEnd,- LifeBuoy,Loader,- Map,- PaletteIcon,- PieChart,- Send,ServerIcon,- Settings2,- SquareTerminal,- SwatchBookIcon,} from "lucide-react";import { NavMain } from "@/components/sidebar/nav-main";@@ -40,9 +26,7 @@ import {SidebarFooter,SidebarHeader,SidebarMenu,- SidebarMenuButton,SidebarMenuItem,- SidebarTrigger,} from "@/components/ui/sidebar";import { usePlan } from "@/lib/swr/use-billing";diff --git a/components/ui/sidebar.tsx b/components/ui/sidebar.tsxindex e0902afe..5834dca9 100644--- a/components/ui/sidebar.tsx+++ b/components/ui/sidebar.tsx@@ -24,7 +24,7 @@ const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;const SIDEBAR_WIDTH = "16rem";const SIDEBAR_WIDTH_MOBILE = "18rem";const SIDEBAR_WIDTH_ICON = "3rem";-const SIDEBAR_KEYBOARD_SHORTCUT = "b";+const SIDEBAR_KEYBOARD_SHORTCUT = "[";type SidebarContext = {state: "expanded" | "collapsed";@@ -99,10 +99,7 @@ const SidebarProvider = React.forwardRef<// Adds a keyboard shortcut to toggle the sidebar.React.useEffect(() => {const handleKeyDown = (event: KeyboardEvent) => {- if (- event.key === SIDEBAR_KEYBOARD_SHORTCUT &&- (event.metaKey || event.ctrlKey)- ) {+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT) {event.preventDefault();toggleSidebar();}