diff --git a/mon-entreprise/source/components/utils/Meta.tsx b/mon-entreprise/source/components/utils/Meta.tsx index 0111ffa06..f2425fde7 100644 --- a/mon-entreprise/source/components/utils/Meta.tsx +++ b/mon-entreprise/source/components/utils/Meta.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { useLocation } from 'react-router' type PropType = { - page: string, + page: string title: string description: string ogDescription?: string @@ -20,21 +20,26 @@ export default function Meta({ ogImage, }: PropType) { const { pathname } = useLocation() - const { t } = useTranslation() + const { t, i18n } = useTranslation() const meta = { title: t(`${page}.titre`, title) || title, description: t(`${page}.description`, description) || description, - ogDescription: ogDescription ? t(`${page}.ogDescription`, ogDescription) || ogDescription : description, + ogDescription: ogDescription + ? t(`${page}.ogDescription`, ogDescription) || ogDescription + : description, ogTitle: ogTitle ? t(`${page}.ogTitle`, ogTitle) || ogTitle : title, ogImage: ogImage ? t(`${page}.ogImage`, ogImage) || ogImage : null, } return ( - + {meta.title} - + {meta.ogImage && (