feat: Update NavigationBar to accept host as a prop and wrap in Suspense

This commit is contained in:
AmirReza Jamali
2025-11-18 16:28:27 +03:30
parent 4839c325a5
commit c66fa85075
2 changed files with 10 additions and 4 deletions
+7 -2
View File
@@ -1,7 +1,9 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import { headers } from "next/headers";
import Image from "next/image";
import Link from "next/link";
import { Suspense } from "react";
import { ToastContainer, Zoom } from "react-toastify";
import NavigationBar from "../_components/NavigationBar";
import "../globals.css";
@@ -75,6 +77,8 @@ export default async function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {
const domain = (await headers()).get("host");
const contactInfo = [
{
icon: "/Message.svg",
@@ -114,8 +118,9 @@ export default async function RootLayout({
/>
</Link>
</section>
<NavigationBar />
<Suspense>
<NavigationBar host={domain ?? "opplens.com"} />
</Suspense>
</header>
<ToastContainer