language bug fixing2
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
// app/[lang]/layout.tsx
|
|
||||||
import { dir } from "i18next";
|
import { dir } from "i18next";
|
||||||
import Header from "@/components/nav_foot/header";
|
import Header from "@/components/nav_foot/header";
|
||||||
import Navbar from "@/components/nav_foot/navbar";
|
import Navbar from "@/components/nav_foot/navbar";
|
||||||
@@ -6,15 +5,18 @@ import Footer from "@/components/nav_foot/footer";
|
|||||||
import Contact from "@/components/pageParts/contact";
|
import Contact from "@/components/pageParts/contact";
|
||||||
import UpScrollIcon from "@/components/upScroll";
|
import UpScrollIcon from "@/components/upScroll";
|
||||||
|
|
||||||
export default function LangLayout({
|
export default async function LangLayout({
|
||||||
children,
|
children,
|
||||||
params,
|
params,
|
||||||
}: Readonly<{
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
params: { lang: "uz" | "ru" };
|
params: Promise<{ lang: "uz" | "ru" }>; // ✅ Promise shaklda
|
||||||
}>) {
|
}) {
|
||||||
|
const { lang } = await params; // ✅ await bilan destructuring
|
||||||
|
const direction = dir(lang) || "ltr";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang={params.lang} dir={dir(params.lang)}>
|
<html lang={lang} dir={direction}>
|
||||||
<body>
|
<body>
|
||||||
<Header />
|
<Header />
|
||||||
<Navbar />
|
<Navbar />
|
||||||
|
|||||||
Reference in New Issue
Block a user