Enforce maintenance mode in site layout instead of middleware fetch
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-06 15:34:51 +01:00
parent 90ca6d11ff
commit 59bc4a6563
2 changed files with 14 additions and 87 deletions
+14 -1
View File
@@ -1,13 +1,26 @@
import type { ReactNode } from "react";
import { redirect } from "next/navigation";
import { Footer } from "@/components/footer";
import { Navbar } from "@/components/navbar";
import { getMaintenanceMode } from "@/lib/app-config";
import { resolveLocale } from "@/lib/site-data";
type SiteLayoutProps = {
children: ReactNode;
params: {
locale: string;
};
};
export default function SiteLayout({ children }: SiteLayoutProps) {
export default async function SiteLayout({ children, params: { locale } }: SiteLayoutProps) {
const localeKey = resolveLocale(locale);
const maintenanceEnabled = await getMaintenanceMode();
if (maintenanceEnabled) {
redirect(`/${localeKey}/coming-soon`);
}
return (
<div className="flex min-h-screen flex-col">
<Navbar />