Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions components/view/DataroomViewer.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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,
Expand Down Expand Up @@ -153,24 +151,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>
Expand Down Expand Up @@ -233,11 +235,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>
</>
Expand Down