Skip to content

Commit

Permalink
Adds a sub layout to the /dashboard route and sets up a basic side nav
Browse files Browse the repository at this point in the history
  • Loading branch information
foxleigh81 committed Sep 20, 2024
1 parent 9dfef30 commit 23238f9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
31 changes: 31 additions & 0 deletions frontend/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type { Metadata } from "next";
import Link from "next/link";


export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};

export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {

return (
<div className="grid grid-cols-[300px_1fr] min-h-screen gap-1">
<nav className="bg-violet-500 text-white">
<ul className="flex flex-col gap-6 mt-5">
<li><Link className="block p-3 w-full h-full hover:bg-violet-600" href="/dashboard">Dashboard</Link></li>
<li><Link className="block p-3 w-full h-full hover:bg-violet-600" href="/dashboard/skills">Skills list</Link></li>
<li><Link className="block p-3 w-full h-full hover:bg-violet-600" href="/dashboard/history">Career history</Link></li>
<li><Link className="block p-3 w-full h-full hover:bg-violet-600" href="/dashboard/settings">Settings</Link></li>
</ul>
</nav>
<div className="flex flex-col p-6 pt-5">
{children}
</div>
</div>
);
}
9 changes: 3 additions & 6 deletions frontend/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,14 @@ export default async function RootLayout({
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<SessionProvider session={session}>
<div className="grid grid-rows-[auto_1fr_20px] min-h-screen gap-1 font-[family-name:var(--font-geist-sans)]">
<div className="grid grid-rows-[auto_1fr_20px] min-h-screen font-[family-name:var(--font-geist-sans)]">
<header className="flex flex-col w-full gap-4 row-start-1 items-start sm:items-start bg-violet-800 text-white p-5">
<div className="grid grid-cols-2 w-full">
<h1 className="flex flex-row place-items-center gap-2 text-3xl sm:text-4xl font-bold"><Image src="/cv-blaster-logo.svg" width={90} height={90} alt="CV Blaster logo" />CV Blaster!</h1>
<h1 className="flex flex-row place-items-center gap-2 text-3xl sm:text-4xl font-bold"><Image src="/cv-blaster-logo.svg" width={120} height={120} alt="CV Blaster logo" />CV Blaster!</h1>
<NavMenu />
</div>
<p className="text-lg text-center sm:text-left">
Generate a CV easily with a few clicks
</p>
</header>
<main className="flex flex-col p-4">
<main className="flex flex-col">
{children}
</main>
</div>
Expand Down

0 comments on commit 23238f9

Please sign in to comment.