From 82d310403c4bb09bc2f0a204b6374934a10cf348 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Sat, 29 Jan 2022 23:38:13 +0100
Subject: refactor(config): move config from config dir to utils

---
 src/pages/contact.tsx | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

(limited to 'src/pages/contact.tsx')

diff --git a/src/pages/contact.tsx b/src/pages/contact.tsx
index 489135d..e410afa 100644
--- a/src/pages/contact.tsx
+++ b/src/pages/contact.tsx
@@ -4,10 +4,10 @@ import { getLayout } from '@components/Layouts/Layout';
 import PostHeader from '@components/PostHeader/PostHeader';
 import Sidebar from '@components/Sidebar/Sidebar';
 import { SocialMedia } from '@components/Widgets';
-import { config } from '@config/website';
 import { sendMail } from '@services/graphql/mutations';
 import styles from '@styles/pages/Page.module.scss';
 import { NextPageWithLayout } from '@ts/types/app';
+import { settings } from '@utils/config';
 import { getIntlInstance, loadTranslation } from '@utils/helpers/i18n';
 import { GetStaticProps, GetStaticPropsContext } from 'next';
 import Head from 'next/head';
@@ -68,7 +68,7 @@ const ContactPage: NextPageWithLayout = () => {
       defaultMessage: 'Contact form - {websiteName}',
       description: 'ContactPage: SEO - Page title',
     },
-    { websiteName: config.name }
+    { websiteName: settings.name }
   );
   const pageDescription = intl.formatMessage(
     {
@@ -76,9 +76,9 @@ const ContactPage: NextPageWithLayout = () => {
         "Contact {websiteName} through its website. All you need to do it's to fill the contact form.",
       description: 'ContactPage: SEO - Meta description',
     },
-    { websiteName: config.name }
+    { websiteName: settings.name }
   );
-  const pageUrl = `${config.url}${router.asPath}`;
+  const pageUrl = `${settings.url}${router.asPath}`;
   const title = intl.formatMessage({
     defaultMessage: 'Contact',
     description: 'ContactPage: page title',
@@ -91,25 +91,25 @@ const ContactPage: NextPageWithLayout = () => {
   const webpageSchema: WebPage = {
     '@id': `${pageUrl}`,
     '@type': 'WebPage',
-    breadcrumb: { '@id': `${config.url}/#breadcrumb` },
+    breadcrumb: { '@id': `${settings.url}/#breadcrumb` },
     name: pageTitle,
     description: pageDescription,
-    reviewedBy: { '@id': `${config.url}/#branding` },
+    reviewedBy: { '@id': `${settings.url}/#branding` },
     url: `${pageUrl}`,
     isPartOf: {
-      '@id': `${config.url}`,
+      '@id': `${settings.url}`,
     },
   };
 
   const contactSchema: ContactPageSchema = {
-    '@id': `${config.url}/#contact`,
+    '@id': `${settings.url}/#contact`,
     '@type': 'ContactPage',
     name: title,
     description: intro,
-    author: { '@id': `${config.url}/#branding` },
-    creator: { '@id': `${config.url}/#branding` },
-    editor: { '@id': `${config.url}/#branding` },
-    inLanguage: config.locales.defaultLocale,
+    author: { '@id': `${settings.url}/#branding` },
+    creator: { '@id': `${settings.url}/#branding` },
+    editor: { '@id': `${settings.url}/#branding` },
+    inLanguage: settings.locales.defaultLocale,
     license: 'https://creativecommons.org/licenses/by-sa/4.0/deed.fr',
     mainEntityOfPage: { '@id': `${pageUrl}` },
   };
-- 
cgit v1.2.3

