Load site meta tags and trust badges from Meshkee business info.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
cd88e0ce46
commit
b4d6b30243
+18
-7
@@ -6,6 +6,7 @@ import { Header } from "@/components/layout/Header";
|
||||
import { Footer } from "@/components/layout/Footer";
|
||||
import { getNavCategories } from "@/lib/categories";
|
||||
import { getLogoSrc } from "@/lib/media";
|
||||
import { getBusinessInfo, metaTagsToOther } from "@/lib/meshkee";
|
||||
|
||||
const vazir = Vazirmatn({
|
||||
subsets: ["arabic", "latin"],
|
||||
@@ -14,14 +15,24 @@ const vazir = Vazirmatn({
|
||||
weight: ["300", "400", "500", "600", "700", "800"],
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "داروخانه دکتر ارجمند | صفحه اصلی",
|
||||
description:
|
||||
"خرید آنلاین دارو، مکمل، محصولات بهداشتی و آرایشی از داروخانه دکتر ارجمند در قم، سالاریه.",
|
||||
};
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const businessInfo = await getBusinessInfo();
|
||||
const other = metaTagsToOther(businessInfo?.metaTags);
|
||||
|
||||
return {
|
||||
title: "داروخانه دکتر ارجمند | صفحه اصلی",
|
||||
description:
|
||||
"خرید آنلاین دارو، مکمل، محصولات بهداشتی و آرایشی از داروخانه دکتر ارجمند در قم، سالاریه.",
|
||||
...(other ? { other } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
const [logoSrc, categories] = await Promise.all([Promise.resolve(getLogoSrc()), getNavCategories()]);
|
||||
const [logoSrc, categories, businessInfo] = await Promise.all([
|
||||
Promise.resolve(getLogoSrc()),
|
||||
getNavCategories(),
|
||||
getBusinessInfo(),
|
||||
]);
|
||||
|
||||
return (
|
||||
<html lang="fa" dir="rtl" className={vazir.variable}>
|
||||
@@ -37,7 +48,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
<TopBar />
|
||||
<Header logoSrc={logoSrc} categories={categories} />
|
||||
<main className="pb-12">{children}</main>
|
||||
<Footer logoSrc={logoSrc} />
|
||||
<Footer logoSrc={logoSrc} trustBadges={businessInfo?.trustBadges} />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user