Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Revamping Sidebar #1162

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
moved breadcrumb to sidebar inset
Signed-off-by: JeevaRamanathan <[email protected]>
JeevaRamanathan committed Nov 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 3d8f51d9e3ae86800f196bb9ff205c20ba40aa8f
52 changes: 43 additions & 9 deletions components/layouts/app.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
import { useRouter } from "next/router";

import { useIsMobile } from "@/hooks/use-mobile";

import AppSidebar from "@/components/Sidebar";
import { BreadcrumbComponent } from "@/components/documents/breadcrumb";
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
import { Separator } from "@/components/ui/separator";
import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar";
import {
SidebarInset,
SidebarProvider,
SidebarTrigger,
} from "@/components/ui/sidebar";

import ProfileMenu from "../profile-menu";
import TrialBanner from "./trial-banner";

export default function AppLayout({ children }: { children: React.ReactNode }) {
const isMobile = useIsMobile();
const router = useRouter();
const isDocumentsPage = router.pathname.startsWith("/documents");
return (
<div className="flex min-h-screen flex-col bg-gray-50 dark:bg-black lg:flex-row">
<SidebarProvider>
@@ -18,16 +35,33 @@ export default function AppLayout({ children }: { children: React.ReactNode }) {
<TrialBanner />
<main className="h-100dvh flex-1 lg:h-dvh lg:p-2">
<div className="h-full overflow-y-auto rounded-xl bg-white ring-1 ring-gray-200 dark:border-none dark:bg-gray-900 dark:ring-gray-800">
<div className="sticky top-0 z-50 ml-2 bg-white pt-2 dark:bg-gray-900">
<div className="flex items-center justify-between">
<SidebarTrigger />
{/* <div className="sticky top-0 z-50 ml-2 bg-white pt-2 dark:bg-gray-900"> */}
{/* <div className="flex items-center justify-between"> */}
{/* <SidebarTrigger /> */}

{/* {isMobile && <ProfileMenu size="small" />} */}
{/* </div> */}
{/* <Separator /> */}
{/* </div> */}

{isMobile && <ProfileMenu size="small" />}
</div>
<Separator />
</div>
<SidebarInset>
<header className="flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-16">
<div className="flex items-center gap-2 px-4">
<SidebarTrigger className="-ml-1" />

{children}
{isDocumentsPage && (
<>
<Separator
orientation="vertical"
className="mr-2 h-4"
/>
<BreadcrumbComponent />
</>
)}
</div>
</header>
{children}
</SidebarInset>
</div>
</main>
</div>
2 changes: 1 addition & 1 deletion pages/documents/index.tsx
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ export default function Documents() {

return (
<AppLayout>
<div className="sticky top-0 bg-white p-4 pb-0 dark:bg-gray-900 sm:mx-4 sm:pt-8">
<div className="sticky top-0 bg-white p-4 pb-0 dark:bg-gray-900 sm:mx-4">
<section className="mb-4 flex items-center justify-between space-x-2 sm:space-x-0">
<div className="space-y-0 sm:space-y-1">
<h2 className="text-xl font-semibold tracking-tight text-foreground sm:text-2xl">
6 changes: 2 additions & 4 deletions pages/documents/tree/[...name].tsx
Original file line number Diff line number Diff line change
@@ -23,15 +23,13 @@ export default function DocumentTreePage() {

return (
<AppLayout>
<main className="p-4 sm:m-4 sm:px-4 sm:py-4">
<BreadcrumbComponent />

<main className="p-4 pt-0 sm:m-4 sm:mt-0 sm:px-4 sm:pb-4">
<section className="mb-4 mt-4 flex items-center justify-between md:mb-8 lg:mb-12">
<div className="space-y-1">
<h2 className="text-xl font-semibold tracking-tight text-foreground sm:text-2xl">
All Documents
</h2>
<p className="text-xs text-muted-foreground sm:text-sm">
<p className="text-xs leading-4 text-muted-foreground sm:text-sm sm:leading-none">
Manage all your documents in one place.
</p>
</div>