Use of Server Component for Navbar fetching
This commit is contained in:
parent
5bd4f2aab3
commit
c4aa0dc93c
2 changed files with 22 additions and 3 deletions
app
|
@ -1,20 +1,23 @@
|
|||
import './globals.css'
|
||||
import { PageNavbar } from '@/components/navbar'
|
||||
import * as fs from 'fs';
|
||||
|
||||
export const metadata = {
|
||||
title: 'Stellaris Ethics Compass',
|
||||
description: '',
|
||||
}
|
||||
|
||||
export default function RootLayout({
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
const navLinks = JSON.parse(fs.readFileSync('public/routes_api.json', 'utf-8')).links;
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>
|
||||
<PageNavbar />
|
||||
<PageNavbar links={navLinks}/>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
|
|
Reference in a new issue