From 71d133bb1c73031abbf4869bdd938e583b397773 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 4 Jan 2022 17:13:37 +0100
Subject: refactor: move Prism hook from layout to article page

I will not use Prism elsewhere, so it makes more sense to call Prism
only inside articles.
---
 src/components/Layouts/Layout.tsx | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

(limited to 'src/components/Layouts/Layout.tsx')

diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx
index ac4a043..35e7d27 100644
--- a/src/components/Layouts/Layout.tsx
+++ b/src/components/Layouts/Layout.tsx
@@ -1,13 +1,9 @@
-import { ReactElement, ReactNode, useEffect } from 'react';
-import Prism from 'prismjs';
+import { ReactElement, ReactNode } from 'react';
 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 { t } from '@lingui/macro';
-import { addPrismClasses, translateCopyButton } from '@utils/helpers/prism';
-import { useRouter } from 'next/router';
-import { config } from '@config/website';
 
 const Layout = ({
   children,
@@ -16,18 +12,6 @@ const Layout = ({
   children: ReactNode;
   isHome?: boolean;
 }) => {
-  const router = useRouter();
-  const locale = router.locale ? router.locale : config.defaultLocale;
-
-  useEffect(() => {
-    addPrismClasses();
-    Prism.highlightAll();
-  });
-
-  useEffect(() => {
-    translateCopyButton(locale);
-  }, [locale]);
-
   return (
     <>
       <a href="#main" className="screen-reader-text">{t`Skip to content`}</a>
-- 
cgit v1.2.3

