From 84903c1e5182124b1bb618b7d8754cb70d0a6647 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 23 Feb 2022 18:11:37 +0100
Subject: feat: improve Ackee tracking (#11)

* build(deps): add use-ackee hook package

* chore: create a context provider for Ackee

The provider allows users to change the 'detailed' settings.

* chore: add a select menu to choose which info to share with Ackee

* chore: add a tooltip for askee settings

* chore: replace default select styles with custom styles

* chore: register user choice in localstorage

* chore: replace Matomo with Ackee in legal notice
---
 src/pages/_app.tsx | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

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

diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 1f5be8f..e8c00de 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -1,5 +1,6 @@
 import { AppPropsWithLayout } from '@ts/types/app';
 import { settings } from '@utils/config';
+import { AckeeProvider } from '@utils/providers/ackee';
 import { PrismThemeProvider } from '@utils/providers/prism';
 import { ThemeProvider } from 'next-themes';
 import { useRouter } from 'next/router';
@@ -12,21 +13,23 @@ 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}
+    <AckeeProvider domain={settings.ackee.url} siteId={settings.ackee.siteId}>
+      <IntlProvider
+        locale={appLocale}
+        defaultLocale={defaultLocale}
+        messages={pageProps.translation}
       >
-        <PrismThemeProvider>
-          {getLayout(<Component {...pageProps} />)}
-        </PrismThemeProvider>
-      </ThemeProvider>
-    </IntlProvider>
+        <ThemeProvider
+          defaultTheme="system"
+          enableColorScheme={true}
+          enableSystem={true}
+        >
+          <PrismThemeProvider>
+            {getLayout(<Component {...pageProps} />)}
+          </PrismThemeProvider>
+        </ThemeProvider>
+      </IntlProvider>
+    </AckeeProvider>
   );
 };
 
-- 
cgit v1.2.3

