Fix Coming soon
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { notFound } from "next/navigation";
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
import BottomNav from "@/components/BottomNav";
|
||||
import SiteFooter from "@/components/SiteFooter";
|
||||
import SiteHeader from "@/components/SiteHeader";
|
||||
import { getDictionary, getDirection, isLocale, locales, type Locale } from "@/lib/i18n";
|
||||
import { getActiveLocale, getDictionary, getDirection, getEnabledLocales, isLocale, type Locale } from "@/lib/i18n";
|
||||
import { isComingSoonMode } from "@/lib/site";
|
||||
|
||||
export const dynamicParams = false;
|
||||
|
||||
export function generateStaticParams() {
|
||||
return locales.map((locale) => ({ locale }));
|
||||
return getEnabledLocales().map((locale) => ({ locale }));
|
||||
}
|
||||
|
||||
export default function LocaleLayout({
|
||||
@@ -22,7 +23,11 @@ export default function LocaleLayout({
|
||||
notFound();
|
||||
}
|
||||
|
||||
const locale = params.locale as Locale;
|
||||
if (isComingSoonMode()) {
|
||||
redirect("/");
|
||||
}
|
||||
|
||||
const locale = getActiveLocale(params.locale as Locale);
|
||||
const dictionary = getDictionary(locale);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user