diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx deleted file mode 100644 index 5e1ac23..0000000 --- a/app/[locale]/layout.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { ReactNode } from "react"; -import { notFound } from "next/navigation"; -import { locales } from "@/i18n.config"; - -export function generateStaticParams() { - return locales.map((locale) => ({ locale })); -} - -interface LocaleLayoutProps { - children: ReactNode; - params: Promise<{ - locale: string; - }>; -} - -async function LocaleLayout({ children, params }: LocaleLayoutProps) { - const { locale } = await params; - - if (!locales.includes(locale as any)) { - notFound(); - } - - return <>{children}; -} - -export default LocaleLayout; diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx deleted file mode 100644 index 387ba27..0000000 --- a/app/[locale]/page.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; - -import { Navbar } from "@/components/Navbar"; -import { ShowCase } from "@/components/ShowCase"; -import { About } from "@/components/About"; -import { ProductsGrid } from "@/components/ProductsGrid"; -import { FAQ } from "@/components/FAQ"; -import { ContactForm } from "@/components/ContactForm"; -import { Footer } from "@/components/Footer"; - -const HERO_IMAGES = [ - "/product/product.jpg", - "/product/product.jpg", - "/product/product.jpg", - "/product/product.jpg", - "/product/product.jpg", -]; - -export default function Home() { - return ( -
- - - - - - -
- ); -} diff --git a/app/layout.tsx b/app/layout.tsx index 5cea82a..e33fd6c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,48 +1,18 @@ -import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; + + import { ReactNode } from "react"; -import { NextIntlClientProvider } from "next-intl"; -import { getMessages } from "next-intl/server"; -import "./globals.css"; - -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); - -export const metadata: Metadata = { - title: "Firma - Industrial Equipment & Pumps", - description: - "Premium industrial pumps and equipment supplier with 10+ years of experience", -}; - -async function RootLayout({ - children, - params, -}: Readonly<{ - children: ReactNode; - params: Promise>; -}>) { - const resolvedParams = await params; - const locale = resolvedParams.locale || "uz"; - const messages = await getMessages(); +import "../i18n/request"; // i18n config faylini import qilamiz +import { LanguageProvider } from "@/context/language-context"; +import './globals.css' +export default function RootLayout({ children }: { children: ReactNode }) { return ( - - - + + + {children} - + ); } - -export default RootLayout; diff --git a/app/page.tsx b/app/page.tsx index 5813ded..d1513c7 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,5 +1,32 @@ -import { redirect } from "next/navigation"; +"use client"; + +import { Navbar } from "@/components/Navbar"; +import { ShowCase } from "@/components/ShowCase"; +import { About } from "@/components/About"; +import { ProductsGrid } from "@/components/ProductsGrid"; +import { FAQ } from "@/components/FAQ"; +import { ContactForm } from "@/components/ContactForm"; +import { Footer } from "@/components/Footer"; + +const HERO_IMAGES = [ + "/product/product.jpg", + "/product/product1.jpg", + "/product/product2.jpg", + "/product/product3.jpg", +]; export default function Home() { - redirect('/uz') + return ( +
+ + + + + + +
+
+ ); } diff --git a/components/About.tsx b/components/About.tsx index 79cdd37..dfa7eaf 100644 --- a/components/About.tsx +++ b/components/About.tsx @@ -1,11 +1,11 @@ "use client"; +import { useLanguage } from "@/context/language-context"; import { motion } from "framer-motion"; import { CheckCircle, Award, Users, Zap } from "lucide-react"; -import { useTranslations } from "next-intl"; export function About() { - const t = useTranslations(); + const {t} = useLanguage(); const features = [ { icon: Award, labelKey: "Experience", value: "10+ лет" }, @@ -37,7 +37,7 @@ export function About() { className="text-center mb-16" >

- {t("about.title")} + {t.about.title}

@@ -51,7 +51,7 @@ export function About() { viewport={{ once: true }} >

- {t("about.content")} + {t.about.content}

- {t("contact.title")} + {t.contact.title}

@@ -155,14 +155,14 @@ export function ContactForm() { {/* Name */}
@@ -170,14 +170,14 @@ export function ContactForm() { {/* Phone */}
@@ -186,13 +186,13 @@ export function ContactForm() { {/* Message */}