From 3ab9f0423e97af63da4bf6a13ffd786955bd5b3b Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Thu, 26 Oct 2023 21:55:55 +0200
Subject: refactor(hooks,providers): rewrite useAckee hook and AckeeProvider

---
 src/pages/_app.tsx | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

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

diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 0fb17f4..914b0b6 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -1,19 +1,25 @@
-import { ThemeProvider } from 'next-themes';
 import { useRouter } from 'next/router';
+import { ThemeProvider } from 'next-themes';
 import { IntlProvider } from 'react-intl';
 import '../styles/globals.scss';
-import { type AppPropsWithLayout } from '../types';
+import type { AppPropsWithLayout } from '../types';
 import { settings } from '../utils/config';
+import { STORAGE_KEY } from '../utils/constants';
 import { AckeeProvider, PrismThemeProvider } from '../utils/providers';
 
 const App = ({ Component, pageProps }: AppPropsWithLayout) => {
   const { locale, defaultLocale } = useRouter();
-  const appLocale: string = locale || settings.locales.defaultLocale;
+  const appLocale: string = locale ?? settings.locales.defaultLocale;
   const getLayout = Component.getLayout ?? ((page) => page);
   const { translation, ...componentProps } = pageProps;
 
   return (
-    <AckeeProvider domain={settings.ackee.url} siteId={settings.ackee.siteId}>
+    <AckeeProvider
+      domainId={settings.ackee.siteId}
+      server={settings.ackee.url}
+      storageKey={STORAGE_KEY.ACKEE}
+      tracking="full"
+    >
       <IntlProvider
         locale={appLocale}
         defaultLocale={defaultLocale}
-- 
cgit v1.2.3

