init create-fias

This commit is contained in:
Samandar Turgunboyev
2025-12-12 11:21:30 +05:00
commit a5b46a9f26
76 changed files with 36104 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
import type { Metadata } from 'next';
import '../globals.css';
import { golosText } from '@/shared/config/fonts';
import { ThemeProvider } from '@/shared/config/theme-provider';
import { PRODUCT_INFO } from '@/shared/constants/data';
import { hasLocale, Locale, NextIntlClientProvider } from 'next-intl';
import { routing } from '@/shared/config/i18n/routing';
import { notFound } from 'next/navigation';
import Footer from '@/widgets/footer/ui';
import Navbar from '@/widgets/navbar/ui';
import { ReactNode } from 'react';
import { setRequestLocale } from 'next-intl/server';
import QueryProvider from '@/shared/config/react-query/QueryProvider';
import Script from 'next/script';
export const metadata: Metadata = {
title: PRODUCT_INFO.name,
description: PRODUCT_INFO.description,
icons: PRODUCT_INFO.favicon,
};
type Props = {
children: ReactNode;
params: Promise<{ locale: Locale }>;
};
export function generateStaticParams() {
return routing.locales.map((locale) => ({ locale }));
}
export default async function RootLayout({ children, params }: Props) {
const { locale } = await params;
if (!hasLocale(routing.locales, locale)) {
notFound();
}
// Enable static rendering
setRequestLocale(locale);
return (
<html lang={locale} suppressHydrationWarning>
<body className={`${golosText.variable} antialiased`}>
<NextIntlClientProvider locale={locale}>
<ThemeProvider
attribute={'class'}
defaultTheme="light"
enableSystem
disableTransitionOnChange
>
<QueryProvider>
<Navbar />
{children}
<Footer />
</QueryProvider>
</ThemeProvider>
</NextIntlClientProvider>
</body>
<Script
src="https://buttons.github.io/buttons.js"
strategy="lazyOnload"
async
defer
/>
</html>
);
}

13
src/app/[locale]/page.tsx Normal file
View File

@@ -0,0 +1,13 @@
import { getPosts } from '@/shared/config/api/testApi';
import Welcome from '@/widgets/welcome';
export default async function Home() {
const res = await getPosts({ _limit: 1 });
console.log('SSR res', res.data);
return (
<div>
<Welcome />
</div>
);
}