From 64fb87d0ceb591a49aacad39bf5e885cab7decfa Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Tue, 19 Mar 2024 12:41:06 +0000
Subject: feature(web): Add support for demo mode

---
 apps/web/lib/providers.tsx | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

(limited to 'apps/web/lib/providers.tsx')

diff --git a/apps/web/lib/providers.tsx b/apps/web/lib/providers.tsx
index db51c361..ce667f8d 100644
--- a/apps/web/lib/providers.tsx
+++ b/apps/web/lib/providers.tsx
@@ -7,6 +7,9 @@ import { httpBatchLink, loggerLink } from "@trpc/client";
 import { SessionProvider } from "next-auth/react";
 import superjson from "superjson";
 
+import type { ClientConfig } from "@hoarder/shared/config";
+
+import { ClientConfigCtx } from "./clientConfig";
 import { api } from "./trpc";
 
 function makeQueryClient() {
@@ -40,9 +43,11 @@ function getQueryClient() {
 export default function Providers({
   children,
   session,
+  clientConfig,
 }: {
   children: React.ReactNode;
   session: Session | null;
+  clientConfig: ClientConfig;
 }) {
   const queryClient = getQueryClient();
 
@@ -64,12 +69,14 @@ export default function Providers({
   );
 
   return (
-    <SessionProvider session={session}>
-      <api.Provider client={trpcClient} queryClient={queryClient}>
-        <QueryClientProvider client={queryClient}>
-          {children}
-        </QueryClientProvider>
-      </api.Provider>
-    </SessionProvider>
+    <ClientConfigCtx.Provider value={clientConfig}>
+      <SessionProvider session={session}>
+        <api.Provider client={trpcClient} queryClient={queryClient}>
+          <QueryClientProvider client={queryClient}>
+            {children}
+          </QueryClientProvider>
+        </api.Provider>
+      </SessionProvider>
+    </ClientConfigCtx.Provider>
   );
 }
-- 
cgit v1.2.3-70-g09d2

