Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

951-View dataroom folder tree list and documnet list ui fix (#952)

Ashish Viradiyac27f3f60b7e3
diff --git a/components/view/DataroomViewer.tsx b/components/view/DataroomViewer.tsx
index e7ed2092..1186c8f0 100644
--- a/components/view/DataroomViewer.tsx
+++ b/components/view/DataroomViewer.tsx
@@ -1,6 +1,4 @@
-import { useRouter } from "next/router";
-
-import { useEffect, useMemo, useState } from "react";
+import { useMemo, useState } from "react";
import React from "react";
import { DataroomBrand, DataroomFolder } from "@prisma/client";
@@ -16,7 +14,7 @@ import {
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
-import { ScrollArea } from "@/components/ui/scroll-area";
+import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import {
Sheet,
SheetOverlay,
@@ -156,24 +154,28 @@ export default function DataroomViewer({
>
<div className="relative mx-auto flex h-full w-full items-start justify-center">
{/* Tree view */}
- <div className="mb-10 mt-4 hidden h-full w-1/4 space-y-8 overflow-auto py-3 md:mx-5 md:mt-5 md:flex lg:mx-7 lg:mt-8 xl:mx-10">
- <ViewFolderTree
- folders={folders}
- documents={documents}
- setFolderId={setFolderId}
- folderId={folderId}
- />
+ <div className="hidden h-full w-1/4 space-y-8 overflow-auto px-3 pb-4 pt-4 md:flex md:px-6 md:pt-6 lg:px-8 lg:pt-9 xl:px-14">
+ <ScrollArea showScrollbar>
+ <ViewFolderTree
+ folders={folders}
+ documents={documents}
+ setFolderId={setFolderId}
+ folderId={folderId}
+ />
+ <ScrollBar orientation="horizontal" />
+ <ScrollBar orientation="vertical" />
+ </ScrollArea>
</div>
{/* Detail view */}
- <div className="h-full flex-grow">
- <div className="mb-10 mt-4 space-y-8 p-3 md:mx-5 md:mt-5 lg:mx-7 lg:mt-8 xl:mx-10">
+ <ScrollArea showScrollbar className="h-full flex-grow overflow-auto">
+ <div className="h-full space-y-8 px-3 pb-4 pt-4 md:px-6 md:pt-6 lg:px-8 lg:pt-9 xl:px-14">
<div className="flex items-center gap-x-2">
{/* sidebar for mobile */}
<div className="flex md:hidden">
<Sheet>
<SheetTrigger asChild>
- <button className="text-muted-foreground hover:text-black lg:hidden">
+ <button className="text-muted-foreground hover:text-white lg:hidden">
<PanelLeftIcon className="h-5 w-5" aria-hidden="true" />
</button>
</SheetTrigger>
@@ -236,11 +238,13 @@ export default function DataroomViewer({
</BreadcrumbList>
</Breadcrumb>
</div>
- <ul role="list" className="space-y-4">
+ <ul role="list" className="space-y-4 overflow-auto p-4">
{mixedItems.map(renderItem)}
</ul>
</div>
- </div>
+ <ScrollBar orientation="vertical" />
+ <ScrollBar orientation="horizontal" />
+ </ScrollArea>
</div>
</div>
</>