59 lines
1.2 KiB
TypeScript
59 lines
1.2 KiB
TypeScript
|
|
import "./globals.css";
|
|
import { Header } from "@/components/header";
|
|
import Footer from "@/components/footer";
|
|
import localFont from 'next/font/local';
|
|
import { CartProvider } from "@/components/context/cartcontext";
|
|
import { categoryService } from "@/public/src/services/categories/api";
|
|
import { CategoryProvider } from "@/components/context/categoryprovider";
|
|
import { AddressProvider } from "@/components/context/Addresscontext";
|
|
|
|
|
|
const Yekanbakh = localFont({
|
|
|
|
src: [
|
|
{
|
|
path: '../public/src/font/YekanBakhFaNum-Regular.woff',
|
|
weight: '400',
|
|
style: 'normal',
|
|
},
|
|
{
|
|
path: '../public/src/font/YekanBakhFaNum-SemiBold.woff',
|
|
weight: '500',
|
|
style: 'normal',
|
|
},
|
|
],
|
|
variable: '--font-site',
|
|
display: 'swap',
|
|
})
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode
|
|
}) {
|
|
|
|
|
|
const categories = await categoryService.getCategories();
|
|
return (
|
|
<html lang="fa" dir="rtl" className={Yekanbakh.variable}>
|
|
<body>
|
|
<AddressProvider>
|
|
|
|
<CartProvider>
|
|
<CategoryProvider>
|
|
|
|
<Header />
|
|
{children}
|
|
</CategoryProvider>
|
|
|
|
</CartProvider>
|
|
</AddressProvider>
|
|
|
|
|
|
<Footer/>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|