Merge branch 'develop' of https://git.witel.ir/witel-flix/frontend into develop

This commit is contained in:
2026-04-15 12:49:03 +03:30
22 changed files with 386 additions and 280 deletions

View File

@@ -1,38 +1,38 @@
import { getDirection } from '@/i18n/direction'
import { routing } from '@/i18n/routing'
import { ClientAppProvider } from '@/providers/ClientAppProvider'
import '@/styles/globals.css'
import type { Metadata } from 'next'
import { hasLocale, NextIntlClientProvider } from 'next-intl'
import { getMessages } from 'next-intl/server'
import { notFound } from 'next/navigation'
import { getDirection } from "@/i18n/direction";
import { routing } from "@/i18n/routing";
import { ClientAppProvider } from "@/providers/ClientAppProvider";
import "@/styles/globals.css";
import type { Metadata } from "next";
import { hasLocale, NextIntlClientProvider } from "next-intl";
import { getMessages } from "next-intl/server";
import { notFound } from "next/navigation";
export const metadata: Metadata = {
title: 'Theater of dreams',
}
title: "Theater of dreams",
};
export default async function RootLayout({
children,
params,
children,
params,
}: Readonly<{
children: React.ReactNode
params: Promise<{ locale: string }>
children: React.ReactNode;
params: Promise<{ locale: string }>;
}>) {
const { locale } = await params
if (!hasLocale(routing.locales, locale)) {
notFound()
}
const { locale } = await params;
if (!hasLocale(routing.locales, locale)) {
notFound();
}
const messages = await getMessages()
const dir = getDirection(locale)
const messages = await getMessages();
const dir = getDirection(locale);
return (
<html dir={dir} lang={locale} suppressHydrationWarning>
<head>
{/* Prevent theme flicker before hydration */}
<script
dangerouslySetInnerHTML={{
__html: `
return (
<html dir={dir} lang={locale} suppressHydrationWarning>
<head>
{/* Prevent theme flicker before hydration */}
<script
dangerouslySetInnerHTML={{
__html: `
(function() {
try {
const stored = localStorage.getItem('theme');
@@ -41,15 +41,15 @@ export default async function RootLayout({
} catch (e) {}
})();
`,
}}
/>
</head>
}}
/>
</head>
<body className='bg-primary'>
<NextIntlClientProvider locale={locale} messages={messages}>
<ClientAppProvider>{children}</ClientAppProvider>
</NextIntlClientProvider>
</body>
</html>
)
<body className="bg-primary">
<NextIntlClientProvider locale={locale} messages={messages}>
<ClientAppProvider>{children}</ClientAppProvider>
</NextIntlClientProvider>
</body>
</html>
);
}

View File

@@ -1,13 +1,14 @@
import ThemeToggle from '@/components/UI/ThemeToggle'
import { useTranslations } from 'next-intl'
import ThemeToggle from "@/components/UI/ThemeToggle";
import { useTranslations } from "next-intl";
export default function Home() {
const t = useTranslations('Home')
return (
<main>
<ThemeToggle />
<h1>{t('title')}</h1>
<p>This project was generated completely offline.</p>
</main>
)
const t = useTranslations("Home");
return (
<main>
<ThemeToggle />
<h1>{t("title")}</h1>
<p>This project was generated completely offline.</p>
</main>
);
}

39
src/app/not-found.tsx Normal file
View File

@@ -0,0 +1,39 @@
import Link from "next/link";
export default function NotFound() {
return (
<div className="bg-pwa-primary text-text flex min-h-screen items-center justify-center">
<div className="bg-pwa-primary mx-4 w-full max-w-md rounded-xl p-8 text-center">
{/* آیکون خطا */}
{/*<div className="mb-4 flex justify-center">*/}
{/* <svg*/}
{/* xmlns="http://www.w3.org/2000/svg"*/}
{/* className="h-16 w-16 text-core-red"*/}
{/* fill="none"*/}
{/* viewBox="0 0 24 24"*/}
{/* stroke="currentColor"*/}
{/* >*/}
{/* <path*/}
{/* strokeLinecap="round"*/}
{/* strokeLinejoin="round"*/}
{/* strokeWidth={2}*/}
{/* d="M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"*/}
{/* />*/}
{/* </svg>*/}
{/*</div>*/}
{/* متن خطا */}
<h2 className="text-text mb-2 text-2xl font-bold">صفحه مورد نظر یافت نشد</h2>
<p className="text-text mb-6 leading-relaxed">متاسفانه صفحهای مورد نظر وجود ندارد.</p>
{/* دکمه بازگشت با استفاده از کامپوننت Link */}
<Link
href="/"
className="bg-neo-aqua hover:bg-neo-aqua/70 inline-block rounded-lg px-6 py-3 font-medium text-white shadow-md transition-colors duration-200 hover:shadow-lg"
>
بازگشت به صفحه اصلی
</Link>
</div>
</div>
);
}