Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingCalm committed Jan 25, 2024
1 parent a41089e commit 7b72bb5
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/dashboard/customers/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <p>Customers Page</p>;
}
3 changes: 3 additions & 0 deletions app/dashboard/invoices/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <p>Invoices Page</p>;
}
12 changes: 12 additions & 0 deletions app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import SideNav from '@/app/ui/dashboard/sidenav';

export default function Layout({ children }: { children: React.ReactNode }) {
return (
<div className="flex h-screen flex-col md:flex-row md:overflow-hidden">
<div className="w-full flex-none md:w-64">
<SideNav />
</div>
<div className="flex-grow p-6 md:overflow-y-auto md:p-12">{children}</div>
</div>
);
}
3 changes: 3 additions & 0 deletions app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <p>Dashboard Page</p>;
}
17 changes: 14 additions & 3 deletions app/ui/dashboard/nav-links.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
'use client';
import {
UserGroupIcon,
HomeIcon,
DocumentDuplicateIcon,
} from '@heroicons/react/24/outline';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import clsx from 'clsx';


// Map of links to display in the side navigation.
// Depending on the size of the application, this would be stored in a database.
Expand All @@ -17,19 +22,25 @@ const links = [
];

export default function NavLinks() {
const pathname = usePathname();
return (
<>
{links.map((link) => {
const LinkIcon = link.icon;
return (
<a
<Link
key={link.name}
href={link.href}
className="flex h-[48px] grow items-center justify-center gap-2 rounded-md bg-gray-50 p-3 text-sm font-medium hover:bg-sky-100 hover:text-blue-600 md:flex-none md:justify-start md:p-2 md:px-3"
className={clsx(
'flex h-[48px] grow items-center justify-center gap-2 rounded-md bg-gray-50 p-3 text-sm font-medium hover:bg-sky-100 hover:text-blue-600 md:flex-none md:justify-start md:p-2 md:px-3',
{
'bg-sky-100 text-blue-600': pathname === link.href,
},
)}
>
<LinkIcon className="w-6" />
<p className="hidden md:block">{link.name}</p>
</a>
</Link>
);
})}
</>
Expand Down

0 comments on commit 7b72bb5

Please sign in to comment.