Skip to content

Commit

Permalink
simplify layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Lodimup committed Feb 19, 2024
1 parent ca5b98b commit 0ab35b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
11 changes: 2 additions & 9 deletions app/app/(dashboard)/dashboard/_components/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ const SIDEBAR_ITEMS = [
},
];

interface SettingsLayoutProps {
children: React.ReactNode;
}

export default async function DashboardLayout({
children,
}: SettingsLayoutProps) {
export default async function Navbar() {
const session = await auth();
return (
<div className="flex flex-row space-x-12 space-y-0">
<div className="flex flex-row space-x-12 space-y-0 mr-4">
<aside className="-mx-4 min-h-dvh bg-slate-100">
<div className="flex flex-col items-center justify-center p-4 gap-4">
<Image
Expand All @@ -40,7 +34,6 @@ export default async function DashboardLayout({
</div>
<SidebarNav items={SIDEBAR_ITEMS} className="pr-1" />
</aside>
<div className="flex-1">{children}</div>
</div>
);
}
9 changes: 7 additions & 2 deletions app/app/(dashboard)/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import DashboardLayout from "./_components/navbar";
import Navbar from "./_components/navbar";

export default function Layout({ children }: { children: React.ReactNode }) {
return <DashboardLayout>{children}</DashboardLayout>;
return (
<>
<Navbar />
<div className="w-full pl-4 pt-4">{children}</div>
</>
);
}

0 comments on commit 0ab35b9

Please sign in to comment.