mirror of
https://github.com/DerTyp7/explainegy-nextjs.git
synced 2025-10-29 21:02:13 +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 { Category } from "@prisma/client";
|
||||||
import urlJoin from "url-join";
|
import urlJoin from "url-join";
|
||||||
import { apiUrl } from "./global";
|
import { apiUrl } from "./global";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
async function getCategories(): Promise<Category[]> {
|
async function getCategories(): Promise<Category[]> {
|
||||||
const result: Response = await fetch(urlJoin(apiUrl, `categories`), {
|
const result: Response = await fetch(urlJoin(apiUrl, `categories`), {
|
||||||
@@ -22,7 +23,9 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
|||||||
<head></head>
|
<head></head>
|
||||||
|
|
||||||
<body className="body">
|
<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>
|
<header>
|
||||||
<Nav categories={await getCategories()} />
|
<Nav categories={await getCategories()} />
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Reference in New Issue
Block a user