From 7e16f500cb7bc0cfd8bafbf6bb1555704f771231 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 29 Apr 2022 12:13:34 +0200 Subject: chore: remove old pages, components, helpers and types Since I'm using new components, I will also rewrite the GraphQL queries so it is easier to start from scratch. --- src/components/Layouts/Layout.module.scss | 20 ---- src/components/Layouts/Layout.tsx | 155 ------------------------------ 2 files changed, 175 deletions(-) delete mode 100644 src/components/Layouts/Layout.module.scss delete mode 100644 src/components/Layouts/Layout.tsx (limited to 'src/components/Layouts') diff --git a/src/components/Layouts/Layout.module.scss b/src/components/Layouts/Layout.module.scss deleted file mode 100644 index 33339d4..0000000 --- a/src/components/Layouts/Layout.module.scss +++ /dev/null @@ -1,20 +0,0 @@ -@use "@styles/abstracts/functions" as fun; - -.noscript { - width: 100%; - padding: var(--spacing-xs) var(--spacing-sm); - position: fixed; - top: 0; - z-index: 10; - background: var(--color-bg); - border-bottom: fun.convert-px(3) solid var(--color-border); - color: var(--color-primary-darker); - font-size: var(--font-size-sm); - font-weight: 600; - text-align: center; -} - -.noscript-spacing { - width: 100%; - height: fun.convert-px(80); -} diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx deleted file mode 100644 index ada32b3..0000000 --- a/src/components/Layouts/Layout.tsx +++ /dev/null @@ -1,155 +0,0 @@ -import Footer from '@components/Footer/Footer'; -import Header from '@components/Header/Header'; -import Main from '@components/Main/Main'; -import Breadcrumb from '@components/Breadcrumb/Breadcrumb'; -import { settings } from '@utils/config'; -import Head from 'next/head'; -import { useRouter } from 'next/router'; -import { ReactElement, ReactNode, useEffect, useRef } from 'react'; -import { useIntl } from 'react-intl'; -import { SearchAction, WebSite, WithContext } from 'schema-dts'; -import styles from './Layout.module.scss'; -import Script from 'next/script'; - -const Layout = ({ - children, - isHome = false, -}: { - children: ReactNode; - isHome?: boolean; -}) => { - const intl = useIntl(); - const { asPath, locale } = useRouter(); - const ref = useRef(null); - - useEffect(() => { - ref.current?.focus(); - }, [asPath]); - - type QueryAction = SearchAction & { - 'query-input': string; - }; - - const searchActionSchema: QueryAction = { - '@type': 'SearchAction', - target: { - '@type': 'EntryPoint', - urlTemplate: `${settings.url}/recherche?s={search_term_string}`, - }, - query: 'required', - 'query-input': 'required name=search_term_string', - }; - - const schemaJsonLd: WithContext = { - '@context': 'https://schema.org', - '@id': `${settings.url}`, - '@type': 'WebSite', - name: settings.name, - description: locale?.startsWith('en') - ? settings.baseline.en - : settings.baseline.fr, - url: settings.url, - author: { '@id': `${settings.url}/#branding` }, - copyrightYear: Number(settings.copyright.startYear), - creator: { '@id': `${settings.url}/#branding` }, - editor: { '@id': `${settings.url}/#branding` }, - inLanguage: settings.locales.defaultLocale, - potentialAction: searchActionSchema, - }; - - return ( - <> - - - - - - - - - - - - - - - - - -