new web sayt
This commit is contained in:
26
app/[locale]/layout.tsx
Normal file
26
app/[locale]/layout.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
36
app/[locale]/page.tsx
Normal file
36
app/[locale]/page.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
"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 = [
|
||||
"/images/hero-pump-1.jpg",
|
||||
"/images/hero-pump-2.jpg",
|
||||
"/images/hero-pump-3.jpg",
|
||||
"/images/hero-pump-4.jpg",
|
||||
"/images/hero-pump-5.jpg",
|
||||
];
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main>
|
||||
<Navbar />
|
||||
<ShowCase
|
||||
titleKey="hero.title"
|
||||
subtitleKey="hero.subtitle"
|
||||
ctaLabelKey="hero.cta"
|
||||
images={HERO_IMAGES}
|
||||
/>
|
||||
<About />
|
||||
<ProductsGrid />
|
||||
<FAQ />
|
||||
<ContactForm />
|
||||
<Footer />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user