From 133d3e3fc671e501a50148bfb2eabafb9e5d2900 Mon Sep 17 00:00:00 2001 From: leolab1337 <61798137+leolab1337@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:57:30 +0300 Subject: [PATCH] Simplify metadata generation in PictureGalleries page Replace manual translation calls with _getPage method to streamline SEO data retrieval. This reduces code complexity and ensures consistent metadata generation across different languages. --- .../src/app/[lng]/picture-galleries/page.tsx | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/frontend-next-migration/src/app/[lng]/picture-galleries/page.tsx b/frontend-next-migration/src/app/[lng]/picture-galleries/page.tsx index 2435d1793..be257e167 100644 --- a/frontend-next-migration/src/app/[lng]/picture-galleries/page.tsx +++ b/frontend-next-migration/src/app/[lng]/picture-galleries/page.tsx @@ -1,33 +1,23 @@ -import {default as PictureGalleriesPage } from "@/preparedPages/PictureGalleryPages"; import {Metadata} from "next"; -import {useServerTranslation} from "@/shared/i18n"; - - +import {default as PictureGalleriesPage } from "@/preparedPages/PictureGalleryPages"; +import {_getPage} from "./_getPage"; type Props = { params: { lng: string } } - export async function generateMetadata({ params }: Props): Promise { - - const { t } = await useServerTranslation(params.lng, 'picture-galleries'); - - return { - title: t("head-title"), - description: t("head-description"), - keywords: t("head-keywords"), - } + return await _getPage(params.lng).then(r => r.seo); } export default async function PictureGalleries({ params }: Props) { - const { t } = await useServerTranslation(params.lng, 'picture-galleries'); + const {page} = await _getPage(params.lng); return ( <> )