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

---
 .storybook/preview.tsx | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

(limited to '.storybook/preview.tsx')

diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx
index 2b7a466..de6afd3 100644
--- a/.storybook/preview.tsx
+++ b/.storybook/preview.tsx
@@ -1,12 +1,13 @@
 import type { Decorator, Preview } from '@storybook/react';
 import { ThemeProvider, useTheme } from 'next-themes';
+import { useDarkMode } from 'storybook-dark-mode';
 import { FC, ReactNode, useEffect } from 'react';
 import { IntlProvider } from 'react-intl';
-import { useDarkMode } from 'storybook-dark-mode';
+import { AckeeProvider } from '../src/utils/providers';
+import '../src/styles/globals.scss';
 import { DocsContainer } from './overrides/docs-container';
 import dark from './themes/dark';
 import light from './themes/light';
-import '../src/styles/globals.scss';
 
 type ThemeWrapperProps = {
   children: ReactNode;
@@ -32,9 +33,16 @@ const withAllProviders: Decorator = (Story) => {
         enableColorScheme={true}
         enableSystem={true}
       >
-        <ThemeWrapper>
-          <Story />
-        </ThemeWrapper>
+        <AckeeProvider
+          domainId="any"
+          server="https://example.com"
+          storageKey="ackee"
+          tracking="full"
+        >
+          <ThemeWrapper>
+            <Story />
+          </ThemeWrapper>
+        </AckeeProvider>
       </ThemeProvider>
     </IntlProvider>
   );
-- 
cgit v1.2.3

