From 8f8a3957b5d3b33bafaa0a6afe4187f75d6dd2b7 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 31 Jan 2022 21:33:22 +0100
Subject: chore: add Matomo

---
 src/pages/_app.tsx | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

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

diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 7c6142c..913861e 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -1,5 +1,7 @@
+import { MatomoProvider } from '@datapunt/matomo-tracker-react';
 import { AppPropsWithLayout } from '@ts/types/app';
 import { settings } from '@utils/config';
+import { instance } from '@utils/helpers/matomo';
 import { ThemeProvider } from 'next-themes';
 import { useRouter } from 'next/router';
 import { IntlProvider } from 'react-intl';
@@ -11,19 +13,21 @@ const MyApp = ({ Component, pageProps }: AppPropsWithLayout) => {
 
   const getLayout = Component.getLayout ?? ((page) => page);
   return (
-    <IntlProvider
-      locale={appLocale}
-      defaultLocale={defaultLocale}
-      messages={pageProps.translation}
-    >
-      <ThemeProvider
-        defaultTheme="system"
-        enableColorScheme={true}
-        enableSystem={true}
+    <MatomoProvider value={instance}>
+      <IntlProvider
+        locale={appLocale}
+        defaultLocale={defaultLocale}
+        messages={pageProps.translation}
       >
-        {getLayout(<Component {...pageProps} />)}
-      </ThemeProvider>
-    </IntlProvider>
+        <ThemeProvider
+          defaultTheme="system"
+          enableColorScheme={true}
+          enableSystem={true}
+        >
+          {getLayout(<Component {...pageProps} />)}
+        </ThemeProvider>
+      </IntlProvider>
+    </MatomoProvider>
   );
 };
 
-- 
cgit v1.2.3

