mirror of
https://github.com/DerTyp7/explainegy-nextjs.git
synced 2025-10-29 04:42:12 +01:00
add admin link above header
This commit is contained in:
@@ -6,6 +6,7 @@ import Footer from "./Footer";
|
||||
import { Category } from "@prisma/client";
|
||||
import urlJoin from "url-join";
|
||||
import { apiUrl } from "./global";
|
||||
import Link from "next/link";
|
||||
|
||||
async function getCategories(): Promise<Category[]> {
|
||||
const result: Response = await fetch(urlJoin(apiUrl, `categories`), {
|
||||
@@ -22,7 +23,9 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
<head></head>
|
||||
|
||||
<body className="body">
|
||||
<p>If admin logged in create a small header here app/layout.tsx</p>
|
||||
<div>
|
||||
<Link href={"/admin"}> Admin</Link>
|
||||
</div>
|
||||
<header>
|
||||
<Nav categories={await getCategories()} />
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user