Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 7 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Metadata } from "next";
import { Geist, Geist_Mono, Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({subsets:['latin'],variable:'--font-sans'});
const inter = Inter({ subsets: ['latin'], variable: '--font-sans' });

const geistSans = Geist({
variable: "--font-geist-sans",
Expand All @@ -15,8 +15,12 @@ const geistMono = Geist_Mono({
});

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "RxLab Auth",
description: "RxLab Auth is a simple authentication system for RxLab",
openGraph: {
title: "RxLab Auth",
description: "RxLab Auth is a simple authentication system for RxLab",
},
};

export default function RootLayout({
Expand Down
8 changes: 2 additions & 6 deletions components/dashboard/dashboard-shell.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { headers } from "next/headers";
import { DashboardHeader } from "./dashboard-header";
import { SidebarNav } from "./sidebar-nav";
import type { NavItem } from "./types";
Expand All @@ -12,17 +11,14 @@ interface DashboardShellProps {
homeHref: string;
}

export async function DashboardShell({
export function DashboardShell({
children,
title,
logo,
navItems,
headerRight,
homeHref,
}: DashboardShellProps) {
const headersList = await headers();
const currentPath = headersList.get("x-pathname") || "/";

return (
<div className="min-h-screen bg-background">
<DashboardHeader
Expand All @@ -34,7 +30,7 @@ export async function DashboardShell({
/>

<div className="container mx-auto flex gap-8 px-4 py-6 sm:px-6 lg:py-8">
<SidebarNav navItems={navItems} currentPath={currentPath} />
<SidebarNav navItems={navItems} />
<main className="flex-1 min-w-0">{children}</main>
</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions components/dashboard/sidebar-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"use client";

import Link from "next/link";
import { usePathname } from "next/navigation";
import {
User,
KeyRound,
Expand All @@ -19,10 +22,10 @@ const iconMap: Record<string, typeof User> = {

interface SidebarNavProps {
navItems: NavItem[];
currentPath: string;
}

export function SidebarNav({ navItems, currentPath }: SidebarNavProps) {
export function SidebarNav({ navItems }: SidebarNavProps) {
const currentPath = usePathname();
return (
<aside className="hidden md:flex w-56 shrink-0 flex-col gap-1">
{navItems.map((item) => {
Expand Down
Loading